ObjectID is an AAD property. The Windows Active Directory uses an ObjectGUID property. for the same purpose.
Export users
Rising Flight
4,596
Reputation points
Hi all,
We create users in on-premises Active Directory, and they are synchronized to Azure AD. I have two requirements:For every user in Azure, I see an Object ID. Is this Object ID coming from the on-premises Active Directory, or is it assigned by Azure AD?
is the below syntax correct, please correct me.
$users = Get-MgUser -All | ForEach-Object {
$licenses = (Get-MgUserLicenseDetail -UserId $_.Id).SkuPartNumber -join "; "
[PSCustomObject]@{
ObjectId = $_.Id
UserPrincipalName = $_.UserPrincipalName
Email = $_.Mail
DisplayName = $_.DisplayName
License = $licenses
}
}
$users | Export-Csv -Path "C:\temp\output.csv" -NoTypeInformation
I have an application that needs to fetch Azure AD users along with their Object IDs. I have created an Azure App Registration and given it the User.Read (delegated) Graph API permission. Is this API permission sufficient to get Azure AD users along with their Object IDs?