LeMarchand Posted September 15, 2023 Posted September 15, 2023 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.
StevieM Posted September 15, 2023 Posted September 15, 2023 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.
LeMarchand Posted September 15, 2023 Author Posted September 15, 2023 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! 1
StevieM Posted September 15, 2023 Posted September 15, 2023 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.
LeMarchand Posted September 21, 2023 Author Posted September 21, 2023 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. 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?
DaveTheTech Posted September 21, 2023 Posted September 21, 2023 I've bulk reset a lot of password in the past month. Done it in AD and then let the sync happen.
LeMarchand Posted September 21, 2023 Author Posted September 21, 2023 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!
LeMarchand Posted September 21, 2023 Author Posted September 21, 2023 A bill? for AzureAD Connect? So I take it that's free on any EDU licence?
Olliedawg Posted September 21, 2023 Posted September 21, 2023 There is no charge for azure AD connect - we are on the free Edu licence for azure and run the connect tool 1
LeMarchand Posted October 12, 2023 Author Posted October 12, 2023 OK, it probably would have been quicker/easier to set up Connect but I finally cracked it. Pieced together from: https://help.teamflect.com/article/254-for-admins-how-can-i-upload-user-information-to-azure-ad-org-chart-department-job-title https://answers.microsoft.com/en-us/msoffice/forum/all/how-to-bulk-upload-using-graph-sdk-powershell/f6be91a8-2206-4fa2-b0d9-e678d2ca5aaa https://learn.microsoft.com/en-us/answers/questions/1338460/microsoft-graph-users-module-new-mguser-authentica 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". 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) 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. 1
robintech Posted October 12, 2023 Posted October 12, 2023 could you add them to groups in Azure/Entra and then assign licences based on their group membership, https://learn.microsoft.com/en-us/azure/active-directory/enterprise-users/licensing-groups-assign 1
LeMarchand Posted October 13, 2023 Author Posted October 13, 2023 could you add them to groups in Azure/Entra and then assign licences based on their group membership, https://learn.microsoft.com/en-us/azure/active-directory/enterprise-users/licensing-groups-assign Looks likely and will save a step or two, especially as Entra is the fastest way to add them to their mail group. Thanks, will add it to my notes for next year!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now