Get-RemoteProgram Get list of installed programs on remote or local computer

This script generates a list by querying the registry and returning the installed programs of a local or remote computer. It allows for retrieval of additional properties such as the uninstall string of an application as well.

 
 
 
 
 
4.4 Star
(64)
105,136 times
Add to favorites
Operating System
8/5/2019
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Excluding known Apps
    7 Posts | Last post April 10, 2018
    • Hello, great script!
      
      I was wondering if I could remove results that are on every PC using an array ( txt file)
      
      Example, every Pc in my domain has Adobe Air, Flash, Office etc set for compliance
      
      We’re doing a refresh project soon and I was hoping to make this a bit more efficient.
      
      I’d like to use the text file instead of within the application so I only have to update the external txt file
    • Hello WindowsUser127,
      
      I have introduced the ExcludeProgram/IncludePRogram parameter for this purpose. So depending on if you want to include / exclude the programs you mentioned you could run either:
      
      Get-RemoteProgram -ExcludeProgram 'Adobe Air|Flash|Office' -ProgramRegExMatch
      
      Or to include and only display the programs you specify:
      Get-RemoteProgram -IncludeProgram 'Adobe Air|Flash|Office' -ProgramRegExMatch
      
      
      Let me know how that works for you!
      
      
      Regards,
      
      Jaap Brasser
    • I don't see a way to put items in a txt file?  Currently my text file looks like this
      
      Adobe Air*
      Adobe Flash*
      AMD HD Video Driver and Control Panel*
      IDT High Definition Audio Driver*
      
      etc....
    • and sorry...  this is phenomenal work.
      I'm just trying to keep the excluded items in a separate txt so I'm not editing the script.
    • Ignore me.  I figured out the text file
      
      I did run into an issue with Microsoft Visual C++ 2005 Redistributable
      
      C++" - Nested quantifier +.
      At line:1 char:1
      + Get-RemoteProgram -ExcludeProgram $exclude -ProgramRegExMatch  | Sort ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
          + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-RemoteProgram
    • Hello WindowsUser127,
      
      I don't know what your $Exclude variable contains exactly, but since we are doing regular expression matching you should be careful with special characters such as + . ? *.
      
      One option is to escape everything in your text file, so if you have a multiline text file containing the following:
      
      Adobe Air
      Adobe Flash
      AMD HD Video Driver and Control Panel
      IDT High Definition Audio Driver
      Microsoft Visual C++ 2005 Redistributable
      
      You could exclude these by doing the following:
      Get-RemoteProgram -ProgramRegExMatch -ExcludeProgram (Get-Content YourFile.txt | ForEach-Object {[regex]::Escape($_)}) -join '|')
    • Wonderful, let me work on this and provide feedback when I can.
  • icm method
    4 Posts | Last post April 08, 2018
    • Hello Jaap,
      i've modified your script to use invoke-command & get-itemproperty method instead of remote registry service. In my experience it provides results much faster and works around using smb comm port 445 which is frequently blocked on servers.
      Let me know what you think about it: https://gallery.technet.microsoft.com/scriptcenter/Get-RemoteApplication-05cfd58a
      
      Thomas
    • Hi no_escape,
      
      I like your idea, nice modifications and good to leverage PowerShell remoting. It is definitely the way forward for the future.
      
      But if your goal is remote execution then you could also invoke Get-RemoteProgram using Invoke-Command and it would be even faster. Because the .Net Classes used in this function are faster than the PowerShell cmdlets that are used in Get-RemoteApplication. For comparison try the following Command:
      
      [pscustomobject]@{RemoteProgram = (measure-command {Get-RemoteProgram}).TotalMilliseconds;RemoteApplication=(measure-command {get-remoteapplication}).TotalMilliseconds}
      
      The advantage of remote registry is that you are not relying on PowerShell Remoting which helps in mixed environments, for which this function was developed.
      
    • Thanks for your comment, I should have tested the performance between the cmdlets and the .net class first :) Yes my goal was remote execution. Guess its better to just invoke the original version with icm, the performace is much better in favor of the .net class like you've said.
      
      Still, maybe you could incorporate the icm solution in case people want to execute this remotely? Remote registry service is painfully slow from my experience. Just an idea to share with others, I am more than happy to tweak the script for my own purposes.
      
      Regards,
      
      Thomas
    • Hello Thomas,
      
      I agree, that would be a valuable feature, I intended to implement this in a future release. You can track the issue here: https://github.com/jaapbrasser/SharedScripts/issues/22
      
      
      Regards,
      
      Jaap Brasser
  • Help with below statement
    5 Posts | Last post April 05, 2018
    • To clarify the below question by me
      
      I'd like to have items in the text file like this
      
      Adobe Air
      Adobe Flash Player
      Adobe Shockwave Player 
      
      This way anything that matches those items gets removed and I'm not tied to versions of the software
    • Hello WindowsUser127,
      
      I have created an issue for filtering the output based on ProgramName, I will update the script and include the changed. You can track the issue here:
      
      https://github.com/jaapbrasser/SharedScripts/issues/18
      
      
      Regards,
      
      Jaap Brasser
    • Well that’s very kind of you.  I can’t believe I’m the first person to bring this up.
      Good luck and thank you!
    • Definitely not just you WindowsUser127. I know I and a number of others (if checking the comment history here) would love getting this added. Just Tweeted Jaap to see the status of making this happen. Hopefully we hear from him.
    • I added this in the latest update 1.4, give it a whirl and let me know what you think!
  • Reading PCs from list & exluding apps from list
    2 Posts | Last post March 06, 2018
    • Love this script Jaap, but hoping there's a way to make it even better for our purpose. Is there a way to:
      - Add the option so instead of typing out all sorts of PC names, it just pulls from like a text file or csv?
      - Like the below user stated, add an option of excluding programs located in a text file or csv?
    • Hello GodzFire,
      
      I have created an issue for the filtering by ProgramName, it is listed here:
      https://github.com/jaapbrasser/SharedScripts/issues/18
      
      As for pulling the PC names from file this is already supported. Here are some examples of how you can get this to work:
      Get-RemoteProgram -ComputerName (Get-Content -Path Computers.txt)
      Import-Csv -Path Computers.csv | Get-RemoteProgram
      Get-Content -Path Computers.txt | Get-RemoteProgram
      
      Let me know if that works for you!
      
      
      Regards,
      
      Jaap Brasser
      
      
  • The script doesn't output any results
    2 Posts | Last post February 08, 2018
    • Hi,
      
      I tried to run the command as .\get-remoteprogram and i'm not getting anything then i tried to use the .\get-remoteprogram;get-remoteprogram command and I got an error message.
      
      I'm new to PowerShell so I'm not sure what is the command I need to run in order to get an output file.
      
      
    • You need to load the script into PowerShell before it will be recognised.
      To do this do the following.
      
      1. Open PowerShell, navigate to the directory containing the 'Get-RemoteProgram.ps1' script.
      2. From PowerShel type . .\Get-RemoteProgram.ps1 and hit enter. (Ensure the periods have a space between them or it won't load!!!)
      3. From PowerShell you can then type Get-RemoteProgram and the cmdlet should now be recognised.
      
      If successful once you type 'Get-RemoteProgram' PowerShell will recognise the new function complete with any built-in cmdlets.
      
      If unsuccessful when you attempt to run the new function you will get an error. See Example below.
      
      'get-FunctionName : The term 'get-FunctionName' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.'
      
      *NB: If this occurs repeat steps 1 to 3.
  • Gets output of applications, on machines not even existing?
    6 Posts | Last post February 08, 2018
    • Hi!
      I try to run your Script like this: 
      gc C:\computerlist.txt | Get-RemoteProgram -ExcludeSimilar -SimilarWord 4 | Out-File C:\applications.txt
      
      For test purposes, my computerlist.txt include 3 computernames. The first one is fake, other is my localhost, last one also fake.
      I get two of these warnings, as expected: 
      Exception calling "OpenRemoteBaseKey" with "2" argument(s): "NetworkPath was not found.(translated from Swedish)
      "At C:\Temp\Get-RemoteProgram.ps1:91 char:13
      +             $RegBase = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseK ...
      +             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
          + FullyQualifiedErrorId : IOException
      
      But in my applications.txt I get an output of Applications from my localhost(second) AND the third fake one (it just output the same apps as my localhost).
      
      Why is that? Am I missing something?
    • There is a minor bug in the script. The variable $RegBase is not being cleared between attempts to open a new registry, so the check if($RegBase) returns TRUE even when OpenRemoteBaseKey fails. 
      
      If you add the line "$RegBase = $null" just before the OpenRemoteBaseKey line, it will resolve this issue. 
    • still its not working after adding 
      $RegBase = $null before the OpenRemoteBaseKey line
    • Thank you, Just_M3!
      It solved my issues with computers, not supposed to be there, in my applications.txt!
    • Not working for me either even after adding $RegBase = $null before the OpenRemoteBaseKey line. What have I missed?
    • This happens if 'Remote Registry' service hasn't been started on the target workstation.
  • Target specific applications
    2 Posts | Last post February 08, 2018
    • Hello. I am trying to adopt this script to find a specific program on a list of computers. Is it possible to do this?
    • You need to load the script into PowerShell before it will be recognised.
      To do this do the following.
      
      1. Open PowerShell, navigate to the directory containing the 'Get-RemoteProgram.ps1' script.
      2. From PowerShel type . .\Get-RemoteProgram.ps1 and hit enter. (Ensure the periods have a space between them or it won't load!!!)
      3. From PowerShell you can then type Get-RemoteProgram and the cmdlet should now be recognised.
      
      If successful once you type 'Get-RemoteProgram' PowerShell will recognise the new function complete with any built-in cmdlets.
      
      If unsuccessful when you attempt to run the new function you will get an error. See Example below.
      
      'get-FunctionName : The term 'get-FunctionName' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.'
      
      *NB: If this occurs repeat steps 1 to 3.
      
  • The program run with error. Pls help..
    1 Posts | Last post December 04, 2017
    • PS C:\temp> 'DESKTOP-PC' | Get-RemoteProgram -Property Uninstallstring
      Get-RemoteProgram : The term 'Get-RemoteProgram' is not recognized as the name of a cmdlet, function, script file, or
      operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
      again.
      At line:1 char:18
      + 'DESKTOP-PC' | Get-RemoteProgram -Property Uninstallstring
      +                  ~~~~~~~~~~~~~~~~~
          + CategoryInfo          : ObjectNotFound: (Get-RemoteProgram:String) [], CommandNotFoundException
          + FullyQualifiedErrorId : CommandNotFoundException
  • Check installed programs under a Windows profile
    1 Posts | Last post October 03, 2017
    • Jaap, Thanks for sharing the great script! I was able to update the script to get programs installed under a user profile. But the problem is it can only check the same user's installed programs on the remote machine as the host machine where I ran the script. I was wondering if I'm the admin on the remote machine, is there a way to check another user's installed programs on that remote machine? Thank you!
  • i ma getting the below error
    3 Posts | Last post August 03, 2017
    • 
      PS C:\Windows\system32> Get-RemoteProgram -ComputerName ldrctxvndbimg01
      Exception calling "OpenRemoteBaseKey" with "2" argument(s): "The network path was not found.
      "
      At C:\Newfolder\Get-RemoteProgram.ps1:91 char:13
      +             $RegBase = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microso ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
          + FullyQualifiedErrorId : IOException
      
      PS C:\Windows\system32>
      
      
    • HIJAAp,
      please help me out
    • For those running into this error, I have found that the Remote Registry service must be enabled on the remote machine in order for this to work since it queries the registry on the machine to fetch the list of installed software.
      
      If you have the appropriate permissions in your network, you should be able to enable this service remotely by using Computer Management, then connecting to the remote computer, and then view the listing of services on that machine.
      
      I hope this helps and sorry my answer is about a month late.
11 - 20 of 73 Items