Skip to content

Commit 35a3f09

Browse files
Clarify behavior of AcountEnabled and Password (#21006)
* Clarify behavior of AcountEnabled and Password `Update-AzAdUser` in `Az.Resources` v6.0.1 automatically enables the user account when the password changes, ignoring the `-AccountEnabled` parameter. In previous versions of the cmdlet the password could be updated at the same time the account was disabled. That now requires two separate calls to `Update-AzAdUser`: one to set the password, and a second to disable the account. * Update src/Resources/Resources/ChangeLog.md --------- Co-authored-by: Beisi Zhou <[email protected]>
1 parent a6b16dd commit 35a3f09

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Resources/Resources/help/Update-AzADUser.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ Update user by user principal name
8888

8989
### -AccountEnabled
9090
true for enabling the account; otherwise, false.
91+
Always true when combined with `-Password`.
9192

9293
```yaml
9394
Type: System.Boolean
@@ -872,7 +873,7 @@ To create the parameters described below, construct a hash table containing the
872873
- `[(Any) <Object>]`: This indicates any property can be added to this object.
873874
- `[DeletedDateTime <DateTime?>]`: Date and time when this object was deleted. Always null when the object hasn't been deleted.
874875
- `[DisplayName <String>]`: The name displayed in directory
875-
- `[AccountEnabled <Boolean?>]`: true if the account is enabled; otherwise, false. This property is required when a user is created. Supports $filter (eq, ne, NOT, and in).
876+
- `[AccountEnabled <Boolean?>]`: true if the account is enabled; otherwise, false. This property is required when a user is created. Supports $filter (eq, ne, NOT, and in). `-AccountEnabled $false` is ignored when changing the account's password.
876877
- `[AgeGroup <String>]`: Sets the age group of the user. Allowed values: null, minor, notAdult and adult. Refer to the legal age group property definitions for further information. Supports $filter (eq, ne, NOT, and in).
877878
- `[ApproximateLastSignInDateTime <DateTime?>]`: The timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. Supports $filter (eq, ne, not, ge, le, and eq on null values) and $orderBy.
878879
- `[City <String>]`: The city in which the user is located. Maximum length is 128 characters. Supports $filter (eq, ne, NOT, ge, le, in, startsWith).
@@ -916,7 +917,7 @@ To create the parameters described below, construct a hash table containing the
916917
- `[(Any) <Object>]`: This indicates any property can be added to this object.
917918
- `[ForceChangePasswordNextSignIn <Boolean?>]`: true if the user must change her password on the next login; otherwise false. If not set, default is false. NOTE: For Azure B2C tenants, set to false and instead use custom policies and user flows to force password reset at first sign in. See Force password reset at first logon.
918919
- `[ForceChangePasswordNextSignInWithMfa <Boolean?>]`: If true, at next sign-in, the user must perform a multi-factor authentication (MFA) before being forced to change their password. The behavior is identical to forceChangePasswordNextSignIn except that the user is required to first perform a multi-factor authentication before password change. After a password change, this property will be automatically reset to false. If not set, default is false.
919-
- `[Password <String>]`: The password for the user. This property is required when a user is created. It can be updated, but the user will be required to change the password on the next login. The password must satisfy minimum requirements as specified by the user's passwordPolicies property. By default, a strong password is required.
920+
- `[Password <String>]`: The password for the user. This property is required when a user is created. It can be updated, but the user will be required to change the password on the next login. The password must satisfy minimum requirements as specified by the user's passwordPolicies property. By default, a strong password is required. When changing the password using this method, AccountEnabled is set to true.
920921
- `[PhysicalId <String[]>]`: For internal use only. Not nullable. Supports $filter (eq, not, ge, le, startsWith).
921922
- `[PostalCode <String>]`: The postal code for the user's postal address. The postal code is specific to the user's country/region. In the United States of America, this attribute contains the ZIP code. Maximum length is 40 characters. Supports $filter (eq, ne, NOT, ge, le, in, startsWith).
922923
- `[PreferredLanguage <String>]`: The preferred language for the user. Should follow ISO 639-1 Code; for example en-US. Supports $filter (eq, ne, NOT, ge, le, in, startsWith).
@@ -933,7 +934,7 @@ To create the parameters described below, construct a hash table containing the
933934
- `[(Any) <Object>]`: This indicates any property can be added to this object.
934935
- `[ForceChangePasswordNextSignIn <Boolean?>]`: true if the user must change her password on the next login; otherwise false. If not set, default is false. NOTE: For Azure B2C tenants, set to false and instead use custom policies and user flows to force password reset at first sign in. See Force password reset at first logon.
935936
- `[ForceChangePasswordNextSignInWithMfa <Boolean?>]`: If true, at next sign-in, the user must perform a multi-factor authentication (MFA) before being forced to change their password. The behavior is identical to forceChangePasswordNextSignIn except that the user is required to first perform a multi-factor authentication before password change. After a password change, this property will be automatically reset to false. If not set, default is false.
936-
- `[Password <String>]`: The password for the user. This property is required when a user is created. It can be updated, but the user will be required to change the password on the next login. The password must satisfy minimum requirements as specified by the user's passwordPolicies property. By default, a strong password is required.
937+
- `[Password <String>]`: The password for the user. This property is required when a user is created. It can be updated, but the user will be required to change the password on the next login. The password must satisfy minimum requirements as specified by the user's passwordPolicies property. By default, a strong password is required. When changing the password using this method, AccountEnabled is set to true.
937938

938939
## RELATED LINKS
939940

0 commit comments

Comments
 (0)