« Back to Microsoft Discussions

RE: Connect-UCS error

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Hi-
 
Greetings!
 
I am tryinig to automate the login with ucs. I have downloaded & instaleld the UCS simulator & goucs 2.0. I am able to login via the Browser using the IP & login ID.
However, when I tried to fire the following Powershell script, it gives the following error:
--------------------------------------------------------------------------------------------------------------------------
Import-Module 'C:\Program Files (x86)\Cisco\Cisco UCS PowerTool\Modules\CiscoUcsPS\CiscoUcsPS.psd1'
$user = "config"
$password = "xxxxx" | ConvertTo-SecureString -AsPlainText -Force
$cred = New-Object system.Management.Automation.PSCredential($user, $password)
$handle1 = Connect-Ucs 192.168.10.130 -NotDefault -Credential $cred
--------------------------------------------------------------------------------------------------------------------------
Error:
Connect-Ucs : Connect-Ucs: Connection to 192.168.10.130 Failed.
At line:1 char:23
+ $handle1 = Connect-Ucs <<<<  192.168.10.130 -NotDefault -Credential $cred
    + CategoryInfo          : NotSpecified: (emoticon [Connect-Ucs], Exception
    + FullyQualifiedErrorId : Cisco.Ucs.Cmdlets.ConnectUcs
Any pointers or suggenstions would be very much helpful.
 
Thank You
Murali
 

Murali,

The usage is correct.

PS C:\> $user = "admin"
PS C:\> $password = "xxxxxx" | ConvertTo-SecureString -AsPlainText -Force
PS C:\> $cred = New-Object system.Management.Automation.PSCredential($user, $password)
PS C:\> $handle1 = Connect-Ucs ucs-pod01 -NotDefault -Credential $cred
PS C:\> $handle1


Proxy :
Cookie : 1336603486/a363c4f7-e9ce-4d27-85d8-88d3e7e3dfb7
Domains :
LastUpdateTime : 5/9/2012 2:56:18 PM
Name : ucs-pod01
NoSsl : False
NumPendingConfigs : 0
NumWatchers : 0
Port : 443
Priv : {admin, read-only}
RefreshPeriod : 600
SessionId : web_43234_B
TransactionInProgress : False
Ucs : ucs-pod01
Uri : https://ucs-pod01
UserName : admin
VirtualIpv4Address : 10.65.124.81
Version : 2.0(0.121)
WatchThreadStatus : None



PS C:\>


Can you check with the Uri ? Also check with the -Xml option to see what the error is. Let us know if you continue to have issues.

Thanks,
- bhaskar

RE: Connect-UCS error
Answer
10/2/12 11:04 AM as a reply to Bhaskar Jayakrishnan.
hello I want to connect a switch to the lab. I tried what you suggest but I can not.  I get the error:
Ucs-Connect: Connect-Ucs: Failed Connection to 10.87.7.17.
<< Char: 23
+ $ Handle1 = Connect-Ucs <<<< "10.87.7.17"-Credential $ cred
     + CategoryInfo: NotSpecified: ( emoticon [Connect-Ucs] Exception
     + FullyQualifiedErrorId: Cisco.Ucs.Cmdlets.ConnectUcs >>
 
please tell me how to get to a switch via powershell and even change its VLAN as
 
thank you for any response.