Quantcast
Channel: VMware Communities : Discussion List - Automation Tools
Viewing all articles
Browse latest Browse all 9071

Connect-VIServer : Invalid URI: The hostname could not be parsed.

$
0
0

Hello folks,

I encountered error today on my code as shown error msg below, can someone help me on this pls?

Am trying to connect to multiple vcenter servers assigned to $VIServer variable.

 

 

Error:

Connect-VIServer : Invalid URI: The hostname could not be parsed.

At C:\PS_SCRIPTS\berns\getvminfo.ps1:30 char:1

+ Connect-VIServer $VIServer -User $user -Password $pass -WarningAction

SilentlyCo ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~

    + CategoryInfo          : NotSpecified: (:) [Connect-VIServer], UriFormatE

   xception

    + FullyQualifiedErrorId : System.UriFormatException,VMware.VimAutomation.V

   iCore.Cmdlets.Commands.ConnectVIServer

 

 

Snippet:

# Credential

$user="dom\testid"

$pass="pass"

 

# All current Virtual Centers to check

$VIServer="vc1, vc2, vc3"

 

# Connect to Virtual Center servers

Connect-VIServer $VIServer -User $user -Password $pass -WarningAction SilentlyContinue |out-Null


Viewing all articles
Browse latest Browse all 9071

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>