Oct 24, 2008 #1 Kazendar Programmer Joined Oct 23, 2008 Messages 18 Location LB How to get "Computer Description" from stations on network ?
Oct 26, 2008 1 #2 Lundkvist Technical User Joined Aug 13, 2008 Messages 9 Location GB 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") Upvote 0 Downvote
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")
Nov 25, 2008 #3 monsterjta IS-IT--Management Joined Sep 12, 2005 Messages 702 Location US 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 Upvote 0 Downvote
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