Jump to content

DriveMapAdd & Runasset Problem


Recommended Posts

Hello,

I created a simple script:

The user launch a very simple GUI enters his username of our domain and enter his password. After this the netfolders will be connected. For this I'm using the RunAsSet command:

RunAsSet($username, "domain", $passwort)

DriveMapAdd("U:", "\\server\users\" & $username)

Now, the following occurs: I'm logged in a as normal domain user at this "media-pc" and I'm not getting a connection to the server, I'm getting a connection to t the server if I'm using a member of the Domain-User group. The error-code of DriveMapAdd is 0 and also 0 for the RunAsSet command. The "Runas service" is running. The srange thing: I can do: net use u: \\...\... * /user:user1 this command is working.

Any ideas?

Thanks

Link to comment
Share on other sites

Look at help file 'RunAsSet ' ...

Remarks

This function allows subsequent Run and RunWait functions to run as a different user (e.g. Administrator). The function only works on the 2000/XP (or later) platforms. NT4 users should install and use the SU command from the NT Resource Kit.

Use 'DriveMapAdd ( "device", "remote share" [, flags [, "user" [, "password"]]] )' with $passwort and $username.

Edited by Briegel
Link to comment
Share on other sites

I'm having the same issue. If I run it directly from the .au3 file it works fine, but if I execute the the compiled exe I gte the "unknown function" error on "line -1". If I comment out the RunAsSet the script works okay.

I'm using Autoit v3.2.10 on Windows XP SP2. My machine doesn't have the RunAs service, but it has the Secondary Login service, which is running. I'm logged in with a domain regular user account, trying to execute something with a different domain user account. The reason is I need to copy files from a network share that the second domain user account can access. But what I'm attempting to do with the account doesn't seem to matter, as "unknown function name" seems to point to an error in the compiled exe.

Could a recent MS security patch be causing this?

Maybe I'll try the latest AutoIt beta. :)

Link to comment
Share on other sites

I'm having the same issue. If I run it directly from the .au3 file it works fine, but if I execute the the compiled exe I gte the "unknown function" error on "line -1". If I comment out the RunAsSet the script works okay.

I'm using Autoit v3.2.10 on Windows XP SP2. My machine doesn't have the RunAs service, but it has the Secondary Login service, which is running. I'm logged in with a domain regular user account, trying to execute something with a different domain user account. The reason is I need to copy files from a network share that the second domain user account can access. But what I'm attempting to do with the account doesn't seem to matter, as "unknown function name" seems to point to an error in the compiled exe.

Could a recent MS security patch be causing this?

Maybe I'll try the latest AutoIt beta. :)

You should now that RunAs has been completely rewritten for the betas/3.2.12.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...