I'm trying to use the connectivity information for multiple UCS systems in an XML file that I generated with PowerTool.
The problem isnt with the generation of the file, since I already have done that. It looks like this:
< ?xml version="1.0"?>
<ucshandles>
<ucs password="(encrypted key)" username="admin" name="192.168.1.101"/>
<ucs password="(encrypted key)" username="admin" name="192.168.1.104"/>
<ucs password="(encrypted key)" username="admin" name="192.168.1.107"/>
</ucshandles>I've successfully logged into the first UCS system listed in the file:
$CredFileKey = ConvertTo-SecureString 'testkey' -AsPlainText –Force
Connect-Ucs -LiteralPath C:\UCS_CREDS.xml -Key $CredFileKey So I know this method works. My only problem is using the second and third sysytems listed in the XML file. I have tried to use the -Name parameter with "Connect-Ucs" like so:
Connect-Ucs -LiteralPath C:\Users\moswalt\Desktop\UCS_CREDS.xml -Key $CredFileKey -Name 192.168.1.104 and it doesn't work. Gives me this error:
Connect-Ucs : Parameter set cannot be resolved using the specified named parameters.
At C:\testUCSscript.ps1:21 char:12
+ Connect-Ucs <<<< -LiteralPath C:\UCS_CREDS.xml -Key $CredFileKey -NoSsl
+ CategoryInfo : InvalidArgument: (
[Connect-Ucs], ParameterBindingException
+ FullyQualifiedErrorId : AmbiguousParameterSet,Cisco.Ucs.Cmdlets.ConnectUcsI really want to be able to use this method versus using credentials stored within the script itself. I work on many different customer systems, and I want them to have a credential file that identifies their specific systems, and the script iterates through all systems in the file, and does not need to be edited at all in order to operate.
Any help would be appreciated. Thanks in advance!