Login | |
|
 |
RE: How can I get a script to run under a local admin c... - 5/5/2008 2:58:10 AM
|
|
 |
|
| |
ginolard
Posts: 1005
Score: 21
Joined: 8/10/2005
Status: offline
|
Off the top of my head I would say create a separate script to do it and then, using your logoff script, create a Scheduled Task using SCHTASKS.EXE to delete the profile. I say SCHTASKS because it has the /RUN switch to execute immediately and the /RU switch to run the task under a different account (e.g. SYSTEM)
_____________________________
Author of ManagePC - http://managepc.net AD Query Template - http://www.visualbasicscript.com/m_40609/tm.htm Consolidated Scripting Framework - http://www.visualbasicscript.com/m_59109/tm.htm
|
|
| |
|
|
|
 |
RE: How can I get a script to run under a local admin c... - 5/5/2008 7:12:52 AM
|
|
 |
|
| |
dm_4ever
Posts: 2174
Score: 32
Joined: 6/29/2006
From: Orange County, California
Status: offline
|
What if you make it part of the machine's logoff....if I am not mistaken, this will run under "System" which should have more than enough rights.
_____________________________
dm_4ever My philosophy: K.I.S.S - Keep It Simple Stupid Read Me: http://www.visualbasicscript.com/m_24727/tm.htm Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
 |
RE: How can I get a script to run under a local admin c... - 5/5/2008 10:48:46 PM
|
|
 |
|
| |
mbouchard
Posts: 1804
Score: 12
Joined: 5/15/2003
From: USA
Status: online
|
Why not set the PC up to use default profiles? That way everyone uses the same profile and you won't have to to worry about deleting extra ones.
_____________________________
Mike For useful Scripting links see the Read Me First stickey! Always remember Search is your friend.
|
|
| |
|
|
|
 |
RE: How can I get a script to run under a local admin c... - 5/6/2008 11:03:06 PM
|
|
 |
|
| |
Rischip
Posts: 379
Score: 2
Joined: 3/26/2007
Status: offline
|
I would look up instsrv and srvany. Verify that you have a working script that will delete profiles when logged in under the admin account. Then install it as a service running under cscript. Have the script look for active "Explorer" processes. If none exist then go through the delprof routine. You cannot delete a profile you are logged into. Therefore you cannot run this as a logoff script. However as mentioned it would work as a machine shutdown/startup script. If I had to choose between those two locations I would choose startup. At shutdown there could be issues with profiles that still have hives loaded, although I believe delprof accounts for that. Scheduled Tasks would also work, but when do you schedule it? If a user is logged in the script would have to account for that and avoid deleteing the in use profile.
_____________________________
Rischip Author of - The Grim Linker
|
|
| |
|
|
|
| |
|
|
 |
|
 |
|
|