All Tagging related cmdlets fails to execute after reconnecting to vCenter with Session ID in new PowerShell Window
search cancel

All Tagging related cmdlets fails to execute after reconnecting to vCenter with Session ID in new PowerShell Window

book

Article ID: 410838

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

When connecting to the vCenter Server from a PowerShell session using the following command:

$conn = Connect-VIServer -Server <FQDN> -User <Username> -Password <Password>

The Session ID can be retrieved with :

$conn.SessionId

If you attempt to reconnect to vCenter in a new PowerShell session using the saved Session ID:

Connect-VIServer -Server <FQDN> -Session "<output of $conn.SessionId>"

Although the connection is successfully established, executing tagging-related cmdlets such as Get-Tag results in the following error:

Get-Tag     No Lookup service information is available for this vCenter server.
At line:1 char :1
+ Get-Tag
+ CategoryInfo              : NotSpecified: (:) [Get-Tag], CisException
+ FullyQualifiedError Id : VMware. VimAutomation. ViCore. Impl. V1. Service. Tagging. Cis. TaggingServiceCisImpl. GetTag. Error , VMware. VimAutomation. ViCore. Cmdlets. Commands. Tagging. GetTag

Environment

VMware vCenter Server 7.x

VMware vCenter Server 8.x

VMware vCenter Server 9.x

VMware PowerCLI

 

Resolution

This behavior is expected. Tagging related cmdlets such as Get-Tag or Get-TagAssignment require a connection to vCenter Server established with the Connect-VIServer cmdlet using any authentication method that establishes a new session.