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

640
Views
0
Helpful
3
Replies
ucscloudguru
Beginner

Calling a ucs central command from ucs director work flow

Hi

Need help .

I want run (Get-UcsCentralServiceProfile) command from ucs director work work using powershell agent.

I have installed in powertool in my one of server and I am trying to pointing ucs driector work flow to power tool installed server .

but i am getting error

(Execute PowerShell Command) failed with error - Command failedError while executing command: java.lang.Exception: Error code: 3, error message: Exception while executing script, selectedContext=<None>

Please let me know how to call a ucs central command from ucs director.

3 REPLIES 3
Orf Gelbrich
Cisco Employee

Does a simple command like this work:  echo "abc" > c:\test.txt

Did you load in your script that you execute the snap in Power Tools?

     Example here:Power CLI ESXi Host Profile

Can you use these built in tasks?

     Select Global Service Profile

Screen Shot 2016-11-29 at 6.20.54 AM.png

snoopj123
Enthusiast

It would be nice to see the code in question to make sure it's correct.  Also, are you importing the UCS Central PowerTool module into the script?  Unless you've done some really good manipulation behind the scenes to auto load all the modules you have on the device, you might have to declare the import of the module in your PowerShell script.

Like a

Import-Module CiscoUcsCentralPS (I know this is from an older version of the UCS Central PowerTool, but it's the one I had in front of me via a script I wrote already.

--j

Correct – the modules need to be imported. The power shell agent does not act the same as a user logging in and inheriting certain modules on the fly.

Orf Gelbrich

Check out UCS Director Workflow INDEX<https://communities.cisco.com/docs/DOC-56419> on Cisco Communities Site (Twitter @UCSDGURU)

Content for Community-Ad
This widget could not be displayed.