« Back to Microsoft Discussions

PowerTool: Authenticating to multiple systems in an XML credential file

Combination View Flat View Tree View
Threads [ Previous | Next ]
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: (emoticon [Connect-Ucs], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,Cisco.Ucs.Cmdlets.ConnectUcs



I 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!

Have you run the following cmdlet before trying to connect multiple UCS?

Set-UcsPowerToolConfiguration -SupportMultipleDefaultUcs $true

Matt,

When you use the -LiteralPath option to select a credential file, Connect-Ucs will attempt to log into all the systems specified in the file. One cannot select individual systems within it.

"Parameter set cannot be resolved using the specified named parameters."
is a PowerShell error, indicating that the combination of parameters specified cannot be used (as expected in this case).

Please ensure that you have specified:
Set-UcsPowerToolConfiguration -SupportMultipleDefaultUcs $true
when you are trying to log into multiple systems. Without this, only the first login will go through and the rest are not allowed by configuration.

Thanks,
- bhaskar

I apologize for not following up on this thread earlier. Thanks for the clarification!