Microsoft deprecated azure module and updated to AzureADPreview, for that you have to update the module from azure ad to mg graph, the commands remains will be same but need to update the module.
Step1:
First Uninstall Azure AD module and install AzureADPreview using below steps, for this the user should be log in the system as administrator to uninstall or remove the Azure AD module, and run the below command
Uninstall-module AzureAD
Step2: Then install AzureADPreview using below commands
Install-module AzureADPreview
the command will install all required files and post installation check the version and installation status using below command.
Get-Module AzureADPreview
As I said above the commands will be remains same, to connect azure portal, run below command to connect
Connect-AzureAD
once you enter the command it will redirect to login page, enter your login credentials. then install Microsoft graph using below command
Install-module Microsoft.Graph
once the module installed, then we have to import the module so that it will collect all the commands and will show up when we enter tab.
Import-Module Microsoft.Graph
after successfull installation lets connect to MgGraph to make any changes to Azure users.
Connect-MgGraph
Based on the query first of all we have to connect to User Read and write permissions to get access.
Connect-MgGraph -Scopes 'User.Read.All'
This command will set the scope to current directory or current user or current machine,
Connect-MgGraph -Scopes 'Directory.ReadWrite.All'
if you want to make any changes to user run the command as below for suppose I am trying to unhide the user account in GAL using command,
Update-MgUser -UserId 'User@Aqwire.onmicrosoft.com' -ShowInAddressList:$false
Post a Comment