Active IQ Unified Manager Discussions

WFA - Generate Random Password ?

sheelnidhig
3,441 Views

Hello All,

 

I am trying to create a workflow which should be able to create a user on a Netapp Cluster mode system.

For that an idea was to be able to generate the random password and send it over an email.

 

But i am not able to pass the password string on to next command.

Attached a test workflow which sould create a password and prints from next command but its not working.

 

Please help,

 

,Sheel

1 ACCEPTED SOLUTION

sinhaa
3,392 Views

Sheel,

            Your workflow has fundamental errors. I'm not going to explain them all, there are many.

 

But will resolve your query. To pass dynamically generated password to the next command use Powershell cmdlet : Add-WfaWorkflowParameter and Get-WfaWorkflowParameter in your next command. See how to to use them go-to WFA->Help->Support Links -> WFA Powershell cmdlets help

 

See the below command code for your help:

 

##Random Password

 

param
(
[parameter(Mandatory=$true, HelpMessage="Parameter Name")]
[string]$ParameterName

)

 

Add-Type -AssemblyName System.web
$Password = [Web.Security.Membership]::GeneratePassword(12,3)


Get-WFALogger -Info -message $("Generated " +$ParameterName+":"+$Password )
Add-WfaWorkflowParameter -Name $ParameterName -Value $Password

 

 

#next command Print The password

 

param
(
[parameter(Mandatory=$true, HelpMessage="Parameter Name")]
[string]$ParameterName

)

$Password = Get-WfaWorkflowParameter -Name $ParameterName
Get-WFALogger -Info -message $("Value of "+$ParameterName+" : " + $Password )

 

 

 

 

sinhaa

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

View solution in original post

2 REPLIES 2

sinhaa
3,393 Views

Sheel,

            Your workflow has fundamental errors. I'm not going to explain them all, there are many.

 

But will resolve your query. To pass dynamically generated password to the next command use Powershell cmdlet : Add-WfaWorkflowParameter and Get-WfaWorkflowParameter in your next command. See how to to use them go-to WFA->Help->Support Links -> WFA Powershell cmdlets help

 

See the below command code for your help:

 

##Random Password

 

param
(
[parameter(Mandatory=$true, HelpMessage="Parameter Name")]
[string]$ParameterName

)

 

Add-Type -AssemblyName System.web
$Password = [Web.Security.Membership]::GeneratePassword(12,3)


Get-WFALogger -Info -message $("Generated " +$ParameterName+":"+$Password )
Add-WfaWorkflowParameter -Name $ParameterName -Value $Password

 

 

#next command Print The password

 

param
(
[parameter(Mandatory=$true, HelpMessage="Parameter Name")]
[string]$ParameterName

)

$Password = Get-WfaWorkflowParameter -Name $ParameterName
Get-WFALogger -Info -message $("Value of "+$ParameterName+" : " + $Password )

 

 

 

 

sinhaa

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

sheelnidhig
3,367 Views

Thanks Sinhaa, atleast this works for me:-)

Would it be possible to point out the errors that you saw in the workflow.

 

,Sheel

Public