Вы находитесь на странице: 1из 1

Get-ADUser -searchBase $SearchBase -filter {

Enabled -eq $True -AND PasswordNeverExpires -eq $False -AND PasswordLastSet


-ge $Start.Date -AND PasswordLastSet -le $End.Date
} -properties * |
Select DistinguishedName,PasswordLastSet,
@{Name="PasswordAge";Expression={(Get-Date) - $_.PasswordLastSet }}
}
Catch
{
#there was a problem so display a warning and the exception message
Write-Warning "Failed to query user accounts in $searchbase."
Write-Warning $_.Exception.Message
}

Вам также может понравиться