Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

Using Credentials within PowerShell-Plugin script

$
0
0

Hi all,

 

I'm just trying to get my first workflow to run, but already stuck....

 

I would like to call a powershell script that uses the NetApp cmdlet "Connect-NAServer" wich needs a PSCredential as input.

 

I'm using the following code to generate the PS script:

script = " \n"

+ "Import-Module 'DataOntap' \n"

+ "$NAUser = '" + NAUser + "' \n"

+ "$NAPass = '" + NAPassword + "' | ConvertTo-SecureString -AsPlainText -Force \n"

+ "$NAControllers = @(" + NAControllers + ") \n"

+ "$NAcred = New-Object -typename System.Management.Automation.PSCredential -argumentlist $NAuser,$NApass \n"

+ "ForEach ($NAController in $NAControllers) { \n "

+ "Connect-NaController $NAController -HTTP -Credential $NAcred \n"

+ "} \n";

 

After that I call the script as follows:

try {

session = PSHost.openSession();

output = System.getModule("com.vmware.library.powershell").invokeScript(PSHost,script,session.getSessionId()) ;

} finally {

if (session){

  PSHost.closeSession(session.getSessionId());

}

}

 

NAPassword is an attribute of the workflow, linked to a configuration element (of type SecureString).

 

This always results in this error: "System.Security.Cryptography.CryptographicException: The requested operation cannot be completed. The computer must be trusted for delegation and the current user account must be configured to allow delegation."

 

I already tried to enable delegation in AD for the powershell host. ("Trust this computer for delegation to any service (Kerberos only)"), but still no luck.

Any ideas, what is happening here?

 

Regards, Stefan

 

P.S.: The connection the the powershell host is configured to use kerberos authentification - shared authenticaiton.


Viewing all articles
Browse latest Browse all 6251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>