Alteryx Server Discussions

Find answers, ask questions, and share expertise about Alteryx Server.

Unable to make a workflow in Alteryx Server run local PowerShell scripts

franciscoruizrise
7 - Meteor

Hi community,

We are migrating workflows from a Alterix Desktop Automation over to Alteryx Server and have encountered problems with several workflows that need to run local (in the server) PowerShell scripts and read/write local files (in the server) that will later be used by other workflows.

The PowerShell scripts exports data from Active Directory and saves the data into CSVs that will be used by other worklfows. The PowerShell scripts itselfs needs to access another file for the encrpted credentials to connect to Active Directory.

I've tried several solutions proposed in the Alteryx community but still I'm not able to perform a succesfull execution of the workflow from the Gallery in the Alteryx Server.

Can you please help me trouble shoot this problem?

 

Here are some details and attachments screenshots:
Designer: Version: 2023.2.1.133 Patch: 3
Server: Version: 2023.2.1.133 Patch: 3
- Was this working before? If yes, then what has changed?
It was NOT working before on the Server version, it did work in the Desktop Automation version.
- Are you getting an error message? If yes can you send me a screenshot
There is no error message.
- To Reiterate, those workflows are running fine on designer but not on the server. Correct?
Correct, if the workflows are manually run in the Designer they work, but when I schedule them from the Gallery in the Alteryx Server the workflows keep on executing endlessly withour ever finishing.

 

Regards,

Francisco.

8 REPLIES 8
apathetichell
18 - Pollux

Assuming you have AMP on - this sounds like it could be a situation where something unrelated is erroring out - but instead of providing an error message - it keeps running (AMP behavior). I would

1) confirm that your alteryx worker has admin permissions (ie it can execute the powershell script)

2) try to run with amp off and see if that triggers an error message.

franciscoruizrise
7 - Meteor

Hi @apathetichell 

I tried running the workflow with AMP turned off.

In the Designer it worked fine as expected (it took 14 seconds to run) but in the Server it's been more than 15 minutes and is still running. I manually canceled it and the results are in the attached screenshot.

Regards.

apathetichell
18 - Pollux

Turn off Amp as your default engine on Server- re-run.

franciscoruizrise
7 - Meteor

Hi @apathetichell

I deactivated the default AMP but the result was exactly the same as the previous screenshot.

Regards.

apathetichell
18 - Pollux

sorry - let's take a step back - what is your powershell script doing - and can you share it?

franciscoruizrise
7 - Meteor

Sure, the script is exporting user data from Active Directory to CSV files:

 

cd "E:\Alteryx files\Alteryx external commands\Retrieve employee roster from AD"
$ADcred = Import-CliXml -Path "E:\alteryxuser.xml"
Get-adUser -Server ad01.corp.network -Credential $ADcred -filter * -SearchBase "OU=Employees,OU=Corp,DC=corp,DC=network" -Properties "CanonicalName","DistinguishedName","GivenName","Name","Surname", "ObjectClass","ObjectGUID","SamAccountName","SID","UserPrincipalName","mail","initials","msDS-cloudExtensionAttribute1","DisplayName","msDS-cloudExtensionAttribute2","Office","employeeType","employeeNumber","msDS-cloudExtensionAttribute3","msDS-cloudExtensionAttribute4","msDS-cloudExtensionAttribute5","msDS-cloudExtensionAttribute6","department","team","msDS-cloudExtensionAttribute7","msDS-cloudExtensionAttribute8","msDS-cloudExtensionAttribute9","msDS-cloudExtensionAttribute10","title","manager","msDS-cloudExtensionAttribute11","telephoneNumber",msDS-cloudExtensionAttribute12,"msDS-cloudExtensionAttribute13","employeeID","ipPhone","homePhone","mobile","personalTitle" | Select-Object "CanonicalName","DistinguishedName","GivenName","Name","Surname", "ObjectClass","ObjectGUID","SamAccountName","SID","UserPrincipalName","mail","initials","msDS-cloudExtensionAttribute1","DisplayName","msDS-cloudExtensionAttribute2","Office","employeeType","employeeNumber","msDS-cloudExtensionAttribute3","msDS-cloudExtensionAttribute4","msDS-cloudExtensionAttribute5","msDS-cloudExtensionAttribute6","department","team","msDS-cloudExtensionAttribute7","msDS-cloudExtensionAttribute8","msDS-cloudExtensionAttribute9","msDS-cloudExtensionAttribute10","title","manager","msDS-cloudExtensionAttribute11","telephoneNumber","msDS-cloudExtensionAttribute12","msDS-cloudExtensionAttribute13","employeeID","ipPhone","homePhone","mobile","personalTitle" | export-csv -notypeinformation Active_Directory_export.csv

apathetichell
18 - Pollux

I'd be curious if this worked in another version of Server - I don't see anything in the script which should create this behavior and the only thing I would see would be AMP related - or something with the priority missmatch between the selected job type and the log message (You have priority High - Information says Low. I'd flag this on the ticket you opened with support. I'd also try running with medium priority on server vs high priority. I'm sorry - I think this might be a verison bug.

 

And your script is solid - I like that usage of powershell in Alteryx workflows.

franciscoruizrise
7 - Meteor

I was never able to try it in another Server version, only in Designer and Desktop Automation.

I have a case opened with support and we are performing tests and diagnosis to trouble shoot this issue.

I've tried to run it on Medium priority but the result was the same. The real difference between test results was when turning AMP from ON to OFF. that causes the result logs in the Gallery to change and show different information.