<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>PowerTool: Authenticating to multiple systems in an XML credential file</title>
  <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_category?p_l_id=2049005&amp;mbCategoryId=0" />
  <subtitle>PowerTool: Authenticating to multiple systems in an XML credential file</subtitle>
  <id>http://developer.cisco.com/c/message_boards/find_category?p_l_id=2049005&amp;mbCategoryId=0</id>
  <updated>2013-05-26T08:07:24Z</updated>
  <dc:date>2013-05-26T08:07:24Z</dc:date>
  <entry>
    <title>RE: New Message from Matt Oswalt in Unified Computing UCS Manager - Microso</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=2049005&amp;messageId=5552302" />
    <author>
      <name>Matt Oswalt</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=2049005&amp;messageId=5552302</id>
    <updated>2012-05-02T19:15:03Z</updated>
    <published>2012-05-02T19:15:03Z</published>
    <summary type="html">[quote]Matt:

 

If you upgrade to version 0.9.8.0 (available on CDN) we have added pathing support for powershell library locations to add the path to the Cisco UCS PowerTool psd1 (CiscoUcsPS.psd1) which is now located in C:\Program Files (x86)\Cisco\Cisco UCS PowerTool\Modules\CiscoUcsPS.  After upgrade if you are still having issues, please let me know.

 

Thanks,

Eric

 
[/quote]
 
Thanks, Eric! That did the trick! I have been meaning to apply the new update since it came out just didn't get around to it.</summary>
    <dc:creator>Matt Oswalt</dc:creator>
    <dc:date>2012-05-02T19:15:03Z</dc:date>
  </entry>
  <entry>
    <title>RE: Applying changes to Service Profiles in a specific Sub-Organization</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=2049005&amp;messageId=5547644" />
    <author>
      <name>Matt Oswalt</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=2049005&amp;messageId=5547644</id>
    <updated>2012-05-02T13:56:21Z</updated>
    <published>2012-05-02T13:56:21Z</published>
    <summary type="html">I noticed you're using the following to "import" the UCS PowerTool module:

