Expand All Properties When Calling Get-Msoluser

Expand All Properties When Calling Get-Msoluser

In previous versions of PowerShell I could reliably call Get-MSOLUser -UserPrincipalName [email protected] and expect to retrieve the full object graph in c# including all collections and complex types.

In PowerShell version 7.1. When I call this method it only retrieves a string representation of the underlying type. Simple types are shown as expected.

My only dependency at this time is System.Management.Automation" Version="7.1.0"

Sample properties from calling Get-MsolUser

"Licenses": [
    "Microsoft.Online.Administration.UserLicense",
    "Microsoft.Online.Administration.UserLicense",
    "Microsoft.Online.Administration.UserLicense"
  ],
"StrongAuthenticationMethods": [
    "Microsoft.Online.Administration.StrongAuthenticationMethod",
    "Microsoft.Online.Administration.StrongAuthenticationMethod"
  ],
  "StrongAuthenticationPhoneAppDetails": [
    "Microsoft.Online.Administration.StrongAuthenticationPhoneAppDetail"
  ],
  "StrongAuthenticationProofupTime": null,
  "StrongAuthenticationRequirements": [
    "Microsoft.Online.Administration.StrongAuthenticationRequirement"
  ],
  "StrongAuthenticationUserDetails": "Microsoft.Online.Administration.StrongAuthenticationUserDetails",

How do I go about loading the details of MsolUser in 7.1?

1 Answer

Unfortunately, PowerShell version 7 and later do not support the Microsoft Azure Active Directory Module for Windows PowerShell module and cmdlets with Msol in their name. For PowerShell version 7 and later, you have to use the Azure Active Directory PowerShell for Graph module or Azure PowerShell.

The approximately equivalent capability you're looking for in the above example is available in Get-AzureADUser.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

James H. Sterling
Author

James H. Sterling

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.