When I started this blog I was not going to go down the path of just linking stuff others have posted, and if I did, only if I was adding something to it. However, I found the following article so interesting that I'm linking it here really just for my own benifit. Well worth a read.
Windows 7 IOPS for VDI: Deep Dive
Showing posts with label Windows 7. Show all posts
Showing posts with label Windows 7. Show all posts
Wednesday, 21 November 2012
Monday, 18 June 2012
Setting Power Management Options on a Network Card
I'm currently working on implementing Wake on LAN (WOL) for a customer's network. I'll probably post more on what I've found out will researching this in the future. Today I thought I'd share a script I've created to enable the correct power management options, that are needed on the appropriate network adaptors, to ensure WOL works.
I wanted a script to ensure the three options in the screen grab below are enabled. PowerShell is my preferred scripting solution, and this customer also wants as much scripting done in PowerShell as possible. I found a number of VBScripts examples that I then used to construct my PowerShell script, so I don't take credit for the logic here but I couldn't find a complete PowerShell solution so I hope this is useful for someone. I'm no PowerShell guru, so if anyone sees ways to improve this script - please feel free to share ideas.
Anyway, here is the screen grab showing the settings I wanted to set:
Here are some links to where I got my logic and ideas from:
ConfigMgr 2007: Implementing Wake-on-LAN (WoL): This article explains setting up WOL with ConfigMgr very well and includes a VBScript that was my main source for understanding what WMI exposed that I could use for my script
Configure a Network Adapter to Wake a Computer Via PowerShell: This article was where I found the base I used for my script in PowerShell, it shows how to get at one of the properties via WMI, after figuring this out the rest of the script was easy.
My script follows below. One thing I've added that is different from the two great articles above is that I look only for physical ethernet adaptors. I don't try to configure these settings on virtual adaptors or wireless adaptors (others might want to do this for wireless adaptors, Windows 7 does support WOL over wireless, but that isn't a requirement for my customer). Eliminating virtual adaptors from being configured stops the script touching the various virtual adaptors that various remote access solutions like to add to Windows.
UPDATE 19 June 2012:
Testing today on a laptop I found the above script will identify the inbuilt Intel Centrino Ultimate-N 6300 AGN on a Dell Latitude E6510 as an Ethernet adaptor when it plainly isn't. It then fails to set some of the properties above as they are not supported. Not a big deal, the inbuilt Ethernet adaptor is treated correctly so the result is successful, but messy. I might have to use the 'netenabled' filter used in the PowerShell Guys' posting above.
UPDATE 06 July 2012:
Here is my updated script to exclude wireless and other cards:
I wanted a script to ensure the three options in the screen grab below are enabled. PowerShell is my preferred scripting solution, and this customer also wants as much scripting done in PowerShell as possible. I found a number of VBScripts examples that I then used to construct my PowerShell script, so I don't take credit for the logic here but I couldn't find a complete PowerShell solution so I hope this is useful for someone. I'm no PowerShell guru, so if anyone sees ways to improve this script - please feel free to share ideas.
Anyway, here is the screen grab showing the settings I wanted to set:
Here are some links to where I got my logic and ideas from:
ConfigMgr 2007: Implementing Wake-on-LAN (WoL): This article explains setting up WOL with ConfigMgr very well and includes a VBScript that was my main source for understanding what WMI exposed that I could use for my script
Configure a Network Adapter to Wake a Computer Via PowerShell: This article was where I found the base I used for my script in PowerShell, it shows how to get at one of the properties via WMI, after figuring this out the rest of the script was easy.
My script follows below. One thing I've added that is different from the two great articles above is that I look only for physical ethernet adaptors. I don't try to configure these settings on virtual adaptors or wireless adaptors (others might want to do this for wireless adaptors, Windows 7 does support WOL over wireless, but that isn't a requirement for my customer). Eliminating virtual adaptors from being configured stops the script touching the various virtual adaptors that various remote access solutions like to add to Windows.
#
#
# Purpose: Enables Wake on LAN (WOL) settings on active wired network cards
#
# Usage : powershell.exe -f .\EnableWOL.ps1
#
# Version 1.0
#
# Maintenance History
# ----------------------------------------------------------------------
# Version - Date - Change - Author
# ----------------------------------------------------------------------
# 1.0 18/06/12 Script Created justanothertechnicalblog
#
#
$nics = Get-WmiObject Win32_NetworkAdapter -filter "AdapterTypeID = '0' AND PhysicalAdapter = 'true'"
foreach ($nic in $nics)
{
$nicName = $nic.Name
Write-Host "--- Enable `"Allow the computer to turn off this device to save power`" on $nicName ---"
$nicPower = Get-WmiObject MSPower_DeviceEnable -Namespace root\wmi | where {$_.instancename -match [regex]::escape($nic.PNPDeviceID) }
$nicPower.Enable = $True
$nicPower.psbase.Put()
Write-Host "--- Enable `"Allow this device to wake the computer`" on $nicName ---"
$nicPowerWake = Get-WmiObject MSPower_DeviceWakeEnable -Namespace root\wmi | where {$_.instancename -match [regex]::escape($nic.PNPDeviceID) }
$nicPowerWake.Enable = $True
$nicPowerWake.psbase.Put()
Write-Host "--- Enable `"Only allow a magic packet to wake the computer`" on $nicName ---"
$nicMagicPacket = Get-WmiObject MSNdis_DeviceWakeOnMagicPacketOnly -Namespace root\wmi | where {$_.instancename -match [regex]::escape($nic.PNPDeviceID) }
$nicMagicPacket.EnableWakeOnMagicPacketOnly = $True
$nicMagicPacket.psbase.Put()
}
UPDATE 19 June 2012:
Testing today on a laptop I found the above script will identify the inbuilt Intel Centrino Ultimate-N 6300 AGN on a Dell Latitude E6510 as an Ethernet adaptor when it plainly isn't. It then fails to set some of the properties above as they are not supported. Not a big deal, the inbuilt Ethernet adaptor is treated correctly so the result is successful, but messy. I might have to use the 'netenabled' filter used in the PowerShell Guys' posting above.
UPDATE 06 July 2012:
Here is my updated script to exclude wireless and other cards:
# ----------------------------------------------------------------------
#
# Purpose: Enables Wake on LAN (WOL) settings on active wired network cards
#
# Usage : powershell.exe -f .\EnableWOL.ps1
#
# Version 1.0
#
# Maintenance History
# ----------------------------------------------------------------------
# Version - Date - Change - Author
# ----------------------------------------------------------------------
# 1.0 18/06/12 Script Created justanothertechnicalblog
# 2.0 04/07/12 Updated to exclude justanothertechnicalblog
# Wireless/WiFi/Bluetooth
# Get all physical ethernet adaptors
$nics = Get-WmiObject Win32_NetworkAdapter -filter "AdapterTypeID = '0' `
AND PhysicalAdapter = 'true' `
AND NOT Description LIKE '%Centrino%' `
AND NOT Description LIKE '%wireless%' `
AND NOT Description LIKE '%WiFi%' `
AND NOT Description LIKE '%Bluetooth%'"
foreach ($nic in $nics)
{
$nicName = $nic.Name
Write-Host "--- Enable `"Allow the computer to turn off this device to save power`" on $nicName ---"
$nicPower = Get-WmiObject MSPower_DeviceEnable -Namespace root\wmi | where {$_.instancename -match [regex]::escape($nic.PNPDeviceID) }
$nicPower.Enable = $True
$nicPower.psbase.Put()
Write-Host "--- Enable `"Allow this device to wake the computer`" on $nicName ---"
$nicPowerWake = Get-WmiObject MSPower_DeviceWakeEnable -Namespace root\wmi | where {$_.instancename -match [regex]::escape($nic.PNPDeviceID) }
$nicPowerWake.Enable = $True
$nicPowerWake.psbase.Put()
Write-Host "--- Enable `"Only allow a magic packet to wake the computer`" on $nicName ---"
$nicMagicPacket = Get-WmiObject MSNdis_DeviceWakeOnMagicPacketOnly -Namespace root\wmi | where {$_.instancename -match [regex]::escape($nic.PNPDeviceID) }
$nicMagicPacket.EnableWakeOnMagicPacketOnly = $True
$nicMagicPacket.psbase.Put()
}
Tuesday, 12 June 2012
Windows 7, App-V and Slow Start-up and Logon
On a Windows 7 SOE I've just built for a customer, start-up and logon times were unacceptable. There was a number of reasons for this, but one was actually caused by App-V. Who would have thought? Microsoft has released several hotfix rollup packages for App-V and the last one certainly improved start-up and logon times for this customer.
I was just looking for details to post here and found the following blog post on TechNet that also covers this topic:
App-V: Refresh “On-login” and Slow Startups in Windows 7
Here is a link to the latest hotfix rolloup package:
http://support.microsoft.com/kb/2571168
Experiance with this customer certainly showed the hotfix rollup is worth installing
I was just looking for details to post here and found the following blog post on TechNet that also covers this topic:
App-V: Refresh “On-login” and Slow Startups in Windows 7
Here is a link to the latest hotfix rolloup package:
http://support.microsoft.com/kb/2571168
Experiance with this customer certainly showed the hotfix rollup is worth installing
Subscribe to:
Posts (Atom)
