I’m trying to follow the steps in this article to get the list of users from azure using Powershell but the system is unable to load the module.
What am I doing wrong?
PS C:WINDOWSsystem32> Install-Module MsIdentityTools -Scope CurrentUser
PS C:WINDOWSsystem32> Connect-MgGraph -Scopes Directory.Read.All, AuditLog.Read.All, UserAuthenticationMethod.Read.All
Welcome to Microsoft Graph!
Connected via delegated access using 14d82bbc-204c-4c2f-b7e8-296a70aaba7e
Readme: https://aka.ms/graph/sdk/powershell
SDK Docs: https://aka.ms/graph/sdk/powershell/docs
API Docs: https://aka.ms/graph/docs
NOTE: You can use the -NoWelcome parameter to suppress this message.
PS C:WINDOWSsystem32> Export-MsIdAzureMfaReport -OutputFilePath "C:Workspacereport.xlsx"
Export-MsIdAzureMfaReport : The 'Export-MsIdAzureMfaReport' command was found in the module 'MSIdentityTools', but the module could not be loaded. For more information, run 'Import-Module MSIdentityTools'.
At line:1 char:1
+ Export-MsIdAzureMfaReport -OutputFilePath "C:Workspacereport.xlsx"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Export-MsIdAzureMfaReport:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CouldNotAutoloadMatchingModule
You need to either import the MsIdentityTools
module, or restart your PowerShell console.
PowerShell will automatically load all modules in $env:Path when starting. Since you installed this new module after starting PowerShell it has not been loaded. Assuming the module will be installed in a default location, it will load when you restart PowerShell.
If you want to use a module right after installing it, you will need to import it manually (this is also visible in the error message). Use Import-Module MSIdentityTools
for this.