Skip to main content

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.

  • -Credential logs in against the Management Service (Get-Credential prompts for the username/password of an identity created with New-ZrUser, or the bootstrap admin from Initialize-ZrSecurity). On success it prints Logged in as '<user>'. The password is used only for login and is not retained.
  • -Token captures an already-issued admin token directly instead of logging in.
  • -SaveAs persists the connection (and its token) as a named workspace and activates it, so you can return to it later with Use-ZrWorkspace.
  • -Force replaces an existing active connection.
Connecting vs. authenticating

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

ParameterTypeRequiredDescription
-Managersstring[]YesManagement Service endpoints (host, host:port, or URL) to connect to.
-CredentialPSCredentialNoUsername/password to log in with (Get-Credential). The returned session token is captured for the session. Requires security to be enabled.
-TokenstringNoAn existing admin bearer token to capture for the session instead of logging in.
-SaveAsstringNoPersist this connection as a named workspace and activate it.
-ForceswitchNoReplace an existing active connection instead of failing.
-PortintNoManagement 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