07-12-2013 10:13 AM
Hello,
Being new to UCS and to the UCS PowerTool and being exposed to what it can do at the most recent Cisco Live, I can see the benefit of using it. With that said, here is my question:
I have been able to create four credential files, since I have four domains to manage. I have been able to create the PowerTool scritpt to connect to one with no problem, but when I try to modify it so that I can log into all four at once, that is where I seem to have an issue. I open up PowerTool and execute the following:
Set-UcsPowerToolConfiguration -SupportMultipleDefaultUcs $true
$CredFileKey = ConvertTo-SecureString 'unlockme' -AsPlainText -Force
connect-ucs -LiteralPath C:\scripts\creds\all.xml -key $credfilekey
The all.xml file contains:
<ucshandles>
$handle1 = <ucs name="ahc-lgh-ucs2.advocatehealth.com" username="stehlik_jim" password="WSJEfwFfr8IYALzNSnOZSxWd2j49XhYMBji/fkOl2zE=" /> -NotDefault
$handle2 = <ucs name="ahc-ucs1.advocatehealth.com" username="stehlik_jim" password="oDw4IqPp/kOZZSjb4jq0oZBAC6E7FpWPoK35LnG0ILc=" /> -NotDefault
$handle3 = <ucs name="ahc-ucs2.advocatehealth.com" username="stehlik_jim" password="D0yZGcu/5P9dtoVgpclKK6GbOU4yzf7xzRRh4wxEii8=" /> -NotDefault
$handle4 = <ucs name="ahc-ucs3.corp.advocatehealth.com" username="stehlik_jim" password="VlnCfGYIKPe46z0c7xABsMWkcCsMgmLE6D6oG3DMA7Y=" /> -NotDefault
</ucshandles>
It appears to connect to all four, but I think I am having an issue with the $handle$ variable not being assigned because when I issue this command:
Get-UcsStatus -Ucs $handle1
I get nothing in return. So, what am I missing to be able to select which one of the four domains I would like to issue a command against? This will then lead to my next posted question regarding moving Service profiles.
Thank you,
Jim
07-16-2013 04:00 PM
James:
I'm assuming you edited the XML file to add the $handleX = portion. That's not proper format for that particular file. Here is an example of a properly configured file:
<ucshandles>
<ucs name="192.168.6.128" username="admin" password="ROuTtdyZVzmdNkKfahLktQ==" />
<ucs name="192.168.6.142" username="admin" password="RZpaZdvGnVtq+hlIbHxCOw==" />
<ucs name="192.168.6.143" username="admin" password="S6TQYbx+FPAeSly5QEfxZgis+WAkt21UyoGirvPMf="/>
<ucs name="192.168.6.144" username="admin" password="+bknnf8MMDZldALpROeQif5cLtCxL4Qu3BC6ez7J0lg=" />
</ucshandles>
I would do the same as what you did with the first three cmdlets, but you don't need to specify a handle. What you can do is perform a get-ucspssession, and there will be a UCS property.
You can use that to show what UCS PowerShell sessions have been authenicated and added to the default UCS handle variable, called $DefaultUcs. Here is an example:
PS C:\ucs> connect-ucs 172.25.206.5
cmdlet Connect-Ucs at command pipeline position 1
Supply values for the following parameters:
Credential
Proxy :
Cookie : 1374015132/559aebeb-f8ee-4501-88fc-23f480de5011
Domains :
LastUpdateTime : 7/16/2013 5:58:46 PM
Name : 172.25.206.5
NoSsl : False
NumPendingConfigs : 0
NumWatchers : 0
Port : 443
Priv : {admin, read-only}
RefreshPeriod : 600
SessionId : web_27407_B
TransactionInProgress : False
Ucs : eric
Uri : https://172.25.206.5
UserName : admin
VirtualIpv4Address : 172.25.206.5
Version : 2.1(1a)
WatchThreadStatus : None
PS C:\ucs> Get-UcsPSSession
Proxy :
Cookie : 1374015132/559aebeb-f8ee-4501-88fc-23f480de5011
Domains :
LastUpdateTime : 7/16/2013 5:58:46 PM
Name : 172.25.206.5
NoSsl : False
NumPendingConfigs : 0
NumWatchers : 0
Port : 443
Priv : {admin, read-only}
RefreshPeriod : 600
SessionId : web_27407_B
TransactionInProgress : False
Ucs : eric
Uri : https://172.25.206.5
UserName : admin
VirtualIpv4Address : 172.25.206.5
Version : 2.1(1a)
WatchThreadStatus : None
PS C:\ucs> $DefaultUcs
Proxy :
Cookie : 1374015132/559aebeb-f8ee-4501-88fc-23f480de5011
Domains :
LastUpdateTime : 7/16/2013 5:58:46 PM
Name : 172.25.206.5
NoSsl : False
NumPendingConfigs : 0
NumWatchers : 0
Port : 443
Priv : {admin, read-only}
RefreshPeriod : 600
SessionId : web_27407_B
TransactionInProgress : False
Ucs : eric
Uri : https://172.25.206.5
UserName : admin
VirtualIpv4Address : 172.25.206.5
Version : 2.1(1a)
WatchThreadStatus : None
PS C:\ucs> Get-UcsStatus -ucs eric
Name : eric
VirtualIpv4Address : 172.25.206.5
HaConfiguration : cluster
HaReadiness : ready
HaReady : yes
EthernetState : full
ChassisSerial1 : FOX1327GF45
ChassisSerial2 :
ChassisSerial3 :
Chassis1Status : ok
Chassis2Status : unknown
Chassis3Status : unknown
FiALeadership : subordinate
FiAManagementServicesState : up
FiAOobIpv4Address : 172.25.206.6
FiAOobIpv4DefaultGateway : 172.25.206.1
FiAOobIpv4SubnetMask : 255.255.255.0
FiBLeadership : primary
FiBManagementServicesState : up
FiBOobIpv4Address : 172.25.206.7
FiBOobIpv4DefaultGateway : 172.25.206.1
FiBOobIpv4SubnetMask : 255.255.255.0
07-16-2013 07:23 PM
Eric,
I appreciate your answer, but your solution does not work for me.
I have modified my credential xml file and removed the $handle# = and the /> -NotDefault from each line.
I run the following commands:
Set-UcsPowerToolConfiguration -SupportMultipleDefaultUcs $true
$CredFileKey = ConvertTo-SecureString 'unlockme' -AsPlainText -Force
connect-ucs -LiteralPath C:\scripts\creds\all.xml -key $credfilekey
It would appear to work because it returns the versions of each UCM that I asked it to log in.
The problem that I have now is that when I then issue the command:
Get-UcsPSSession
I get nothing in return. It just shows my PS C:\scripts> prompt
Now on the other hand, when I modify my credential file so that it only has one line in between the ucshandles tags, I do get the results that you show following the command Get-UscPSSession.
But, if I were to enter the following commands without using a credential xml file, it works how I would expect it.
$handle1 = Connect-Ucs <ip1> -NotDefault
$handle2 = Connect-Ucs <ip2> -NotDefault
Get-UcsStatus -Ucs $handle1,$handle2
The above code lets me log into to UCS domains and the shows the status for both. If I were to change the last command to:
Get-UcsStatus -Ucs $handle2
It would only show me information on Domain 2.
Thank you,
Jim
07-16-2013 07:35 PM
Can we please do a webex regarding this either tomorrow, or early next week as I'm on PTO Thursday and Friday?
Thanks,
Eric
07-16-2013 07:47 PM
Eric,
We sure can. I really hope that I am not imposing. Just frustrated that I can't get it work the way I would like it to.
My e-mail is james.stehlik@advocatehealth.com I am in the Midwest so its Central time zone for me. I do have a meeting from 10 - 11, but other than that, I am available.
Thank you again,
Jim
07-16-2013 07:50 PM
I sent you a direct email.
Thanks,
Eric
08-01-2016 10:34 AM
Did you ever figure this out? I am having the same trouble, I cannot get "Get-UcsServer" to work when I connect to multiple domains. I get the "Default list is blank" error even though Get-UcsPSSession returns the list of domains I am connected to.
Thanks
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide