New-ZrUser
Creates a local username/password login identity in the Zaris cluster, hashing the password server-side and optionally granting a role at a scope in the same call.
Syntax
New-ZrUser
-Name <string>
-Password <SecureString>
[-Role <string>]
[-Scope <string>]
[-Managers <string[]>] [-Port <int>] [-Token <string>] [-TimeoutSec <int>]
[-WhatIf] [-Confirm]
Description
New-ZrUser creates a local user whose password is hashed on the server, fanning the create out to every connected manager so the identity exists cluster-wide. When -Role (and optionally -Scope) is supplied, the role is granted to the new user in the same operation. Requires a connected manager (an active workspace or explicit -Managers) and an admin token with permission to manage security principals. See Authorization & RBAC for roles and scopes, and Authentication & tokens for the token model.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
-Name | string | Yes | The username of the login identity to create. Position 0. |
-Password | SecureString | Yes | The password for the new user, supplied as a SecureString and hashed on the server. Position 1. |
-Role | string | No | An optional role to grant to the new user in the same operation. |
-Scope | string | No | The scope at which the optional role is granted; defaults to the root scope when omitted. |
-Managers | string[] | No | Management Service endpoints to target; when omitted the active workspace's managers are used. |
-Port | int | No | Management Service port for bare-host managers. Default 7801. |
-Token | string | No | Admin bearer token for authenticated control-plane calls. |
-TimeoutSec | int | No | Per-request timeout in seconds. Default 30. |
Supports -WhatIf and -Confirm.
Examples
Create the login user alice, prompting securely for the password (never pass a literal password on the command line).
New-ZrUser -Name alice -Password (Read-Host -AsSecureString)
Create alice and grant the StoreOperator role scoped to the orders store in one call.
New-ZrUser -Name alice -Password (Read-Host -AsSecureString) -Role StoreOperator -Scope zaris:store:orders