
$Users = Get-ADUser `
-Filter "UserPrincipalName -like '*ecole.com'" `
-Properties userprincipalname `
-ResultSetSize $null


$users | foreach {
$newupn = $_.UserPrincipalName.Replace("@ecole.com","@ecole.fr"); $_ | 
Set-ADUser -UserPrincipalName $newupn
}

Search-ADAccount `
-AccountInactive `
-UsersOnly `
-TimeSpan 180 -

Search-ADAccount `
-AccountDisabled `
-ComputersOnly

