Saturday, 20 July 2013

Task Sequence - Set Screen Resolution

When you are refreshing the OS it is nice to adjust the screen resolution so it doesn't display those huge icons.

You can easily do that by setting a fixed value in your Task Sequence using the variables Xresolution and Yresolution.

But not all users use the same screen resolution.

I will show you how to set the screen resolution to exactly what the users were using when you started the refreshing of their machines.

It gives a much better user experience.

A Powershell script will capture the current screen resolution. You have to run it in the Task Sequence before it restarts to WinPE. It will assign the screen resolution to the Xresolution and Yresolution Task Sequence variables.

That's the script:

#If there is more than 1 screen get the resolution from the first
if((Get-WmiObject win32_desktopmonitor).count -gt 1){
$width = (Get-WmiObject win32_desktopmonitor)[0] | select -ExpandProperty screenwidth
$height = (Get-WmiObject win32_desktopmonitor)[0] | select -ExpandProperty screenheight
}
else{
$width = Get-WmiObject win32_desktopmonitor | select -ExpandProperty screenwidth
$height = Get-WmiObject win32_desktopmonitor | select -ExpandProperty screenheight
}$tsenv = New-Object -ComObject Microsoft.SMS.TSEnvironment
$tsenv.Value("Xresolution") = $width
$tsenv.Value("Yresolution") = $height


 
Your users will thank you!

No comments:

Post a Comment