I know there are tons of forums on the net on this topic, I have been google-ing for a few days, but nothing does exactly what I am looking for.

I am trying to query specific computers in an OU for installed software. Sometimes when we deploy software the end user reports (in typical end user style) the software hasn’t “installed anywhere” I would like to run a script to query those machines and extract the installed software.

Here is what I have been working with

 $Allworkstations = Get-ADComputer -Filter {Name -like "*FH0627*"} -Properties * | Select Name,OperatingSystem 
 $Allworkstations | Export-Csv -Path "H:\My Documents\Software\AllWorkstations.csv" -NoTypeInformation

 $Allworkstations  
 ForEach-Object {Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\* } 
 

The top half works, I can return the machines in the OU with the correct machine name and OS version. The problem comes when I try to pipe those results and get the software. What happens is the Get-Child Item queries MY workstation, not the remote.

I have tried exporting to a CSV, and then in a separate powershell script loop the csv for results and the same thing happens.

Any Idea’s?

5 Spice ups

Is it not showing up in the Software list for the device in Spiceworks? No script required. If the workstation is being scanned you already have a list of software installed.

1 Spice up

Twon wrote an excellent script that will get a software list from the registry and it’s wicked fast.

http://community.spiceworks.com/scripts/show/2170-get-a-list-of-installed-software-from-a-remote-computer-fast-as-lightning

You can just pipe your Get-ADComputer command right into his script :slight_smile:

2 Spice ups

I did miss that one in my google searches. I have the function saved in my $profile, but I am having a permissions issue.

"Exception calling “OpenRemoteBaseKey” with “2” argument(s): “Attempted to perform an unauthorized operation” The remote Registry Service is running. I can log in to a machine with my NT credintials and then run the script from my workstation and it works flawlessly. My Account should have full admin rights.

Try running Powershell as an administrator

Forgot to say I tried that as well.

Its like my credentials needs to be cached on the local machine, because I logged out that machine and can still run the script.

Nevermind…it appears there was a problem with the remote reg service log on account. The service was restarted and everything is working great!

1 Spice up