Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
'IMPERSONATE' in a Login Script
Message
From
10/09/2002 16:34:31
Ian Matthews
Up & Running Technologies Inc
Chestermere, Alberta, Canada
 
 
To
All
General information
Forum:
Visual Basic
Category:
VBScript
Title:
'IMPERSONATE' in a Login Script
Miscellaneous
Thread ID:
00699045
Message ID:
00699045
Views:
78
Is there a script already written that will allow for activities to be processed under an Admin account?

I want to remove some icons added by SP3 for W2K from the ALL USERS profile and I thought the best way to handle that is via a logon script. About 80% of my users are RESTRICTED USERs and as such can not make changes to the ALL USERS profile.

Microsoft Direct Access support suggested the following .JS:

oShell = Wscript.CreateObject("WScript.Shell");
CmdResult = oShell.run("runas /user:username", "yourbatchtodelitemsfromALLUSERS", " ",2,false);
wscript.sleep 1000;
Shell.AppActivate "C:\WINNT\System32\runas.exe";
oShell.sendkeys "password~";
oShell = Nothing;

but I was unable to get it to work after many attempts and minor revisions. Some VB scripting buddies indicated that this .JS would not work in a logon script environment and they thought it was designed for a web page. They suggested using VBScript IMPERSONATE would be a better way to go but I have never written VBScript and I thought it likely already exists somewhere.

FYI, I used to write a fair amount of VFPro and .BAT scriping but do not know much about VBScript or JScript.

Any assistance would be greatly appreciated.

Ian Matthews
MCSE2001, IPD, BComm
Reply
Map
View

Click here to load this message in the networking platform