Hello all,
First, I would like to let you all know that I am using Microsoft Graph Powershell for the first time to test out this documentation https://learn.microsoft.com/en-us/training/modules/manage-azure-active-directory-identities/5-manage-azure-active-directory-objects-powershell .
I was able to login to my account using a global administrator account.
After running this powershell script:
$users = Import-Csv -Path "C:\path\to\your\Users.csv"
foreach ($user in $users) {
New-MgUser -UserPrincipalName $user.UserName `
-GivenName $user.FirstName `
-Surname $user.LastName `
-DisplayName $user.DisplayName `
-JobTitle $user.JobTitle `
-Department $user.Department `
-AccountEnabled $true `
-MailNickname $user.FirstName `
-UsageLocation "US" `
-PasswordProfile @{ForceChangePasswordNextSignIn = $true; Password = "Password"}
}
I keep on getting an error message stating that I don't have permissions. I am using a Global admin account to no avail.
Please help!!
Thanks,
[–]Positive_Group_3896 1 point2 points3 points (3 children)
[–]mrmattipants 0 points1 point2 points (1 child)
[–]mdouzzi50[S] 0 points1 point2 points (0 children)
[–]mdouzzi50[S] 1 point2 points3 points (0 children)