Hello All,
I am trying to validate the Workflows in version 3.1, which were created in older version of WFA 3.0P2.
But then i try to execute of the custom command i get the following error:
"20:05:38.481 ERROR [Create New User] Command failed for Workflow 'CLI Admin Access to Netapp (cDOT)' with error : '_x0003_', hexadecimal value 0x03, is an invalid character. Line 1, position 110."
can anyone please help me what could be a possible issue.
The command code is:
param (
[parameter(Mandatory=$true, HelpMessage="Cluster (controller) IP or name")]
[string]$Cluster,
[parameter(Mandatory=$true, HelpMessage="Username")]
[string]$Username,
[parameter(Mandatory=$true, HelpMessage="Role for which user needs to request access for !")]
[string]$role,
[parameter(Mandatory=$true, HelpMessage="Comment with date and time!")]
[Bool]$spaccess,
[parameter(Mandatory=$true, HelpMessage="Comment with date and time!")]
[string]$comment,
[parameter(Mandatory=$false, HelpMessage="Any Additional Test")]
[string]$AdditionalText
)
Connect-WfaCluster $Cluster
$passkey = Get-WfaWorkflowparameter -name $Username
# $passkey = ConvertTo-SecureString $password -AsPlainText -Force
Get-WFALogger -Info -message $("Password Gathered")
$date = date
if ($AdditionalText){
$comments = $comment + "(Created on " + $date + " ). Requested for " + $AdditionalText + " Hours."
} else {
$comments = $comment + "(Created on " + $date + " )"
}
$getuser = Get-NcUser -name $Username -Application $application -Vserver $Cluster
if ($getuser) {
Get-WFALogger -Info -message $("Found user")
if (($getuser).IsLocked -like "True") {
Get-WFALogger -Info -message $("User " + $Username + " is Locked")
Unlock-NcUser -UserName $Username -Vserver $Cluster
Set-NcUserPassword -UserName $Username -Password $passkey -VserverContext $Cluster
Get-WFALogger -Info -message $("Unlocking user")
} else {
Get-WFALogger -Info -message $("Updating user password")
Set-NcUserPassword -UserName $Username -Password $passkey -VserverContext $Cluster
}
} else {
Get-WFALogger -Info -message $("Creating new User: " + $Username)
New-NcUser -UserName $Username -vServer $Cluster -Application 'ssh' -Role $role -Password $passkey -Comment $comments
Get-WFALogger -Info -message $($comments)
if ($spaccess -eq $TRUE) {
New-NcUser -UserName $Username -vServer $Cluster -Application 'service-processor' -Role $role -Password $passkey -Comment $comments
New-NcUser -UserName $Username -vServer $Cluster -Application 'console' -Role $role -Password $passkey -Comment $comments
Get-WFALogger -Info -message $("Creating new User with SP access : " + $Username)
}
}
Thanks,
Sheel