Forum Discussion
Wick_man11
Jul 13, 2023Copper Contributor
getting at On Premises user attributes in Powershell/Graph?
In the Entra admin center, there are many attributes on each user that start with the name 'On Premises'. I would like to extract this info for my users and report on it. The download function in the...
- Jul 14, 2023It's fairly easy to do this via Graph:
GET https://graph.microsoft.com/v1.0/users?$select=id,displayName,userPrincipalName,onPremisesExtensionAttributes
The corresponding SDK cmdlet is:
Get-MgUser -All -Property ID,DisplayName,UserPrincipalName,companyName,onPremisesExtensionAttributes | Select-Object ID,DisplayName,UserPrincipalName,companyName -ExpandProperty onPremisesExtensionAttributes | select *
VasilMichev
Jul 14, 2023MVP
It's fairly easy to do this via Graph:
GET https://graph.microsoft.com/v1.0/users?$select=id,displayName,userPrincipalName,onPremisesExtensionAttributes
The corresponding SDK cmdlet is:
Get-MgUser -All -Property ID,DisplayName,UserPrincipalName,companyName,onPremisesExtensionAttributes | Select-Object ID,DisplayName,UserPrincipalName,companyName -ExpandProperty onPremisesExtensionAttributes | select *
GET https://graph.microsoft.com/v1.0/users?$select=id,displayName,userPrincipalName,onPremisesExtensionAttributes
The corresponding SDK cmdlet is:
Get-MgUser -All -Property ID,DisplayName,UserPrincipalName,companyName,onPremisesExtensionAttributes | Select-Object ID,DisplayName,UserPrincipalName,companyName -ExpandProperty onPremisesExtensionAttributes | select *
- bhvorstJan 15, 2024Copper ContributorVery useful Vasil, thank you very much.
- VasilMichevJul 14, 2023MVPTo clarify, the above is an example of getting one such property (which happens to contain all the "extension" attributes). To retrieve any other properties, such as OnPremisesDistinguishedName or OnPremisesUserPrincipalName, add them to the "select" statement as needed.