Guys.
Been trying to get this to work for the last couple of hours. I am trying to run Set-QADUser command to set an AD attribute value from within one of my switch statements. I thought that using $_ would be ok to pass the users logon account.
What am i doing wrong here?
Connect-QADService -Service "ARS-Service-Name" -Proxy
$OUSelected = "OU-NAME"
Get-qaduser -SizeLimit 0 -SearchRoot $OUSelected |
ForEach-Object {
switch ($_.physicalDeliveryOfficeName){
'London' {Set-QADUser -Identity $_ -ObjectAttributes @{'AD ATTRIBUTE HERE'= "AD ATTRIBUTE VALUE" }}
'Milan' {2}
'Padova' {3}
'Geneva' {4}
default {'No site'}
}
}