cancel
Showing results for 
Search instead for 
Did you mean: 
cancel

PowerTool: Authenticating to multiple systems in an XML credential file

195
Views
0
Helpful
0
Comments
Advisor
This document was generated from CDN thread

Created by: Matt Oswalt on 30-03-2012 11:34:00 AM
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.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!

Subject: RE: PowerTool: Authenticating to multiple systems in an XML credential file
Replied by: Vijay Balyan on 06-04-2012 10:02:46 AM
Have you run the following cmdlet before trying to connect multiple UCS?

Set-UcsPowerToolConfiguration -SupportMultipleDefaultUcs $true

Subject: RE: PowerTool: Authenticating to multiple systems in an XML credential file
Replied by: Bhaskar Jayakrishnan on 09-04-2012 08:46:08 AM
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

Subject: RE: PowerTool: Authenticating to multiple systems in an XML credential file
Replied by: Matt Oswalt on 27-04-2012 09:12:33 AM
I apologize for not following up on this thread earlier. Thanks for the clarification!
CreatePlease to create content
This widget could not be displayed.