Solved

Remote System Duplex Speed

Posted on 2014-04-14
7
638 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 22

Expert Comment

by:Haresh Nikumbh
ID: 40000472
0
 
LVL 14

Author Comment

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

Accepted Solution

by:
Justin Yeung earned 500 total points
ID: 40002535
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.

 
LVL 14

Author Comment

by:Dhiraj Mutha
ID: 40002574
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
ID: 40002601
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
ID: 40002603
Exactly what I was looking for. Thanks Justin.
0
 
LVL 14

Expert Comment

by:Justin Yeung
ID: 40002612
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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A brief introduction to what I consider to be the best editor for PowerShell.
The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

717 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