-
Notifications
You must be signed in to change notification settings - Fork 180
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 cmdlet is not working #2745
Comments
@Rajeshwaric7 I'm unable to reproduce this behaviour. Do you mind sharing the output of |
@Ndiritu , Please find the requested details. PS C:\Windows\system32> Get-InstalledModule Microsoft.Graph.Users Version Name Repository Description 2.19.0 Microsoft.Graph.Users PSGallery Microsoft Graph PowerShell Cmdlets Powershell version PS C:\Windows\system32> $PSVersionTable Name Value PSVersion 5.1.17763.4974 |
Also i have tried reinstalling the module and connection is happening successfully. Connect-MgGraph -TenantId $tenantId -Credential $credential Connected via apponly access using db83b40f-b613-4128-9ac4-4a206f11c6ba NOTE: You can use the -NoWelcome parameter to suppress this message. |
As of right now if you want to run an AzurePowerShell@5 task in a DevOps pipeline and you install Graph 2.19 then you get the same error message once you call any Graph command because the Az module will be automatically imported before Graph. |
@peombwa @timayabi2020 Hi, could you please check this issue? FYI, just tested my pipelines and this also happens if I try to install Graph v2.18. |
@ricmestre @Rajeshwaric7 Downgrading Microsoft.Graph to 2.17.0 worked for me as a temporary solution. |
i have disconnected it, still getting below error during uninstall.
|
Adding weight to this issue as it is causing us significant issues with production systems |
I'm having this same issue too with the "Get-MgUser : Method not found: 'Void" error when using the "windows-latest" hosted agent, (which appears to have been recently updated to use v2.19.0 of the Microsoft.Graph.Users module), in an Azure DevOps pipeline. |
@Rajeshwaric7 this experience is the same as #2703 and currently blocked by Azure/azure-powershell#24609. It's mostly affecting PowerShell 5 users and we are pushing to have it done. In summary, Azure PowerShell needs to bump their Identity assemblies which is most likely causing a conflict with Microsoft Graph identity assemblies. Once that is done you, can go ahead and bump your Az. Accounts version. |
Can confirm that this is happening to me as well with Azure Hosted Agents running windows-latest. Switching to PowershellCore inside the script seems to fix it, but it would be nice not to have to do that. |
Have you downgraded in a Microsoft Hosted agent or a Self Hosted agent? We are unable to downgrade on a MS Hosted agent |
The Powershell task should allow you to select a particular version other than latest, regardless of Self Hosted or MS Hosted. |
After downgrading to 2.17.0 , i am still getting error: Connecting to MgGraph: Connected via apponly access using db83b40f-b613-4128-9ac4-4a206f11c6ba NOTE: You can use the -NoWelcome parameter to suppress this message. **PS C:\Windows\system32> Get-MgUser
PS C:\Windows\system32> Get-InstalledModule Microsoft.Graph.Users Version Name Repository Description 2.17.0 Microsoft.Graph.Users PSGallery Microsoft Graph PowerShell Cmdlets |
Just see that the Azure.Identity module was updated in the upcoming Az 12 release (which shall be released tomorrow by looking at their tag), see Azure/azure-powershell#24609 and Azure/azure-powershell#24792. |
@Rajeshwaric7 After updating the Az PowerShell module to v12.0.0, the issue is resolved on my end. Would you kindly validate this on your side?
|
PS C:\Windows\system32> Get-InstalledModule -Name "Az.accounts" Version Name Repository Description 3.0.0 Az.Accounts PSGallery Microsoft Azure PowerShell - Accounts credential management cmdlets for Azure Resource M... PS C:\Windows\system32> Get-InstalledModule -Name "Microsoft.Graph.users" Version Name Repository Description 2.19.0 Microsoft.Graph.Users PSGallery Microsoft Graph PowerShell Cmdlets Still getting same error: PS C:\Windows\system32> Get-MgUser
|
it worked in Powershell 7 version. |
Are you able to check the version of Az powershell in use? |
@Ndiritu , I did tried "Update-Module -Name Az -Force" yesterday and unable to pull the version of the AZ powershell.
|
Thanks for sharing @Rajeshwaric7. I notice from an earlier message that you have |
@Rajeshwaric7 still unable to reproduce this. Would you mind sharing more about your environment? Are you running this on local/Azure pipelines? Are you able to reset your environment/start the installations afresh and share any screenshots/logs? |
@Rajeshwaric7 please run this command in your powershell session and share the output. |
@Rajeshwaric7 from the screenshot, you still have version conflicts of |
Team, PS C:\Windows\system32> Get-InstalledModule -Name "Az.accounts" -AllVersions Version Name Repository Description 3.0.0 Az.Accounts PSGallery Microsoft Azure PowerShell - Accounts credential management cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core.... Getting this error for "Connect-AzAccount" when i run on PS7 If i run run same on PS 5.1
|
Hey @Rajeshwaric7 - I think the missing link here is how PowerShell modules are saved depending on what version of PowerShell you're running (5.1 vs 7) and the scope of the install ( I suggest doing the following to make sure you do not have conflicts. This will probably make some MSFT people squirm, but hey... that's what I do best: Purge Windows PowerShell 5.1 modules
Purge PowerShell 7 modules
Once that's done, close all open PowerShell windows and Windows Terminal windows... and then reinstall the module in both PowerShell 5.1 and pwsh 7 sessions using the |
It worked now, Thanks :) |
Getting below error. Please suggest.
PS C:\Windows\system32> Get-MgUser
Get-MgUser : Method not found: 'Void Microsoft.Graph.Authentication.AzureIdentityAccessTokenProvider..ctor(Azure.Core.TokenCredential, System.String[], Microsoft.Kiota.Authentication.Azure.ObservabilityOptions, System.String[])'.
At line:1 char:1
Modules already installed:
Script 2.19.0 Microsoft.Graph.Authentication {Add-MgEnvironment, Connect-MgGraph, Disconnect-MgGraph, Get-MgContext...}
Script 2.19.0 Microsoft.Graph.Users {Get-MgUser, Get-MgUserCount, Get-MgUserCreatedObject, Get-MgUserCreatedObjectAsServicePrincipal...
The text was updated successfully, but these errors were encountered: