az ad user
管理Microsoft Entra 用户。
命令
| 名称 | 说明 | 类型 | Status |
|---|---|---|---|
| az ad user create |
创建一个用户。 |
Core | GA |
| az ad user delete |
删除用户。 |
Core | GA |
| az ad user get-member-groups |
获取用户所属的组。 |
Core | GA |
| az ad user list |
列出用户。 |
Core | GA |
| az ad user show |
获取用户的详细信息。 |
Core | GA |
| az ad user update |
更新用户。 |
Core | GA |
az ad user create
创建一个用户。
az ad user create --display-name
--password
--user-principal-name
[--force-change-password-next-sign-in {false, true}]
[--immutable-id]
[--mail-nickname]
示例
创建用户
az ad user create --display-name myuser --password password --user-principal-name myuser@contoso.com
必需参数
对象的显示名称或其前缀。
应分配给用户进行身份验证的密码。
用户主体名称(someuser@contoso.com)。 它必须包含租户的已验证域之一。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
在下次进行身份验证时,将此用户标记为需要更新其密码。 如果省略,将使用 false。
| 属性 | 值 |
|---|---|
| 默认值: | False |
| 接受的值: | false, true |
此属性用于将本地 Active Directory用户帐户与其Microsoft Entra用户对象相关联。 如果在对用户的 userPrincipalName (UPN) 属性使用联合域,则必须在 Graph 中创建新用户帐户时指定此属性。 注意:指定此属性时不能使用 $ 和 _ 字符。
邮件别名。 默认为用户主体名称。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az ad user delete
删除用户。
az ad user delete --id
示例
删除用户。
az ad user delete --id myuser@contoso.com
必需参数
要获取其信息的用户的对象 ID 或主体名称。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az ad user get-member-groups
获取用户所属的组。
az ad user get-member-groups --id
[--security-enabled-only {false, true}]
示例
获取用户所属的组
az ad user get-member-groups --id myuser@contoso.com
必需参数
要获取其信息的用户的对象 ID 或主体名称。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
如果指定仅应返回实体所属的安全组,则为 True;false 指定应返回实体所属的所有组和目录角色。
| 属性 | 值 |
|---|---|
| 默认值: | False |
| 接受的值: | false, true |
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az ad user list
列出用户。
az ad user list [--display-name]
[--filter]
[--upn]
示例
列出所有用户。
az ad user list
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
对象的显示名称或其前缀。
OData 筛选器,例如 --filter “displayname eq 'test' and servicePrincipalType eq 'Application'”。
用户主体名称,例如 john.doe@contoso.com。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az ad user show
获取用户的详细信息。
az ad user show --id
示例
显示用户。
az ad user show --id myuser@contoso.com
必需参数
要获取其信息的用户的对象 ID 或主体名称。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az ad user update
更新用户。
az ad user update --id
[--account-enabled {false, true}]
[--display-name]
[--force-change-password-next-sign-in {false, true}]
[--mail-nickname]
[--password]
示例
更新用户。
az ad user update --id myuser@contoso.com --display-name username2
必需参数
要获取其信息的用户的对象 ID 或主体名称。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
启用用户帐户。
| 属性 | 值 |
|---|---|
| 接受的值: | false, true |
对象的显示名称或其前缀。
如果用户必须在下一次登录时更改密码。
| 属性 | 值 |
|---|---|
| 接受的值: | false, true |
邮件别名。 默认为用户主体名称。
用户密码。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |