Expand all properties when calling get-msoluser
Sebastian Wright
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