Avatar of Brad Sims
Brad Sims
Flag for United States of America

asked on 

Compare software on two different domain computers

All,

I found these PowerShell commands on a website to pull a software lists from two separate machines and compare the lists.  My questions are:

1.  Is it possible to automate this with PowerShell ISE?
2.  Can this be scripted so it accepts the domain credentials and both computer names as variables?
3.  Can the output be saved to a network share?  \\servername\myshareddrive, for example.

I have figured out how to run single commands in PowerShell, but I have zero experience with PowerShell ISE and scripting multiple commands.  What would the script look like if this can be accomplished?

 Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object Displ
ayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize > C:\Users\User1\Documents\InstalledPrograms
-PS.txt

 Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object Displ
ayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize > C:\Users\User2\Documents\InstalledPrograms-PS2.txt

 Compare-Object -ReferenceObject (Get-Content C:\Users\User2\Documents\InstalledPrograms-PS.txt) -DifferenceObje
ct (Get-Content C:\Users\SavedToNetworkShare\Documents\InstalledPrograms-PS2.txt)

Open in new window

PowershellSoftware

Avatar of undefined
Last Comment
Brad Sims

8/22/2022 - Mon