Powershell: Get-aduser filter with two conditions
PowerShell to filter two conditions.
$list = get-aduser -filter {enabled -eq "true" -and passwordNeverExpires -eq "false" } -properties Name, PasswordNeverExpires
#| Select-Object
DistinguishedName, Name, Enabled
$count = $list.Count
Comments
Post a Comment