Resetting Microsoft Entra ID passwords with the Set-AzureADUserPassword cmdlet

Resetting passwords in Microsoft Entra ID using PowerShell scripts like Set-AzureADUserPassword might seem straightforward for admins, but it has limitations when it comes to scalability, automation, and end-user empowerment. While scripting offers quick fixes for single-user scenarios, organizations often need a more secure and user-friendly way, such as self-service password reset. This is where a solution like ManageEngine ADSelfService Plus helps bridge the gap between help desk efficiency and user convenience.

With PowerShell
  1. Set the password for a user in Azure Active Directory

    Executing this code will reset the password for a single user in Azure Active Directory.

    Set-AzureADUserPassword -ObjectId "df19e8e6-2ad7-453e-87f5-037f6529ae16" -Password $password
  2. Reset passwords for users by OU and group membership

    Not supported.

With ADSelfService Plus
  1. For users: Self-service password reset, i.e., password reset without admin intervention
    • Go to ADSelfService Plus admin portal.
    • Navigate to Configuration > Self-Service > Policy Configuration > Advanced.
    • Select Password Reset.
    • Enable Automatically reset locked-down accounts in your domain.
    • Click Save.
  2. For admins: Reset all users in a domain
    • Go to ADSelfService Plus admin portal.
    • Navigate to Configuration > Self-Service > Policy Configuration > Advanced.
    • Enable Automatically reset locked-down accounts in your domain.
    • Click Save.

Set-AzureADUserPassword example use cases and scripts

Example 1:

Set-AzureADUserPassword -ObjectId "aaaaaa" -Password $password

Resets the user's password.

Example 2:

Set-AzureADUserPassword -ObjectId "aaaaaa" -Password $password -EnforceChangePasswordPolicy

Resets the user's password and enforces the user's account password policy, such as maximum age, password history, and complexity requirements.

Supported parameters

Parameters Description
-EnforceChangePasswordPolicy Ensures the new password follows the tenant's password policy when set to $true.
-ForceChangePasswordNextLogin Requires the user to change their password at the next sign in if $true.
-ObjectID The unique GUID that identifies the Microsoft Entra ID user account.
-Password The new password value to be assigned to the user.

Limitations of using PowerShell to reset end users' passwords

  • Admin dependency: End users cannot run PowerShell and must contact the help desk for every forgotten password. This makes it impractical, especially for large organizations
  • No 24/7 availability: Users can't reset passwords outside help desk hours, unlike self-service password reset portals.
  • No identity verification: PowerShell-based Microsoft Entra ID password resets bypass MFA, increasing security risks.
  • No audit trail for user actions: Lacks detailed logs of who attempted resets and when.
  • Inefficient for scale: Handling resets for many users manually creates IT overhead.
  • Limited integration: Doesn't provide features like web portals, mobile apps, or MFA-based unlocks that self-service password reset solutions offer.

ADSelfService Plus brings enterprise-grade password security to Microsoft Entra ID

  1. Self-service password reset: With ADSelfService Plus, users can reset their Microsoft Entra ID passwords from:

    • The logon screens of their Windows, Linux, or macOS machines.
    • Web browsers by accessing the ADSelfService Plus portal, which can be configured to be accessed through all major web browsers.
    • Their mobile devices by accessing the ADSelfService Plus iOS or Android mobile app or mobile site.
    • Their private networks, even remotely. Furthermore resetting their passwords, ADSelfService Plus also lets users update their cached credentials.
  2. Password self-service, simplified: Allow users to perform self-service password resets on their Microsoft Entra ID, Active Directory, and cloud accounts.
  3. Improves account security: Secures Microsoft Entra ID password reset with advanced multi-factor authentication including FIDO2 passkeys, biometrics and YubiKey authentication.
  4. Improves the user experience: Allows users to reset forgotten passwords from a secure portal, from anywhere, at any time.
  5. Advanced password policy settings: Admins can ensure users create strong Microsoft Entra ID passwords by banning weak passwords, palindromes, etc.

Highlights of ADSelfService Plus:

  • Password self-service : Unburden users from lengthy help desk calls by empowering them with self-service password reset and account unlocking capabilities.
  • Multi-factor authentication : Enable context-based multi-factor authentication (MFA) with 20 different authentication factors for endpoint, application, VPN, OWA, and RDP logins.
  • One identity with single sign-on : Get seamless one-click access to more than 100 cloud applications. With enterprise single sign-on (SSO), users can access all their cloud applications including Microsoft 365 using their Windows AD credentials.
  • Password synchronization : Synchronize Windows AD user passwords and account changes across multiple systems automatically, including Microsoft 365.
  • Custom password policy enforcer : Prevent users from setting weak and breached passwords for their accounts with an advanced password policy and its integration with Have I Been Pwned?
  • Password and account expiry notifications : Notify users of their impending password and account expiry via email and SMS notification.

ADSelfService Plus trusted by

A single pane of glass for complete self service password management
Email Download Link