Windows Server workflow action to run powershell script

I have been asked to automate our process for off boarding. I have a workflow that is doing each our manual steps. I have a requirement to update the description on the users AD account. When I get to this point I am getting a error that make 0 since. We looked at the connection logs on the server and it appears that the VA’s are not even reaching out to the server. I am able to ping the host name of the server from each VA in the PTA cluster. For testing I have disabled SSL and Cert Verify to keep things simple.

I know the Credential Provider information is correct as it is the exact same as how I have it set up for the AD source. We have this set up to use Kerberos. The script that is being called is rather simple and the parameter is just the samaccountname. HttpRequest3 pulls the AD Account using the accounts api endpoint. Confirmed this step is working as expected.

Script Args:

SamAccountName
“$.hTTPRequest3.body[0].attributes.sAMAccountName”

PARAM(
    [Parameter(Mandatory)]
    [ValidateNotNullOrEmpty()]
    [string] $SamAccountName
)

function Escape-LdapFilterValue {
    param([Parameter(Mandatory)][string]$Value)

    # RFC 4515 escaping for LDAP filter assertion values
    $Value `
        -replace '\\', '\5c' `
        -replace '\*', '\2a' `
        -replace '\(', '\28' `
        -replace '\)', '\29' `
        -replace "`0", '\00'
}

# Step 1: Get AD User object make user AD Object exist.
$escaped = Escape-LdapFilterValue -Value $SamAccountName
$UserInfo = Get-ADUser -LDAPFilter "(samaccountname=$($escaped))" -Properties description

if ($null -ne $UserInfo) {

    #Update description for AD account if user exist.
    try{
        Get-ADUser -Identity $SamAccountName -Properties description | Set-AdUser -Description "Do Not enable unless approved by IAM" -ErrorAction Stop
    }
    catch{
        Write-Error "Failed to update description for AD account $SamAccountName. Error: $_"
    }
}
else{
    Write-Error "AD account for $SamAccountName does not exist."
}

Hi @mpotti,
Can you share the details configured in the Windows Server step, like which server type of auth etc. and is this the only error or are there any further lines to it?

Auth Type: NTLM

Pulling creds from Beyond Trust Password Safe

Reaching out to a server in our LAB that host the IQService on it.

Passing in the one variable from an API call to Get Accounts.

Here are screen prints with what I can share about the step.

Can you switch the authentication type from NTLM to Kerberos, add the Active Directory domain controller hostname under Kerberos Address, specify the domain name under Kerberos Realm, and try again?

You can try changing NTLM to Kerberos. Also you could use local parameter storage to store creds (within SailPoint) and give it a try.

The issue was around how the user name was being passed. I removed the domain from the user name and now it is working as expected.