#$ous = 'Accounts,DC=ud1,DC=utility','Build,DC=ud1,DC=utility'

#$ous | ForEach {Get-QADUser -SearchBase $_ } | select-object DisplayName,samaccountname,@{n="GroupName";e={$group}} |export-csv c:\temp\OU_extracted.csv

#get-QADUser -sizelimit 0 -SearchRoot 'OU=Accounts,DC=ud1,DC=utility','OU=Build,DC=ud1,DC=utility' -Enabled |select-object DisplayName,samaccountname,OU,@{n="GroupName";e={$group}}|export-csv c:\temp\OU_extracted.csv


Get-QADUser -SizeLimit 0 -SearchRoot 'OU=Accounts,DC=ud1,DC=utility','OU=Build,DC=ud1,DC=utility' -DontUseDefaultIncludedProperties `
-IncludedProperties samaccountname,dn,DisplayName |
Where-Object  {$_.samaccountname -like "*" -and $_.dn -ne "*"} |
Select-Object samaccountname,dn,DisplayName |Export-Csv C:\test.csv 
