Jump to content

Recommended Posts

Posted

Been doing this via a Powershell script that takes the info from a csv but that method is now deprecated and, apparently, MSGraph should be used. Which would be fine if it was documented, but the best I could find was https://answers.microsoft.com/en-us/msoffice/forum/all/how-to-bulk-upload-using-graph-sdk-powershell/f6be91a8-2206-4fa2-b0d9-e678d2ca5aaa which both threw "This is experimental" warnings and then the same error that the OP got.

 

I'm guessing most have AD synced, but is anyone using a script/csv method, and how did you get it to work? I can find ways to add users but not set passwords, which we need for KS2.

Posted
Been doing this via a Powershell script that takes the info from a csv but that method is now deprecated... I can find ways to add users but not set passwords, which we need for KS2.

This was on my list of things to do next week. PowerShell with CSV to set passwords, permissions, licences, etc. It's a once-a-year job that I spent a lot of time automating to save time in the long run. I'll be well pi... somewhat vexed, if it doesn't work.

Posted
This was on my list of things to do next week. PowerShell with CSV to set passwords, permissions, licences, etc. It's a once-a-year job that I spent a lot of time automating to save time in the long run. I'll be well pi... somewhat vexed, if it doesn't work.

 

It will work, but is throttled to a few users at a time, so I thought I might as well suss out the "new, improved" method - but can't get it to work!

  • Thanks 1
Posted
It will work, but is throttled to a few users at a time, so I thought I might as well suss out the "new, improved" method - but can't get it to work!

 

Oh, OK. I'm used to that. It's a pain, but when the output changes to red, I know which users are done and where to start from next time. I'll keep an eye on this thread in case you or anyone else comes up with a better method.

Posted

I am still struggling to find a way that will allow passwords to be set and fixed en masse. It looks like I should be able to use Azure AD/Entra ID to sync our on premises AD to achieve this, but I'm not sure if this is an extra cost. Anyone know?

 

I can get this far without being asked to upgrade etc.

 

Entra.png

 

It looks like you need Server 2016 or later for this anyway (don't judge), so we'd need to upgrade the server(s). I'm pretty sure that I can't just use a 2016/19/22 iso to do this as we probably need to pay for an upgraded license - or do we?

Posted
I've bulk reset a lot of password in the past month.

Done it in AD and then let the sync happen.

 

That's what I want to happen, but haven't got the connect set up and don't want to set it up and then get a bill!

  • 3 weeks later...
Posted

OK, it probably would have been quicker/easier to set up Connect but I finally cracked it.

 

Pieced together from:

 

 

and many, many, many other places.

 

The code below assumes you have got to stage where you have imported your csv from the first site above. However the csv needs the following information at a minimum. You can add other fields if they're recognised, but this has everything we need (and more, in the case of Nickname/Alias). KS1/2 so they have fixed passwords or it would have been a much simpler "upload a csv as provided in Exchange Admin".

 

CSV.png

 

UPN=Full Email Address e.g. [email protected], Nickname=Alias (doesn't like spaces - I just concatenated first and last names in the non-test version)

 

Alias.png

 

foreach ($user in $users) {
$PasswordProfile = @{
Password = $user.Password
ForceChangePasswordNextSignIn = $false
}
$userID = New-MgUser -DisplayName $user.DisplayName -GivenName $user.FirstName -Surname $user.LastName -UserPrincipalName $user.UserPrincipalName -UsageLocation $user.UsageLocation -mailNickname $user.Nickname -PasswordProfile $PasswordProfile -accountEnabled
}

 

It's supposed to be possible to assign licenses, but I couldn't get it to work. At least it's not too hard to select up to 40 of your new users at a time and do it that way.

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...