I'm trying to get a full export of AzureAD users including an extension property called 'staffNo'.
If I do the following for one user, I can see that it's there.
Get-AzureADUser -ObjectId ******@domain.com | select -ExpandProperty extensionproperty
However, I haven't been able to work out how I can select the staffNo object to be exported for all users when I do the following.
Get-AzureADUser -All $true | Select-Object givenname,surname,mail,mobile,staffNo | export-csv C:\export.csv
The staffNo is blank. How do I include the staffNo extensionproperty in the output?
Thanks