I am running the following powershell script and it is giving an error "Invalid enumeration context", in get-aduser. I have close to 800,000 user objects in the domain.
$AllUsers = get-aduser -filter *
$TotalUserCount = $AllUsers.count
Could you please suggest how to get this to work. This script worked in other smaller domains.