[Rundeck] Run powershell script on Windows node using another account (Domain Account)

232 views
Skip to first unread message

Edouard KILIMOU

unread,
Jan 26, 2023, 7:26:22 AM1/26/23
to rundeck...@googlegroups.com

Hello, 
I'm looking to run a powershell script (.ps1) on Windows node (A) using WinRM and CredSSP.  
I tested the script and it works locally. 
The script must purge a folder and save files remotely on shared directory (B). 
After passing looking online i try this in rundeck job, but, job seems to run well but nothing is performed:
Job specifications:
Password: stored in key storage (options variable: @option.password@)
Invocation String: powershell.exe -File
File Extension: .ps1

------------------------------------------------------------------------------------------------
$password =  @option.password@
$username = "DOMAIN_USER"
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential $username, $securePassword
Start-Process -FilePath "\path\to\script.ps1" -Credential $credential
-----------------------------------------------------------------------------------------------------
Execution result

Jobs seems to run well but nothing was performed. 
Am I doing well or something Wrong? 

Best Regards






--
KILIMOU T. Edouard
Ingénieur R&D DevOps

Lille, France : +33 (0) 698 268 622

--
KILIMOU T. Edouard
Ingénieur R&D DevOps

Lille, France : +33 (0) 698 268 622

rac...@rundeck.com

unread,
Jan 26, 2023, 7:29:12 AM1/26/23
to rundeck-discuss
Hi Edoard,

Do you see any clue running the job in debug mode?

Regards.

Edouard KILIMOU

unread,
Jan 26, 2023, 11:35:23 AM1/26/23
to rundeck...@googlegroups.com
Hi, i run the job in debug mode, no error is shown

Regards

--
You received this message because you are subscribed to the Google Groups "rundeck-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rundeck-discuss/07e531ca-4ac4-4a2f-b8bd-9e4c73a3a362n%40googlegroups.com.

mezam

unread,
Jan 26, 2023, 12:52:39 PM1/26/23
to rundeck-discuss
Hi Edouard, already tried setting  your invocation string to simply: powershell.exe ? Leaving out the -File switch
Reply all
Reply to author
Forward
0 new messages