Remove whitespaces in mobile field in AD

# Remove whitespaces in mobile
$Users = Get-QADUser -SearchRoot “domain/A1/users” -sizelimit 0 | where {$_.mobile -match “s”}

foreach ($user in $users) {
Set-QADUser -id $user -mobile ($user.mobile -replace “s”)
}

Leave a comment