http://community.spiceworks.com/scripts/show/2170-get-a-list-of-installed-software-from-a-remote-computer-fast-as-lightning<\/a><\/p>\nYou can just pipe your Get-ADComputer command right into his script <\/p>","upvoteCount":2,"datePublished":"2013-12-15T10:07:25.000Z","url":"https://community.spiceworks.com/t/getting-installed-software-from-ou/262976/3","author":{"@type":"Person","name":"martin9700","url":"https://community.spiceworks.com/u/martin9700"}},"suggestedAnswer":[{"@type":"Answer","text":"
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.<\/p>\n
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.<\/p>\n
Here is what I have been working with<\/p>\n
$Allworkstations = Get-ADComputer -Filter {Name -like \"*FH0627*\"} -Properties * | Select Name,OperatingSystem \n $Allworkstations | Export-Csv -Path \"H:\\My Documents\\Software\\AllWorkstations.csv\" -NoTypeInformation\n\n $Allworkstations \n ForEach-Object {Get-ChildItem HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\* } \n \n<\/code><\/pre>\nThe 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.<\/p>\n
I have tried exporting to a CSV, and then in a separate powershell script loop the csv for results and the same thing happens.<\/p>\n
Any Idea’s?<\/p>","upvoteCount":5,"datePublished":"2013-12-14T21:45:06.000Z","url":"https://community.spiceworks.com/t/getting-installed-software-from-ou/262976/1","author":{"@type":"Person","name":"adamhenderson3","url":"https://community.spiceworks.com/u/adamhenderson3"}},{"@type":"Answer","text":"
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.<\/p>","upvoteCount":1,"datePublished":"2013-12-15T07:09:55.000Z","url":"https://community.spiceworks.com/t/getting-installed-software-from-ou/262976/2","author":{"@type":"Person","name":"chamele0n","url":"https://community.spiceworks.com/u/chamele0n"}},{"@type":"Answer","text":"
I did miss that one in my google searches. I have the function saved in my $profile, but I am having a permissions issue.<\/p>\n
\"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.<\/p>","upvoteCount":0,"datePublished":"2013-12-16T16:38:33.000Z","url":"https://community.spiceworks.com/t/getting-installed-software-from-ou/262976/4","author":{"@type":"Person","name":"adamhenderson3","url":"https://community.spiceworks.com/u/adamhenderson3"}},{"@type":"Answer","text":"
Try running Powershell as an administrator<\/p>","upvoteCount":0,"datePublished":"2013-12-16T16:46:40.000Z","url":"https://community.spiceworks.com/t/getting-installed-software-from-ou/262976/5","author":{"@type":"Person","name":"martin9700","url":"https://community.spiceworks.com/u/martin9700"}},{"@type":"Answer","text":"
Forgot to say I tried that as well.<\/p>","upvoteCount":0,"datePublished":"2013-12-16T16:53:23.000Z","url":"https://community.spiceworks.com/t/getting-installed-software-from-ou/262976/6","author":{"@type":"Person","name":"adamhenderson3","url":"https://community.spiceworks.com/u/adamhenderson3"}},{"@type":"Answer","text":"
Its like my credentials needs to be cached on the local machine, because I logged out that machine and can still run the script.<\/p>","upvoteCount":0,"datePublished":"2013-12-16T16:55:04.000Z","url":"https://community.spiceworks.com/t/getting-installed-software-from-ou/262976/7","author":{"@type":"Person","name":"adamhenderson3","url":"https://community.spiceworks.com/u/adamhenderson3"}},{"@type":"Answer","text":"
Nevermind…it appears there was a problem with the remote reg service log on account. The service was restarted and everything is working great!<\/p>","upvoteCount":1,"datePublished":"2013-12-16T18:11:59.000Z","url":"https://community.spiceworks.com/t/getting-installed-software-from-ou/262976/8","author":{"@type":"Person","name":"adamhenderson3","url":"https://community.spiceworks.com/u/adamhenderson3"}}]}}
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
chamele0n
(Chamele0n)
December 15, 2013, 7:09am
2
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
martin9700
(Martin9700)
December 15, 2013, 10:07am
3
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
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.
martin9700
(Martin9700)
December 16, 2013, 4:46pm
5
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