When running the following command i am not quite getting the output i need.
Get-QADUser -proxy -SearchRoot $OU | Select-object UserPrincipalName
The results are like this
When all i need is firstname.lastname@example.org
Any ideas how i can change the output?
Thanks in advance
Is there a special reason why you’re still using the old and obsolete Quest AD PowerShell module? I’d recommend to use the original MSFT AD PowerShell module installed with the RSAT tools.
Get-ADUser -Filter * -SearchBase 'OU=Users,DC=Contoso,DC=com' |
Select-Object -Property UserPrincipalName
If you want the output as an array of strings you can use
-ExpandProperty instead of
-Property but the rest stays the same.
Hi. We use Quest Active Roles so need to use the Quest CMD.
but thanks. I was missing -ExpandProperty
Thanks for the nudge on this one.
OK, but in this particular case … what benefit does the Quest cmdlet provides compared to the original MSFT cmdlet?
You’re very welcome.
Because as part of the script which you dont see it is connecting to a Managed Unit within the Quest product. If i was targeting a standard OU then the AD native would be fine.