Community forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


MattMcNabb
2017-02-28T13:03:49Z
I'm attempting to use the execute task to call PowerShell.exe using a credential. This doesn't seem to work the way I'd expect and doesn't seem to have access to the keystore for the user. This is the same process I've used in the past when executing PowerShell scripts from the task scheduler without issue. Can someone clarify exactly what the "Run task as" option does, if it does not launch the task as the specified user?

Thanks!
Sponsor
Forum information
Support
2017-03-01T10:36:50Z
What error do you get? Probably it is something with the path. You need to specify the full path to PowerShell.exe in command field.

Run Task as lets you run the whole process as or with the permission of a certain user.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
MattMcNabb
2017-03-17T19:19:49Z
Henrik,

When I call powerShell.exe directly from an Excecute task and run it with a particular credential, I have issues based on the fact that the task actually seems to be running as the system account. I have replicated this by running a PowerShell task as a service account, and run the command


Write-Output $env:username


Which writes out "System" to the output log. This indicates that "Run as" is not working in VisualCron.
Support
2017-03-20T19:52:44Z
It seems that either you are not using a Credential or have not checked "Load profile" in the Credential.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
MattMcNabb
2017-03-21T11:22:26Z
Henrik,

If I add the load profile option, then $env:username echoes out the computername instead. I checked to see if a task run this way had access to the user's key store and it did not.

Thanks!
Support
2017-03-22T10:01:35Z
Try writing this value:

[System.Security.Principal.WindowsIdentity]::GetCurrent().Name

Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
MattMcNabb
2017-03-23T17:11:53Z
Ok, that seems to echo out the right username. I'll test the key store again and see if this fixes that issue.

Thanks!
Scroll to Top