Search-ADAccount -AccountInactive -UsersOnly -TimeSpan 90 `
| Set-ADUser -Enabled $false

Get-ADUser -Filter "name -eq 'jules cesar'" -SearchBase "DC=ecole,DC=com"

Get-ADUser -Filter "enabled -eq '$false'" `
-SearchBase "OU=utilisateurs,OU=Nantes,DC=ecole,DC=com"

Get-ADUser -Filter * `
-SearchBase "OU=utilisateurs,OU=Nantes,DC=ecole,DC=com" `
-Properties DisplayName `
| % {Set-ADUser $_ -DisplayName ($_.Surname + ' ' + $_.GivenName)}

Get-ADUser -Filter * `
| Where-Object enabled -eq $false `
> c:\desactives.txt

