I need to get in my terminal a table that lists all users together with certain attributes.
I use powershell that was set up using commands Install-Module AzureAD
and Connect-AzureAD -Tenant "<mydirectory>.onmicrosoft.com"
.
When I inquiry a single user, I get this:
О» Get-AzureADUser -ObjectId dacbdd03-... | Select -ExpandProperty ExtensionProperty
Key Value
--- -----
odata.metadata https://graph.windows.net/ee26ec1a.../$metadata#directoryObjects/@Element
odata.type Microsoft.DirectoryServices.User
createdDateTime 31.01.2023 19:57:55
employeeId
onPremisesDistinguishedName
userIdentities []
extension_<largenumber>_customerId 48f6eadf-...
I need now to output a table of all users, so I list its objectId
, extension_<largenumber>_customerId
and also an email field. Note that I have millions of users (result should be dumped in a file).