VBScript: Using WScript.Shell to Execute a Command Line Program That Accesses Active Directory -


I am trying to execute a .NET (3.5) command line program from inside a VBScript file which is two main Talks:

  • Connects to an Active Directory that is on the same domain, the script is hosted to get an attribute value as the server. I use AD command first argument that is a username.
  • Duties have made DTO using Attribute Value and the second command line argument which is then used in the WCF service call.

When I explicitly run the application, everything works, Active Directory is used, the attribute is retrieved and the WCF service is called with the correct result (As verified by looking at the database).

(Edit: I apologize, too.)

When I run the script, it seems that I myself Can not use Active Directory in the NET code (MyProgram app)

VBScript code:

objShell set objShell = WScript.CreateObject ("WScript.Shell") objResult = objShell.Run ("MyProgram" and "name" and "0" ", 1, true)

Does the WScript.Shell object require special permission on file? I have checked them and the permissions are allowed. Usually, the second argument I'm passing. The cry () method will be 6, I wanted to debug it to be 1.

Is it another way to execute a program in VBScript? There is no answer (I can not post comment), just a few random ideas can be useful. Unfortunately I have never dealt with the seriatrix, only with regular Windows servers.

_0. Make sure you are not a victim of a Windows firewall, or any other personal firewall that blocks the selected processes.

Add 10 minutes of sleep to the first line of your .NET app, then run both VBScript files and run your stand-alone application, the Scientist Process Explorer, and compare 2 processes.

_1. Just one tab, "command line" and "current directory" make sure they are similar.

_2 "ENVIRONMENT" tab Make sure that they are similar, generally child procedures are heirs of the environment, but this behavior can be easily changed.

The following is required by "Check My Script", then you mean double-clicking on the .bbs file:

_3 Image tab, "user" If they are different, it can mean that the user's use of a network (such as local systems), or user tokens, can not be confined to the delegation, and thus in the case of local resources (like IIS NTLM auth ), Or sub Near Ogkrta has no access to the local files.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -