Hi,
All of First, Thanks for all ITProTV team for build up this precious platform. It is really very helpful for learning and improve the skills.
I have one question regarding powershell scripting. I have one powershell script which is turning off the sleep mode of NIC adapter.
$NICs = Get-NetAdapter | Where-Object {$_.status -eq 'Up'}
Foreach ($NIC in $NICs)
{
$powerMgmt = Get-WmiObject MSPower_DeviceEnable -Namespace root\wmi | where {$_.InstanceName -match [regex]::Escape($nic.PNPDeviceID)}
If ($powerMgmt.Enable -eq $True)
{
$powerMgmt.Enable = $False
$powerMgmt.psbase.Put()
}
}
It successfully turning off the sleep mode of some NIC adapter where only single adapter is available i.e. on workstations however it is not working on most of machines on which have more than 2 NIC Adapters. Not sure what is the problem.
anybody give me a right direction ?
Thanks,
Barinder Singh