Solved

Remote System Duplex Speed

Posted on 2014-04-14
7
580 Views
Last Modified: 2014-04-15
Can you help me on How do I check the network duplex speed remotely using a script.
0
Comment
Question by:Dhiraj Mutha
  • 4
  • 2
7 Comments
 
LVL 21

Expert Comment

by:Haresh Nikumbh
Comment Utility
0
 
LVL 14

Author Comment

by:Dhiraj Mutha
Comment Utility
This does not work. I tried this before posting this question.
0
 
LVL 14

Accepted Solution

by:
Justin Yeung earned 500 total points
Comment Utility
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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 14

Author Comment

by:Dhiraj Mutha
Comment Utility
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
 
LVL 14

Author Comment

by:Dhiraj Mutha
Comment Utility
Its ok. I figured it out. Thanks a lot.
The script works great. This is what I was looking for.
0
 
LVL 14

Author Closing Comment

by:Dhiraj Mutha
Comment Utility
Exactly what I was looking for. Thanks Justin.
0
 
LVL 14

Expert Comment

by:Justin Yeung
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Set OWA language and time zone in Exchange for individuals, all users or per database.
This article will help you understand what HashTables are and how to use them in PowerShell.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now