PowerShell script : Active Directory – Search password never expire

affichage password en toute lettre comme cadena

Premier exemple

$OUvide = Get-ADOrganizationalUnit -Filter * | ForEach-Object {

if (-not (Get-ADObject -SearchBase $_ -SearchScope OneLevel -Filter * )) {

$_}}

$OUvide | ft Name, DistinguishedName

With Quest Tools

Add-PSSnapin Quest.ActiveRoles.ADManagement

Get-QADUser -PasswordNeverExpires -SearchRoot "xxxx/administration" > c:\temp\serviceaccount-neverexpires.txt

Get-QADUser -PasswordNeverExpires -SearchRoot "xxxxx/utilisateurs" > c:\temp\users-neverexpires.txt

Just MS PowerShell :

get-aduser -filter * -properties Name, PasswordNeverExpires | where { $_.passwordNeverExpires -eq "true" } | where {$_.enabled -eq "true"} | FT Name > C:\temp\passwordneverexpires.txt

Laisser un commentaire