Defrag without admin rights + SFImpersonator 
Author Message
 Defrag without admin rights + SFImpersonator

I am trying to run defrag while logged in as a user (with no admin
I stumbled across this SFImpersonator DLL which I think may enable me
to do this from http://www.*-*-*.com/

When the "MsgBox oNet.UserDomain" line executes, it successfuly
displays my administrator account, however a command will
not execute an application with in the context of this administrator
account. In my test example below, notepad runs - yes, but it is
running under a user account rather than the administrator account.

I have copied the SFImpersonator file to the system32 folder and
registered the file.
I have modified group policy to allow all users to "Act as part of the
operating system". I have also tried the LOGON_NETWORK, LOGON_BATCH
and Const LOGON_SERVICE options.
I have tested all this on W2Kpro and WXPpro.

Any ideas?
Here is my VBS code:

Option Explicit

Const LOGON_NETWORK     = 3
Const LOGON_BATCH       = 4
Const LOGON_SERVICE     = 5

Dim CmdLine, WshShell
Dim oNet
Dim impo

Set oNet = CreateObject("Wscript.Network")
Set impo = CreateObject("sfImpersonator.Impostor")
Set WshShell = CreateObject("WScript.Shell")

impo.Impersonate  "Administrator", "Password", ".", LOGON_INTERACTIVE

MsgBox oNet.UserDomain & "\" & oNet.UserName

'   CmdLine = "c:\windows\system32\mmc.exe
   CmdLine = "c:\windows\system32\notepad.exe"
   WshShell.Run CmdLine, 1, TRUE

MsgBox oNet.UserDomain & "\" & oNet.UserName


Mon, 14 Feb 2005 18:18:19 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Windows 2000 defrag without sendkeys

2. Finding out if user has NT Admin rights

3. Verify NT domain Admin right

4. Script with admin rights

5. Running a vb script with admin rights

6. Admin rights

7. Unable to register OCX in 2000 users with no admin rights

8. need admin rights to add controls

9. Admin help with regular user rights...

10. Temporary grant Admin rights in prog.

11. Grant Admin Rights to an Application?

12. Determine Local Admin rights ?


Powered by phpBB® Forum Software