Change the way AD read Enabled accounts
This commit is contained in:
1 parent
c59138fdda
commit
2c8f9d87c2
1 file changed
+1
-1
@@ -64,7 +64,7 @@
|
||||
#region script
|
||||
#Collect all users and the attributes we need
|
||||
foreach ($SearchBase in $STR_OUSearchBase) {
|
||||
$QRY_ADUsers = Get-ADUser -SearchBase $SearchBase -Filter {Enabled -eq $true -and PasswordNeverExpires -eq $false } -Properties 'msDS-UserPasswordExpiryTimeComputed', 'mail'
|
||||
$QRY_ADUsers = Get-ADUser -SearchBase $SearchBase -Filter {(Enabled -eq $true) -and (PasswordNeverExpires -eq $false)} -Properties 'msDS-UserPasswordExpiryTimeComputed', 'mail'
|
||||
|
||||
#Start foreach statement of above query
|
||||
foreach ($User in $QRY_ADUsers) {
|
||||
|
||||
Reference in new issue
Block a user