This scripts lists all AD users in an OU
Get-ADUser -searchbase "OU=UK,DC=domain,DC=local" -Filter * -ResultSetSize 20000 | FT Name,SamAccountName





This scripts lists all AD users in an OU
Get-ADUser -searchbase "OU=UK,DC=domain,DC=local" -Filter * -ResultSetSize 20000 | FT Name,SamAccountName