sfimpersonator doesn't work ?? 
Author Message
 sfimpersonator doesn't work ??

This is my script

an additon to the test.vbs file

my message boxes show me switching between users
but when regedit runs it doesn't appear to be under the admin account
since it is still locked out from some registry keys

(as a double check;  my imposter user - administrator in this case - does
have rights as needed to all keys if i use the mocrosoft runas utility)

here is the code  -PLEASE HELP

Option Explicit

'See the platform SDK for a description of these
Const LOGON_INTERACTIVE = 2
Const LOGON_NETWORK     = 3
Const LOGON_BATCH       = 4
Const LOGON_SERVICE     = 5

Dim oNet
Set oNet = CreateObject("Wscript.Network")
MsgBox oNet.UserDomain & "\" & oNet.UserName

Dim impo
Set impo = CreateObject("sfImpersonator.Impostor")

'The dot in the third parameter is the domain name - "." means local domain
impo.Impersonate  "Administrator", "password", ".", LOGON_INTERACTIVE
MsgBox oNet.UserDomain & "\" & oNet.UserName

Dim SH
Set SH = WScript.CreateObject("WScript.Shell")
SH.Run "regedit.exe", 1, True

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



Tue, 26 Apr 2005 21:47:16 GMT  
 sfimpersonator doesn't work ??

Quote:

> my message boxes show me switching between users
> but when regedit runs it doesn't appear to be under the admin account
> since it is still locked out from some registry keys

> (as a double check;  my imposter user - administrator in this case - does
> have rights as needed to all keys if i use the mocrosoft runas utility)

> here is the code  -PLEASE HELP

> (snip)
> Set impo = CreateObject("sfImpersonator.Impostor")

> 'The dot in the third parameter is the domain name - "." means local domain
> impo.Impersonate  "Administrator", "password", ".", LOGON_INTERACTIVE
> MsgBox oNet.UserDomain & "\" & oNet.UserName

Hi

Have you given the user that uses this DLL, the "Act as part of the operating
system" privilege?

It's not the user that you want _to_ impersonate -- it's the user that is
_doing_ the impersonation you need to give this right to. In other words, the
account that your script begins execution with must have the privilege.

--
torgeir
Microsoft MVP Scripting and WMI
Porsgrunn Norway



Wed, 27 Apr 2005 00:33:43 GMT  
 sfimpersonator doesn't work ??
Yes - I believe so

What I did is went into my Default Domain Policy - Computer Settings -
Windows Settings - Security Settings - Local Policies - User Rights

and Set it there for both the everyone group and the Domain Users group

Paul


Quote:

> > my message boxes show me switching between users
> > but when regedit runs it doesn't appear to be under the admin account
> > since it is still locked out from some registry keys

> > (as a double check;  my imposter user - administrator in this case -
does
> > have rights as needed to all keys if i use the mocrosoft runas utility)

> > here is the code  -PLEASE HELP

> > (snip)
> > Set impo = CreateObject("sfImpersonator.Impostor")

> > 'The dot in the third parameter is the domain name - "." means local
domain
> > impo.Impersonate  "Administrator", "password", ".", LOGON_INTERACTIVE
> > MsgBox oNet.UserDomain & "\" & oNet.UserName

> Hi

> Have you given the user that uses this DLL, the "Act as part of the
operating
> system" privilege?

> It's not the user that you want _to_ impersonate -- it's the user that is
> _doing_ the impersonation you need to give this right to. In other words,
the
> account that your script begins execution with must have the privilege.

> --
> torgeir
> Microsoft MVP Scripting and WMI
> Porsgrunn Norway



Wed, 27 Apr 2005 01:22:23 GMT  
 sfimpersonator doesn't work ??

Quote:



> > Have you given the user that uses this DLL, the "Act as part of the
> > operating system" privilege?

> > It's not the user that you want _to_ impersonate -- it's the user that is
> > _doing_ the impersonation you need to give this right to. In other words,
> > the account that your script begins execution with must have the privilege.

> Yes - I believe so

> What I did is went into my Default Domain Policy - Computer Settings -
> Windows Settings - Security Settings - Local Policies - User Rights

> and Set it there for both the everyone group and the Domain Users group

Try to set it directly on the user instead of the group and see if it helps.

--
torgeir
Microsoft MVP Scripting and WMI
Porsgrunn Norway



Wed, 27 Apr 2005 01:24:29 GMT  
 sfimpersonator doesn't work ??
Made that change No Luck --- any other ideas ?


Quote:



> > > Have you given the user that uses this DLL, the "Act as part of the
> > > operating system" privilege?

> > > It's not the user that you want _to_ impersonate -- it's the user that
is
> > > _doing_ the impersonation you need to give this right to. In other
words,
> > > the account that your script begins execution with must have the
privilege.

> > Yes - I believe so

> > What I did is went into my Default Domain Policy - Computer Settings -
> > Windows Settings - Security Settings - Local Policies - User Rights

> > and Set it there for both the everyone group and the Domain Users group

> Try to set it directly on the user instead of the group and see if it
helps.

> --
> torgeir
> Microsoft MVP Scripting and WMI
> Porsgrunn Norway



Wed, 27 Apr 2005 02:00:04 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Why LoadPicture() works on local pathes and doesn't work on the URLS

2. works / doesn't work, why?

3. 'history' command doesn't work

4. 2 apostrophe fix doesn't work for just 's

5. GetObject() in VBScript on web page doesn't work

6. Reset button doesn't work

7. Response.Buffer=false - still doesn't work

8. Why doesn't this work

9. HasAccess and directories doesn't work

10. Why doesn't it work?

11. Known bug in Ghostscript 5.02: %d in OutputFile doesn't work

12. My button doesn't work??

 

 
Powered by phpBB® Forum Software