Connect-ZrManager
Connects the session to one or more Zaris Management Service endpoints and, with -Credential, signs in with a username and password so subsequent admin cmdlets are authenticated.
Syntax
Connect-ZrManager
-Managers <string[]>
[-Credential <PSCredential>]
[-Token <string>]
[-SaveAs <string>]
[-Force]
[-Port <int>]
[-WhatIf] [-Confirm]
Description
Connect-ZrManager validates connectivity to each manager given in -Managers and records the connection for the current session. When security is enabled, this is how an operator signs in to the control plane from PowerShell: pass -Credential to log in with a username and password, and the returned session token is captured so every following admin cmdlet is authenticated. It is the AdminShell equivalent of the web console's Sign in page.
-Credentiallogs in against the Management Service (Get-Credentialprompts for the username/password of an identity created with New-ZrUser, or the bootstrap admin from Initialize-ZrSecurity). On success it printsLogged in as '<user>'.The password is used only for login and is not retained.-Tokencaptures an already-issued admin token directly instead of logging in.-SaveAspersists the connection (and its token) as a named workspace and activates it, so you can return to it later with Use-ZrWorkspace.-Forcereplaces an existing active connection.
For first-time connecting, prefer New-ZrWorkspace (create) or Use-ZrWorkspace (join). Connect-ZrManager remains the way to (re)authenticate a shell with a username and password: Connect-ZrManager -Credential (Get-Credential) -Force.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
-Managers | string[] | Yes | Management Service endpoints (host, host:port, or URL) to connect to. |
-Credential | PSCredential | No | Username/password to log in with (Get-Credential). The returned session token is captured for the session. Requires security to be enabled. |
-Token | string | No | An existing admin bearer token to capture for the session instead of logging in. |
-SaveAs | string | No | Persist this connection as a named workspace and activate it. |
-Force | switch | No | Replace an existing active connection instead of failing. |
-Port | int | No | Management Service port for bare-host managers. Default 7801. |
Supports -WhatIf and -Confirm.
Examples
Sign in with a username and password, then run an admin cmdlet that requires authentication.
Connect-ZrManager -Managers "10.0.0.10:7801" -Credential (Get-Credential) -Force
# Logged in as 'admin'.
Get-ZrStore # authorized — without the login this is denied
Sign in and persist the connection as a reusable workspace.
Connect-ZrManager -Managers "10.0.0.10:7801" -Credential (Get-Credential) -SaveAs prod -Force
Related
- New-ZrUser — create a username/password operator identity.
- Set-ZrUserPassword — rotate an operator's password.
- Initialize-ZrSecurity — bootstrap security and the first admin.
- New-ZrWorkspace / Use-ZrWorkspace — create or join a workspace.
- Authentication and tokens — the control-plane vs. data-plane model.
- Admin cmdlets overview