I would like to create a Powershell script to set the Computer Description field in AD to the display name - office number of the last person to login to a computer. I've taken a couple posted ps scripts and have put this script together, but rather than using the username I would like to use the user's display name + office number:
Get-QADComputer -OSName "Windows 7*" | foreach{
$name = $_.name
# would like to use display name + office number instead of username
((Get-WmiObject Win32_ComputerSystem -ComputerName $name -EA Stop).UserName)
Set-QADComputer $name -Description
}