I'm attempting to execute a .NET (3.5) command line program from within a VBScript file which does two main things:
- Connects to an Active Directory that is on the same domain as the server the script is hosted to retrieve an attribute value. I search AD using the first command line argument which is a username.
- Creates a DTO using said attribute value and the second command line argument which is then used in a WCF service call.
When I run the application explicitly, everything works. Active Directory is accessed, the attribute is retrieved and the WCF service is called with the correct result (as verified by looking at the database).
(Edit: I apologize, I forgot to put what the actual issue was.)
When I run the script, it seems as though I can't access Active Directory in my .NET code (the MyProgram app).
The VBScript code:
Dim objResult
Set objShell = WScript.CreateObject("WScript.Shell")
objResult = objShell.Run("MyProgram " & strUsername & " 0", 1, True)
Does the WScript.Shell object need special permissions on the file? I've checked them and the Execute permission is there. Typically, the second argument I am passing to the .Run() method would be 6, I wanted it to be 1 for debugging.
Is there another way for me to execute a program in VBScript?