Should Get-PnPAADUser return an object with several null values? #245
-
So I was playing with the Is there some documentation or intent on where this data is getting pulled from? I would assume it's Azure AD, but Email is populated there for that object and it returned I understand mapping properties can be complex, but Ideally I would like to use this cmdlet to get licensing info if that can be exposed through |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
It's a relatively complex story. The behaviour you see is dictated by the Graph SDK we use behind the scenes where properties explicitely have to be requested. I just noticed that we have an AdditionalProperties property, whereas the Graph SDK implements that as AdditionalData. I will merge a fix for that. In order to get additional information about properties you will have to use the -Select parameter, for instance Get-PnPAADUser -Select Mail, AccountEnabled Notice however that you will have to upgrade to the nightly build available as we recently made a change to include the Mail if no -Select is used. So if you do not provide any Select value the Graph SDK (which we do not build ourselves but is MS provided) returns: DisplayName, GivenName, Mail, MobilePhone, OFficeLocation, PreferredLanguage, Surname, UserPrincipalName, Id. Any additional properties will have to be explicitely requested using the Select parameter. Notice that Select will it make only return the properties you selected. We just discussed this in the team and we decided to change the behavior: As of tomorrow, e.g. in the nightly release with version 1.2.20-nightly, the cmdlet will by default return the properties listed above, and any Select value will -add- to those properties. So Get-PnPAADUser -Select AccountEnabled will return the default properties with the AccountEnabled included. |
Beta Was this translation helpful? Give feedback.
-
The change has been merged and it will be available around 4 AM CET on 2021-02-11 in the nightly release 1.2.20-nightly. Install-Module -Name PnP.PowerShell -AllowPrerelease To update to a specific version Install-Module -Name PnP.PowerShell -AllowRerelease -RequiredVersion 1.2.20-nightly |
Beta Was this translation helpful? Give feedback.
It's a relatively complex story. The behaviour you see is dictated by the Graph SDK we use behind the scenes where properties explicitely have to be requested. I just noticed that we have an AdditionalProperties property, whereas the Graph SDK implements that as AdditionalData. I will merge a fix for that.
In order to get additional information about properties you will have to use the -Select parameter, for instance
Notice however that you will have to upgrade to the nightly build available as we recently made a change to include the Mail if no -Select is used.
So if you do not provide any Select value the Graph SDK (which we do not build ourse…