Sign in to follow this  
Followers 0
jonabyte

RunAsSet

8 posts in this topic

Hello,

I am using the following script with no luck

; Set the RunAs parameters to use local adminstrator account
RunAsSet("Administrator", @ComputerName, "password")

; Run registry editor as admin
RunWait("wscript.exe ""\\server\company\server.vbs")

; Reset user's permissions
RunAsSet()

This script is called from their loginscript, the autoit exe and vbs script are located in the same folder. I have checked the username and password over and over but I get an error stating that "the username couild not be found or bad password". Any ideas, this script is from the help file.

Thanks

Share this post


Link to post
Share on other sites



Hello,

I am using the following script with no luck

; Set the RunAs parameters to use local adminstrator account
RunAsSet("Administrator", @ComputerName, "password")

; Run registry editor as admin
RunWait("wscript.exe ""\\server\company\server.vbs")

; Reset user's permissions
RunAsSet()

This script is called from their loginscript, the autoit exe and vbs script are located in the same folder. I have checked the username and password over and over but I get an error stating that "the username couild not be found or bad password". Any ideas, this script is from the help file.

Thanks

Should this line

RunWait("wscript.exe ""\\server\company\server.vbs")

Not be

RunWait("wscript.exe " & "\\server\company\server.vbs")


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

That did not fix the error message, thanks anyways. But I remember now that the error message stated; "Logon Failure: the username could not be found or bad password".

Should this line

RunWait("wscript.exe ""\\server\company\server.vbs")

Not be

RunWait("wscript.exe " & "\\server\company\server.vbs")

Share this post


Link to post
Share on other sites

That did not fix the error message, thanks anyways. But I remember now that the error message stated; "Logon Failure: the username could not be found or bad password".

even if it didn't fix the issue you're having NOW, his observation was correct and will help you avoid a different issue once you get this one fixed. one thing you can do, is have the data you're passing put into the clipboard, then do a manual "run as" and paste the values in. i bet you'll get the same error message. one thing that looks funny is that you're using a local administrator account to access a network share...

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

even if it didn't fix the issue you're having NOW, his observation was correct and will help you avoid a different issue once you get this one fixed. one thing you can do, is have the data you're passing put into the clipboard, then do a manual "run as" and paste the values in. i bet you'll get the same error message. one thing that looks funny is that you're using a local administrator account to access a network share...

yes I noticed that too, so I just changed the script to access the vbs script locally and had the same problem with the same error.

Share this post


Link to post
Share on other sites

yes I noticed that too, so I just changed the script to access the vbs script locally and had the same problem with the same error.

Well I believe I have solved this issue, I need to change the admin password on the local computer to the same as the one on the server. I am assuming because the script uses the user/pass from autoit to access the script AND the vbs script is accessing items from that server. Hope that makes sense.

Thanks

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

This works for me. I think your problem is that the RUNASSET user id that you're using doesn't have access to your VBS file. You shouldn't have to modify any local account passwords to get this working. I am assuming, of course that this is a windows domain and that the server is a member of such domain.

-Scott

Well I believe I have solved this issue, I need to change the admin password on the local computer to the same as the one on the server. I am assuming because the script uses the user/pass from autoit to access the script AND the vbs script is accessing items from that server. Hope that makes sense.

Thanks

Edited by objectivescott

Share this post


Link to post
Share on other sites

Well I believe I have solved this issue, I need to change the admin password on the local computer to the same as the one on the server. I am assuming because the script uses the user/pass from autoit to access the script AND the vbs script is accessing items from that server. Hope that makes sense.

Thanks

I had all sorts of problems with RunAsSet and invariably they were caused by me. If you have a script that runs locally that needs access to a server resource it will not function unless the account you use has access to that resource. I would recommend using a domain admin account or something along those lines. Basically you need an account that has admin rightson the local machine and the server you are trying to access from the vbs script.

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