#Written by Felipe Binotto #On the 27th of August of 2010 #Get all computers names from some specific OU and sort it. #For each computer in the OU, get its model and write it to its description in AD. $OU = get-QADComputer -SearchRoot 'staff.vuw.ac.nz/VUW_Workstations/Desktops' -SizeLimit 0 | % {$_.name} | sort foreach($computer in $OU){ $model = (Get-WmiObject win32_computersystem -computername $computer -ErrorVariable err -ErrorAction SilentlyContinue).model if($err){ Set-QADComputer $computer -Description Unavailable} else{ Set-QADComputer $computer -Description $model}}