Create new user via Microsoft Graph using PowerShell

cls # Load Active Directory Authentication Library (ADAL) Assemblies $adal = “${env:ProgramFiles(x86)}\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Services\Microsoft.IdentityModel.Clients.ActiveDirectory.dll” $adalforms = “${env:ProgramFiles(x86)}\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Services\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll” [System.Reflection.Assembly]::LoadFrom($adal) [System.Reflection.Assembly]::LoadFrom($adalforms) $cred = Get-Credential $mycred = new-object Microsoft.IdentityModel.Clients.ActiveDirectory.UserCredential($cred.UserName,$cred.Password) # Defining Azure AD tenant name, this is the name of your Azure Active Directory $adTenant = ”??????” $login = Add-AzureRmAccount -Credential $cred Get-AzureRmSubscription Select-AzureRmSubscription -SubscriptionID ‘??????‘ # Set…


user management using the AzureAD powershell module

cls $cred = Get-Credential #Connect to your AzureAD tenant Connect-AzureAD -Credential $cred # Get a user by UPN $user = Get-AzureADUser -ObjectId “user1@????” $user | fl # Update some properties $user = Set-AzureADUser -ObjectId $user.UserPrincipalName -Department “Azure Architecture” -Country “Turkey” # Get a user by UPN $user = Get-AzureADUser -ObjectId “user1@????” $user | fl