School user passwords

Chris Bonser 0 Reputation points
2024-03-13T12:00:09.95+00:00

I have 400 users aged as minors. I want to set passwords for them to use. I do not want to have the reset password at first login. How can I do this?

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,311 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Dillon Silzer 54,281 Reputation points
    2024-03-13T21:28:13.7366667+00:00

    Hi Chris,

    The best way is to script this by PowerShell:

    https://learn.microsoft.com/en-us/powershell/module/azuread/set-azureaduserpassword?view=azureadps-2.0

    What I would do is export a csv of all of these accounts and use PowerShell to create a for loop to go through and reset the passwords.

    If this is helpful please accept answer.

    0 comments No comments

  2. Sandeep G-MSFT 14,071 Reputation points Microsoft Employee
    2024-03-15T09:34:31.4066667+00:00

    @Chris Bonser

    Thank you for posting this in Microsoft Q&A.

    To do bulk password reset, you need to create a CSV file. In the CSV you need to create the following columns:

    -UserprincipalName: Email of the user whose password you want to reset

    -NewPassword: New password you want to set for the user

    Now you can use any of the below scripts to achieve your task,

    $users = get-msoluser | select userprincipalname,objectid | where {-userprincipalname -like $_.UserPrincipalName }

    Set-MsolUserPassword -userPrincipalName $.UserPrincipalName -NewPassword $.Password -ForceChangePassword $False }

    Or you can use below script,

    Import-Csv "C:\Users.csv" | % { Set-MsolUserPassword -userPrincipalName "$.UserPrincipalName" -NewPassword "$.Password" -ForceChangePassword $False

    Let me know if you have any further questions on this.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments