How to fetch / filter users from AD faster using Get-ADUser command.
Recently I saw few scripts which are fetching users from AD like below mentioned.
Get-ADUser -LDAPFilter “(whenCreated>=$date)”
or
Get-ADUser -filter {Enabled -eq $True -and PasswordNeverExpires -eq $False -and PasswordLastSet -gt 0}
or
Get-ADUser -Filter ‘Enabled -eq $True’
But using like above is taking quite a lot of time or sometimes giving Timeout error.
is there any way can make this faster? Will using –LDAPFilter instead of -Filter make it faster?
Error Message: The operation returned because the timeout limit was exceeded.
Recently I saw few scripts which are fetching users from AD like below mentioned. Get-ADUser -LDAPFilter “(whenCreated>=$date)”orGet-ADUser -filter {Enabled -eq $True -and PasswordNeverExpires -eq $False -and PasswordLastSet -gt 0}orGet-ADUser -Filter ‘Enabled -eq $True’ But using like above is taking quite a lot of time or sometimes giving Timeout error.is there any way can make this faster? Will using -LDAPFilter instead of -Filter make it faster? Error Message: The operation returned because the timeout limit was exceeded. Read More