Blog Post

PowerShell – System Information

,

Different ways to find system information are given below:-

  • Method 1:Querying WMI objects
    • Download the code SystemInfo
    • Create the function with Powershell console and call the function with ComputerName as its argument
.SYNOPSIS 
Get Complete details of any server Local or remote 
.DESCRIPTION 
This function uses WMI class to connect to remote machine and get all related details 
.PARAMETER COMPUTERNAMES 
Just Pass computer name as Its parameter 
.EXAMPLE  
Get-SystemInfo 
.EXAMPLE  
Get-SystemInfo -ComputerName HQSPDBSP01 
.NOTES 
To get help: 
Get-Help Get-SystemInfo 
.LINK 
https://sqlpowershell.wordpress.com 

Function Call: 
PS:\>Get-SystemInfo -ComputerName <computername>
 Ouptut:-
 Method 2:- Reference from Powershell Tip
  • Use of systeminfo.exe with Powershell. Copy and Paste the below code and call the function
function Get-SystemInfo 
{ 
  param($ComputerName = $env:ComputerName) 
      $header = 'Hostname','OSName','OSVersion','OSManufacturer','OSConfig','Buildtype', 'RegisteredOwner','RegisteredOrganization','ProductID','InstallDate', 'StartTime','Manufacturer','Model','Type','Processor','BIOSVersion', 'WindowsFolder' ,'SystemFolder','StartDevice','Culture', 'UICulture', 'TimeZone','PhysicalMemory', 'AvailablePhysicalMemory' , 'MaxVirtualMemory', 'AvailableVirtualMemory','UsedVirtualMemory','PagingFile','Domain' ,'LogonServer','Hotfix','NetworkAdapter' 
      systeminfo.exe /FO CSV /S $ComputerName |  
            Select-Object -Skip 1 |  
            ConvertFrom-CSV -Header $header 
}
 
 Output:-

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating