Project and Portfolio Management Practitioners Forum
cancel

ksc_local_exec not working with .vbs file

Highlighted
bzdafro
Honored Contributor.

ksc_local_exec not working with .vbs file

I am trying to run "ksc_local_exec cscript d:\filename.vbs" It keeps failing. I believe the issue is the vbs script uses windows environmental variables such as userdomain in WshNetwork.UserDomain. I hard coded the userdomain and it fixed that part but fails on a getobject. The vbs command runs fine if I log into the PPM server as the windows domain account and execute the vbs script. No problems. The script is accessing AD and managing users/groups. I was wondering if anyone has run into this. It seems the ksc_local_exec isnt using the windows environment variables for the user account. Is there any other way I can execute this command? I cannot use the simple_respond since I would need to use the runas command, which needs " " around the cscript command. Simple respond fails because it tries to match up the pairs of " ". I would need to run something like the following, and cannot get it to work because of the " " around the cscript. Any suggestions? ksc_simple_respond "runas /user:domain\\userid "cscript.exe d:\Scripts\testscript.vbs"" "Enter the password for" domain\userid:" "[USR="userid".PASSWORD]"
2 REPLIES
Erik Cole
Acclaimed Contributor.

Re: ksc_local_exec not working with .vbs file

Can you maybe encapsulate your runas in the testscript.vbs, or possibly use a "wrapper" script called by PPM that calls testscript.vbs as your domain user?
bzdafro
Honored Contributor.

Re: ksc_local_exec not working with .vbs file

Tried calling the vbs script from a bat file. It works if I run from windows command prompt, but fails from PPM. I still need to do the runas. Does anyone run vbs scripts to add remove users from active directory using PPM? If so, how are you calling the scripts?


An error occurred during command parsing.
(KNTA-10127) Unknown or out of sequence command:
[ksc_simple_respond "runas /user:nt_a\\userid d:\Scripts\Call.bat" -hide "user:" "[USR="userid".PASSWORD]"