Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Computer Description 1

Status
Not open for further replies.

Kazendar

Programmer
Oct 23, 2008
18
LB
How to get "Computer Description" from stations on network ?

 
You could get it by reading it straight from the registry on the remote machine(s).

Code:
$Machine = "MachineToCheck"
$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey("LocalMachine",$Machine)
$regKey= $reg.OpenSubKey("System\\CurrentControlSet\\Services\\lanmanserver\\parameters")
$regkey.GetValue("srvcomment")
 
You could use a one-liner.

Code:
gwmi -query "select Description from Win32_OperatingSystem" | select-object Description

Remote computer.

Code:
gwmi -computer [i]computername[/i] -query "select Description from Win32_OperatingSystem" | select-object Description

Remote computer, passing credentials.

Code:
gwmi -computer [i]computername[/i] -credentials [i]domain\username[/i] -query "select Description from Win32_OperatingSystem" | select-object Description

HTH,

Jonathan Almquist
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top