0

Trying to force myself to start using graph thru powershell since it looks like the AzureAD powershell commandlets are going the way of the dodo at some point. Wondering if there is a way to use get-mguser to grab extensionAttribute5.

I know you have to use expandedproperties to get to the onpremextensions. You also have to use the beta schema to see the extension attributes in place. Where I'm lost is exactly HOW to tease out a single property (if you even can).

For instance, (get-azureaduser -SearchString "NAME").objectID would return the azureobjectID for the user being gotten. I'm looking for something similar to that for extension attributes with get-mguser.

Been googling so much at this point that I think I might be thinking about this wrong. Sorry! Any help or pointers would be beyond appreciated.

CG Nobles
  • 11
  • 2

1 Answers1

1

Late answer, but you will need to use onPremisesExtensionAttributes to fetch all the extension attributes.

This works for me :

Get-MgUser -UserId 7049a62d-0091-4ddb-9e2a-e02ac57f489a -Property onPremisesExtensionAttributes | select -ExpandProperty onPremisesExtensionAttributes | select -ExpandProperty ExtensionAttribute5
Kimzi
  • 11
  • 2