Dear All,
I have been trouble with Microsoft Graph Powershell even i installed microsoft.graph module but it doesn't recognized the powershell codes. So that how can i fix that problem? Kindly, can you enlighten to me?
PS C:\Windows\system32>
Install-Module -Name "Microsoft.Graph"
Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its
InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from
'PSGallery'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): A
PS C:\Windows\system32> Install-Module Microsoft.Graph -Scope CurrentUser
Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its
InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from
'PSGallery'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): A
PS C:\Windows\system32> Connect-MgGraph -Scopes "User.Read.All"
Welcome To Microsoft Graph!
PS C:\Windows\system32> $users = Get-MgUser
$users | Select-Object DisplayName, UserPrincipalName, Mail
Get-MgUser : The term 'Get-MgUser' 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:2 char:10
+ $users = Get-MgUser
+ ~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-MgUser:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Windows\system32> Connect-MgGraph -Scopes "User.Read.All", "Group.ReadWrite.All"
Welcome To Microsoft Graph!
PS C:\Windows\system32> $users = Get-MgUser
Get-MgUser : The term 'Get-MgUser' 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:10
+ $users = Get-MgUser
+ ~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-MgUser:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException