Nico
Nico

Reputation: 17

get computer description from computer in network

i have a list of Hostnames from computers in my network and now i want to know how i can get the computer-description from these computers.

Anybody an idea?

Upvotes: 0

Views: 5569

Answers (3)

wolfkabal
wolfkabal

Reputation: 96

All these methods use PowerShell -

You could use a one-liner.

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

Remote computer.

gwmi -computer computername -query "select Description from Win32_OperatingSystem" | select-object Description

Remote computer, passing credentials.

gwmi -computer computername -credentials domain\username -query "select Description from Win32_OperatingSystem" | select-object Description

Or from the registry

$Machine = "MachineToCheck" $reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey("LocalMachine",$Machine) $regKey= $reg.OpenSubKey("System\CurrentControlSet\Services\lanmanserver\parameters") $regkey.GetValue("srvcomment")

Upvotes: 1

Heinzi
Heinzi

Reputation: 172380

I don't have a solution but a few pointers that might help you get going.

In general, you can access the computer description using WMI, in particular, by getting \\nameOfTheRemoteComputer\root\cimv2, executing SELECT * FROM Win32_OperatingSystem and querying the Description property.

By combining these examples, you should get what you need.

Upvotes: 1

Graviton
Graviton

Reputation: 83264

You can try this:

string name = 
    System.Net.Dns.GetHostByName("localhost").HostName

Upvotes: 1

Related Questions