Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 7

PowerShell action Script doesn't run


i have created a Action Alert that execute a external Program. This execute a script that delete some file  to free space .  If i run this script locally it works fine. Just some information : the solarwindws service is running under local system. The orion server are in different domain that the destination server. the script only run some command to delete files .

i dont know if are permission issue or i need to configure something in the script that connect to destination server  or put the credentials in the command . i read this document Execute remote process through WMI and Powershell  but still dont run .

command that i have tested

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy unrestricted -command "c:\CleanUpDisk.ps1 '${NodeName}'"

C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy unrestricted -command "c:\CleanUpDisk.ps1 '${NodeName}'"

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy unrestricted -NonInteractive -file "c:\CleanUpDisk.ps1"


0 Kudos
1 Reply

Try changing your command line to this:

C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -NonInteractive -NoProfile -Command "&{C:\CleanUpDisk.ps1 ${N=SwisEntity;M=Node.SysName}}"