Hi All,
I have written the script below however it seems to fail upon the $request object, I don't really know much about this object and couldn't find much information. Please help!
function onPostCreate($Request)
{
$Adcomputer = Get-QADComputer -Name $Request.name
$Adcomputername = $Adcomputer | select -ExpandProperty name
switch -Wildcard ($Adcomputername) {
"lp-lon*" {$ou="OU=London Laptops,OU=London Computers,OU=London,OU=Organisation,DC=X,DC=COM"}
"pc-lon*" {$ou="OU=London PC,OU=London Computers,OU=London,OU=Organisation,DC=X,DC=COM"}
"lp-rom*" {$ou="OU=Laptops,OU=Romania Computers,OU=Romania,OU=Organisation,DC=X,DC=COM"}
"lp-sing*" {$ou="OU=Singapore Laptops,OU=Singapore,OU=Organisation,DC=X,DC=COM"}
}
if ($ou -ne $null) {Move-QADObject -Identity $AdComputer.DN -NewParentContainer $ou}
}