• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 705
  • Last Modified:

Remote System Duplex Speed

Can you help me on How do I check the network duplex speed remotely using a script.
0
Dhiraj Mutha
Asked:
Dhiraj Mutha
  • 4
  • 2
1 Solution
 
Haresh NikumbhCommented:
0
 
Dhiraj MuthaAuthor Commented:
This does not work. I tried this before posting this question.
0
 
Justin YeungCommented:
Search for all AD computer with OS -like 2012........... and display the result

$servers = Get-ADComputer -Filter {OperatingSystem -like "*2012*"} -Properties *
foreach ($server in $servers)
{
$Servername = $Server.name

$registry = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine, $serverName)
$baseKey = $registry.OpenSubKey(“SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}”)
$Subkey = $basekey.GetSubKeyNames()  
foreach ($Sub in $Subkey)
{
if ($sub -like "0*")
{
$Result = $baseKey.OpenSubkey($sub).GetValue("*SpeedDuplex") 

switch ($Result) 
    { 
        0 {"$($baseKey.OpenSubkey($sub).GetValue("DriverDesc")) is Auto Negotiation on Server $serverName"} 
        1 {"$($baseKey.OpenSubkey($sub).GetValue("DriverDesc")) is 10 Mbps Half Duplex on Server $serverName"} 
        2 {"$($baseKey.OpenSubkey($sub).GetValue("DriverDesc")) is 10 Mbps Full Duplex on Server $serverName"} 
        3 {"$($baseKey.OpenSubkey($sub).GetValue("DriverDesc")) is 100 Mbps Half Duplex on Server $serverName"} 
        4 {"$($baseKey.OpenSubkey($sub).GetValue("DriverDesc")) is 100 Mbps Full Duplex on Server $serverName"} 
        5 {"$($baseKey.OpenSubkey($sub).GetValue("DriverDesc")) is 1.0 Gbps Half Duplex Server $serverName"} 
        6 {"$($baseKey.OpenSubkey($sub).GetValue("DriverDesc")) is 1.0 Gbps Full Duplex on Server $serverName"}
        7 {"$($baseKey.OpenSubkey($sub).GetValue("DriverDesc")) is in an unknown speed on Server $serverName"} 
    }

}
}
}

Open in new window

0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 
Dhiraj MuthaAuthor Commented:
Thanks Justin. I ran the script and found it running, but everytime it shows up as the Nic is set to Auto Negotiation.
I tried changing the registry from 0 to 4, but still it shows Auto Negotiation.
0
 
Dhiraj MuthaAuthor Commented:
Its ok. I figured it out. Thanks a lot.
The script works great. This is what I was looking for.
0
 
Dhiraj MuthaAuthor Commented:
Exactly what I was looking for. Thanks Justin.
0
 
Justin YeungCommented:
I changed a bit, it should display the registry *SpeedDuplex numbers and see if that is correct, and remember your registry need to be closed after you changed it on the remote server.

$servers = Get-ADComputer -Filter {OperatingSystem -like "*2012*"} -Properties *
foreach ($server in $servers)
{
$Servername = $Server.name

$registry = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine, $serverName)
$baseKey = $registry.OpenSubKey(“SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}”)
$Subkey = $basekey.GetSubKeyNames()  
foreach ($Sub in $Subkey)
{
if ($sub -like "0*")
{
$Result = $baseKey.OpenSubkey($sub).GetValue("*SpeedDuplex") 

Write-Host $result "of" $($baseKey.OpenSubkey($sub).GetValue("DriverDesc")) "on" $Servername

}
}
} 

Open in new window

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now