Dear technet community:
I need to fetch active directory accounts that have changed since a certain time.
In doing so, I run queries against whenCreated and whenChanged such as:
(whenCreated>=20190219174130.0Z)or here would be a Get-ADUser command:
Get-ADUser -Filter * -Properties whenCreated | Where-Object {$_.whenCreated -ge ((Get-Date).AddDays(1)).Date}On my test server, this was fine worked great.
My production active directory has about 210,000 users in it, about 80,000 groups.
Now this query hangs very badly. It seems like it's doing a linear pass through the entire AD.
Shouldn't active directory has an index created on this value so it can be queried very quickly? Is there some trick to making this indexed better?