[color=#ff6600]    # Import the UCS PowerTool module
    Import-Module CiscoUcsPs[/color]
 
When I run that I get this:
[color=#ff6600]
[/color]
[color=#ff6600]    Import-Module : The specified module 'CiscoUcsPs' was not loaded because no valid module file was found in any module directory.[/color]
 
So instead of running that I have to use this:
 
[color=#ff6600]    cd 'C:\Program Files (x86)\Cisco\Cisco UCS PowerTool'
    .\StartUcsPS.ps1[/color]
 
Any idea how I can get that to import the way you are?</summary>
    <dc:creator>Matt Oswalt</dc:creator>
    <dc:date>2012-05-02T13:56:21Z</dc:date>
  </entry>
  <entry>
    <title>RE: Applying changes to Service Profiles in a specific Sub-Organization</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=2049005&amp;messageId=5547624" />
    <author>
      <name>Matt Oswalt</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=2049005&amp;messageId=5547624</id>
    <updated>2012-05-02T13:50:05Z</updated>
    <published>2012-05-02T13:50:05Z</published>
    <summary type="html">[quote]Matt,

Just wanted to mention that it was a quick one that i posted. 

But you should note that It does not take care of orgs within orgs. And so It also does not take care of same org name appearing at multiple level.

The below should take care of displaying Orgs from all levels.. But Get-Unique will eliminate multiple entries of the same name, even when they are at different Org levels.
$orgNameList = $org | Get-UcsOrg -Hierarchy | % {$a = $_.Rn; if([Regex]::IsMatch($a,"org-*")){ $a }} | Get-Unique


Thanks,
Vijay Vikrant Balyan[/quote]
 
Fortunately, although my environment is large, it is not very complex. There are only a few sub-orgs off of the root (so far) so this script is more than sufficient. I did modify it a little to improve usability.</summary>
    <dc:creator>Matt Oswalt</dc:creator>
    <dc:date>2012-05-02T13:50:05Z</dc:date>
  </entry>
  <entry>
    <title>RE: Applying changes to Service Profiles in a specific Sub-Organization</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=2049005&amp;messageId=5541187" />
    <author>
      <name>Matt Oswalt</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=2049005&amp;messageId=5541187</id>
    <updated>2012-04-30T14:11:25Z</updated>
    <published>2012-04-30T14:11:25Z</published>
    <summary type="html">Wow....that's great! Thank you!
 
I was initially pretty discouraged when I discovered the relative lack of practical documentation, but if the forum is or will be anything like this, I'll do my best to contribute so we can get some mean PowerTool scripts going!</summary>
    <dc:creator>Matt Oswalt</dc:creator>
    <dc:date>2012-04-30T14:11:25Z</dc:date>
  </entry>
  <entry>
    <title>RE: Applying changes to Service Profiles in a specific Sub-Organization</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=2049005&amp;messageId=5530547" />
    <author>
      <name>Matt Oswalt</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=2049005&amp;messageId=5530547</id>
    <updated>2012-04-27T16:07:28Z</updated>
    <published>2012-04-27T16:07:09Z</published>
    <summary type="html">Thanks, that helps me understand a little more.
 
I will further clarify my specific needs - there are no nested suborgs, other than what's nested within "root". There are, however, several suborgs at that level and I want to limit my changes to only specific sub-organizations for "layer 8" reasons. As a result, I need my script to not only limit changes to the suborg specified, but allow the user of the script to select it from a list at runtime for ease of use.
 
As a result, I used the following snippet to populate a string array to present these to the user.
 
[color=#ff0000]echo 'Getting organizational units from system...'
foreach ($thisOrg in Get-UcsOrg | Select Name | Out-String)
{
    $UcsOrgs += $thisOrg.ToString()
}[/color]
[color=#ff0000][/color]
 
I then created a new var to hold the Org object (non-string) and referred to it in my statement to power on service profiles:
 
[color=#ff0000]#This is where I will later build in the ability to choose an org from the list. For now, I'm simply hard coding as string.
$targetedOrgString = 'ORG-A'

echo "Powering on all Service Profiles in $targetedOrgString ..."

$targetedOrg = Get-UcsOrg -Name $targetedOrgString
Get-UcsServiceProfile -Org $targetedOrg | Set-UcsServerPower -State admin-up -Force[/color]
 
Any issues with the above segments? Anything I can improve upon?</summary>
    <dc:creator>Matt Oswalt</dc:creator>
    <dc:date>2012-04-27T16:07:09Z</dc:date>
  </entry>
  <entry>
    <title>RE: PowerTool: Authenticating to multiple systems in an XML credential file</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=2049005&amp;messageId=5526123" />
    <author>
      <name>Matt Oswalt</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=2049005&amp;messageId=5526123</id>
    <updated>2012-04-27T14:12:33Z</updated>
    <published>2012-04-27T14:12:33Z</published>
    <summary type="html">I apologize for not following up on this thread earlier. Thanks for the clarification!</summary>
    <dc:creator>Matt Oswalt</dc:creator>
    <dc:date>2012-04-27T14:12:33Z</dc:date>
  </entry>
  <entry>
    <title>Applying changes to Service Profiles in a specific Sub-Organization</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=2049005&amp;messageId=5526116" />
    <author>
      <name>Matt Oswalt</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=2049005&amp;messageId=5526116</id>
    <updated>2012-04-27T14:11:39Z</updated>
    <published>2012-04-27T14:11:39Z</published>
    <summary type="html">I'm trying to figure out how to apply changes to a service profile on a sub-org level. I notice that there is a type of Cisco.Ucs.OrgOrg and that the Get-UcsServiceProfile Cmdlet has a parameter of "-Org". However, I don't know how to use the Cisco.Ucs.OrgOrg type. 
Do I need to typecast a string containing the desired sub-org name to type Cisco.Ucs.OrgOrg? If so, how? Any details regarding changes on a sub-org level would be appreciated. I know documentation on PowerTool thus far is scarce as it is, but I can't find ANYTHING about this particular item.
Thanks!</summary>
    <dc:creator>Matt Oswalt</dc:creator>
    <dc:date>2012-04-27T14:11:39Z</dc:date>
  </entry>
  <entry>
    <title>PowerTool: Authenticating to multiple systems in an XML credential file</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=2049005&amp;messageId=5386099" />
    <author>
      <name>Matt Oswalt</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=2049005&amp;messageId=5386099</id>
    <updated>2012-03-30T17:28:44Z</updated>
    <published>2012-03-30T16:34:00Z</published>
    <summary type="html">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:
[color=#ff0000]
[/color]
[color=#ff0000]&lt; ?xml version="1.0"?&gt;
   &lt;ucshandles&gt; 
      &lt;ucs password="(encrypted key)" username="admin" name="192.168.1.101"/&gt; 
      &lt;ucs password="(encrypted key)" username="admin" name="192.168.1.104"/&gt; 
      &lt;ucs password="(encrypted key)" username="admin" name="192.168.1.107"/&gt; 
   &lt;/ucshandles&gt;[/color]


I've successfully logged into the first UCS system listed in the file:


[color=#ff0000]$CredFileKey = ConvertTo-SecureString 'testkey' -AsPlainText –Force
Connect-Ucs -LiteralPath C:\UCS_CREDS.xml -Key $CredFileKey [/color]


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:


[color=#ff0000]Connect-Ucs -LiteralPath C:\Users\moswalt\Desktop\UCS_CREDS.xml -Key $CredFileKey -Name 192.168.1.104[/color]



 and it doesn't work. Gives me this error:


[color=#ff0000]Connect-Ucs : Parameter set cannot be resolved using the specified named parameters.
At C:\testUCSscript.ps1:21 char:12
+ Connect-Ucs &lt;&lt;&lt;&lt;  -LiteralPath C:\UCS_CREDS.xml -Key $CredFileKey -NoSsl
    + CategoryInfo          : InvalidArgument: (:) [Connect-Ucs], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,Cisco.Ucs.Cmdlets.ConnectUcs[/color]


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!</summary>
    <dc:creator>Matt Oswalt</dc:creator>
    <dc:date>2012-03-30T16:34:00Z</dc:date>
  </entry>
</feed>

