kennysarmy Posted June 26, 2025 Posted June 26, 2025 I've been trying all morning to get this powershell command to work and I'm getting nowhere. Connect-MgGraph -Scopes "User.Read.All" Connect-MgGraph : The term 'Connect-MgGraph' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + Connect-MgGraph -Scopes "User.Read.All" + ~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Connect-MgGraph:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException Anyone any ideas? It's driving me nuts and I've wasted 3 hours today trying to get this to work
kennysarmy Posted June 26, 2025 Author Posted June 26, 2025 PS C:\Users\ja> Get-InstalledModule Microsoft.Graph Version Name Repository Description ------- ---- ---------- ----------- 2.28.0 Microsoft.Graph PSGallery Microsoft Graph PowerShell module PS C:\Users\ja> Confirms that the module is installed...
SteveM555 Posted June 26, 2025 Posted June 26, 2025 Might sound silly, but have you imported the module? Import-Module Microsoft.Graph
kennysarmy Posted June 26, 2025 Author Posted June 26, 2025 1 minute ago, SteveM555 said: Might sound silly, but have you imported the module? Import-Module Microsoft.Graph I get this: PS C:\Users\ja> Import-Module Microsoft.Graph Import-Module : The specified module 'Microsoft.Graph' was not loaded because no valid module file was found in any module directory. At line:1 char:1 + Import-Module Microsoft.Graph + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ResourceUnavailable: (Microsoft.Graph:String) [Import-Module], FileNotFoundException + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
kennysarmy Posted June 26, 2025 Author Posted June 26, 2025 But when checking it appears to be installed ;(
SteveM555 Posted June 26, 2025 Posted June 26, 2025 Have you installed it for your user, but running Powershell as Admin? or the other way around? Id suggest running the following if so: Uninstall-Module Microsoft.Graph -Force -AllVersions and then Install-Module Microsoft.Graph -Scope AllUsers -Force 1
Discovery1031 Posted June 26, 2025 Posted June 26, 2025 I've found installing Powershell 7 has solved most of the issues with Microsoft Graph.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now