Skip to main content

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

ParameterTypeRequiredDescription
-NamestringYesThe username of the login identity to create. Position 0.
-PasswordSecureStringYesThe password for the new user, supplied as a SecureString and hashed on the server. Position 1.
-RolestringNoAn optional role to grant to the new user in the same operation.
-ScopestringNoThe scope at which the optional role is granted; defaults to the root scope when omitted.
-Managersstring[]NoManagement Service endpoints to target; when omitted the active workspace's managers are used.
-PortintNoManagement Service port for bare-host managers. Default 7801.
-TokenstringNoAdmin bearer token for authenticated control-plane calls.
-TimeoutSecintNoPer-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