Run as.... troubles.

Status
Not open for further replies.

scj6771

Baseband Member
Messages
77
I would like to be able to do a "Run as" to configure any network connections on any given WinXP Pro machine, obviously no "Run as" option is given when you right click that icon in your control panel, I have tried several options like running "runas /user:administrator control.exe" from the command prompt logged on as a user with a restricted account but that does not seem to work, even if I right click on the ncpa found within the System32 folder and specify the admin username and password still I cant configure these options without having Admin rights, and yes the secondary logon is started. Any suggestions on how to configure network connections without logging on as an admin?? Thanks.
 
As far as i know cant do it. Must have Admin privledges to do all that.
 
This is somethign that I can help you with...
I have been working on RUNas for a while now. There is a Tool called CPAU.exe which you can find on www.joeware.net. hes a MS developer that is creating very nice tools for sysadmins. Then you need to learn about Rundll32.exe.
Here is a link for you:
http://www.dx21.com/SCRIPTING/RUNDLL32/REFGUIDE.ASP?ISF=0&P=A
Now, all you need to do is create a job file from CPAU like this...

cpau.exe -u Domain\Username -p Password -ex "RunDLL32.EXE shell32.dll,Control_RunDLL ncpa.cpl" -enc -file "Filename.job"

This will create a job file that will run the Network Properties dialog under the specified user account. To use is, simply type this:
cpau.exe -dec -file Filename.job /profile

if you leave off /profile, the program uses the logged on user credentials. so if you want it to use the admin account, always use /profile.

Hope that helps.
Edit:
well since I don't like to leave things undone, I checked this out. Seems that you need to do a little more than just a rundll call. Not sure why, but I think it's the Shell32.dll, you can't call this function in RUNAS. well that menas you have to load something to view it. Iexplore.exe works. If you run iexplore.exe and then type control panel on the address line, that will open the control panel as the account you are using. Then you can launch the Network properties from there as your self. Also, you can do this wil CMD.exe
 
Status
Not open for further replies.
Back
Top Bottom