Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-MgUser - AccountEnabled available from graph v1.0 but not the v1.0 MgProfile #1250

Closed
rfeagley opened this issue May 10, 2022 · 3 comments

Comments

@rfeagley
Copy link

We have found that while the AccountEnabled attribute is available and returns valid data directly from the v1.0 version of Graph, the Get-MgUser module must be called using the beta profile (Select-MgProfile -Name "beta") in order to return this data.

Graph Explorer:
image

Get-MgUser:
image

@ghost ghost added the ToTriage label May 10, 2022
@peombwa
Copy link
Member

peombwa commented May 10, 2022

@rfeagley, you are missing $select equivalent parameter on the PowerShell command - -Property, i.e.,

Get-MgUser -Property Id, DisplayName, UserPrincipalName, AccountEnabled | select Id, DisplayName, UserPrincipalName, AccountEnabled
Get-Help Get-MgUser -Parameter Property

-Property <String[]>
    Select properties to be returned

    Required?                    false
    Position?                    named
    Default value
    Accept pipeline input?       false
    Accept wildcard characters?  false

PowerShell's Select-Object (| select) is only used for output formatting.

@rfeagley
Copy link
Author

I greatly appreciate the assistance. I would highly recommend outlining this further in the documentation (https://docs.microsoft.com/en-us/powershell/module/microsoft.graph.users/get-mguser). Perhaps add a list of the default attributes returned (different between v1 and beta profiles) and an examples that utilize this property. My issue is resolved.

@peombwa
Copy link
Member

peombwa commented May 11, 2022

Thanks for the feedback. We will consider this as part of #876.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants