Get-ComputerInfo - Query Computer Info From Local/Remote Computers - (WMI)

This function will collect various data elements from a local or remote computer.

 
 
 
 
 
5 Star
(7)
10,244 times
Add to favorites
Operating System
3/6/2013
E-mail Twitter del.icio.us Digg Facebook
  • Addition of Fields
    1 Posts | Last post February 20, 2017
    • Can you please let us know on how to add 
      1. List of all USB Devices
      2. Whether USB is enabled or not?
      3. List of Users (Local or Domain) with user Account details like the groups they are associated (like Users, Administrators, Power Users, etc.)
      4. List of Anti Virus Software Installed with the status (like Enabled/Disabled)
      5. List of Drives (like HDD (already available in your script though), CD, DVD, Floppy, external Media devices)
      6. Option of specifying the list of server list in a external serverlist.txt file
      7. Export to csv like https://gallery.technet.microsoft.com/scriptcenter/PowerShell-Script-Get-beced710
      
  • On error resume
    1 Posts | Last post December 10, 2014
    • Hi
      
      Thanks for the script.
      
      Is there a way that the script can ignore errors and pipe out any results it's able to populate?
      
      I'm having problems with some of the registry keys, even with my account being domain admin and using the Run As - Administrator.
      
  • Output
    2 Posts | Last post October 17, 2013
    • Hi 
      How would i go about outputting the result of this to a HTML file
      I tried using Get-ComputerInfo | ConvertTo-HTML | Out-File C:\Scripts\Test.htm but the result in all in one line
    • Jay,
      This has been an issue that I've debated how to handle best.  You can do something like this:
      
      Get-ComputerInfo | % {$_ | ConvertTo-Html | Out-File C:\Users\bcw013\Desktop\Test.html -Append}
      
      It gives a little more detail, but it's still not as complete as you probably want.  Exporting this data is something I've planned to tackle at some point in the future, as I've had time, which hasn't be the case lately.
  • i have a issue
    2 Posts | Last post September 26, 2013
    • PS E:\BMS\zubair\Powershell> .\Get-ComputerInfo.ps1 .\
      
      PS E:\BMS\zubair\Powershell> .\Get-ComputerInfo.ps1 -computer name localhost
      
      PS E:\BMS\zubair\Powershell> .\Get-ComputerInfo.ps1 Out-File txt.txt
      
      PS E:\BMS\zubair\Powershell> .\Get-ComputerInfo.ps1 -computer name ahmedmr1
      
      PS E:\BMS\zubair\Powershell> .\Get-ComputerInfo.ps1 -computername ahmedmr1
      
      PS E:\BMS\zubair\Powershell> .\Get-ComputerInfo -computername ahmedmr1
      
      PS E:\BMS\zubair\Powershell> E:\BMS\zubair\Powershell\Get-ComputerInfo.ps1
      
      PS E:\BMS\zubair\Powershell> .\Get-ComputerInfo.ps1
      
      PS E:\BMS\zubair\Powershell> .\Get-ComputerInfo  ahmedmr1
      
      PS E:\BMS\zubair\Powershell> .\Get-ComputerInfo
      
      PS E:\BMS\zubair\Powershell> .\Get-ComputerInfo
      
      
      Script is stored in the mentioned path but it shows the result as you see in the below output.
      i have added it has cmdlet also 
      Please advice
    • Zubair,
      I designed the script to be loaded as a function in your current PowerShell console.  You can load it by preceding it with a period, like so:
      
      PS E:\BMS\zubair\Powershell> . .\Get-ComputerInfo.ps1
      
      Once you have completed this, you can run it as a cmdlet/function.
      
      PS E:\BMS\zubair\Powershell> Get-ComputerInfo -ComputerName WKS01, WKS02, ETC
  • Can you help?
    2 Posts | Last post January 25, 2013
    • I am trying to run the script and am not able to.  Can you please provide me with some assistance?
      
      Below is the error:
      PS C:\>>> . c:\Get-ComputerInfo.ps1
      PS C:\>>> Get-ComputerInfo -ComputerName MLI001801N71008
      The term 'Get-ComputerInfo' is not recognized as the name of a cmdlet, function, script file, or operable program. Chec
      k the spelling of the name, or if a path was included, verify that the path is correct and try again.
      At line:1 char:17
      + Get-ComputerInfo <<<<  -ComputerName MLI001801N71008
          + CategoryInfo          : ObjectNotFound: (Get-ComputerInfo:String) [], CommandNotFoundException
          + FullyQualifiedErrorId : CommandNotFoundException
      
      
      Suggestion [3,General]: The command Get-ComputerInfo was not found, but does exist in the current location. Windows Powe
      rShell doesn't load commands from the current location by default. If you trust this command, instead type ".\Get-Comput
      erInfo". See "get-help about_Command_Precedence" for more details.
      
      
      Thank you!
    • W,
      
      Three things:
      1. Ensure the file isn't blocked, right click the ps1 file and click properties, then ensure that there is not an unblock button at the bottom.
      2. Make note of the file path.  In this example, I'm going to assume the file is stored on the root of C:\
      3. Dot sourcing the file/script:  When you load the script into powershell, do the following:
      PS C:\> . .\Get-ComputerInfo.ps1
      **Note the dots, there is a space between the first and second "dot".
      
      Once you have done this, you should be able to run the "function".  Either way, let me know the results.
  • Problem with getting info from another computer
    2 Posts | Last post November 16, 2012
    • I can run this on my local machine and it runs just fine. When I try to run it against other machines on my network i get errors. One of them being WARNING: Exception calling "OpenRemoteBaseKey" with "2" argument(s): "The network path was not found. Another being WARNING: Provider failure
    • Ramey870,
      Would you check to see if the remote system you are trying to gather data on has the remote registry service started?  That would address the first issue.  The second one may take a little more effort.  For the second issue, when you run in to it, type $Error[0] at the PowerShell Prompt and send me results via email.  My email address is in the help section of the function.
  • Executing Get-ComputerInfo
    3 Posts | Last post August 08, 2012
    • Hi, copying the code and saved it as .ps1 file but when I execute it on powershell console it does not do anything and just goes back to the prompt without result. Is there anything I need to do e.g remove section of the script for it to work? Thank You.
    • JM2012_1,
      This is a function and has to be loaded in PowerShell in order to work properly.  When you download the .ps1 file, note the location where you saved the file and do the following:
      1. Launch PowerShell (Elevated)
      2. At the prompt, type the following, without quotes: ". C:\Users\Brian\Downloads\Get-ComputerInfo.ps1" Where C:\Users\.. is the location of the .ps1 file.  Also, note the space between the period and the path.
      3. Now that you have it loaded, you can treat it as a cmdlet and execute it as follows:
      Get-ComputerInfo Server1, Server2, Server3
      Or
      Get-ComputerInfo (Get-Content C:\ComputerList.txt) #Where the ComputerList.txt has computer names in it.
    • Ecellent it worked, thanks Brian!!!