Sign in to follow this  
Followers 0
LordVader

DriveMapAdd & Runasset Problem

4 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
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. :)

Share this post


Link to post
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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0