Monir-SCS wrote:
> How can I execute a function using diffrent user (I have a user name and
> password), in NT, Win2000 or XP?

Call LogonUser to get an access token for the specified user. Then call 
ImpersonateLoggedOnUser to switch the current thread into that user's 
context. Execute your function. Finally, call RevertToSelf to get back 
into the original user's security context and dispose of the access 
token with CloseHandle.

You should be able to find example code if you search the newsgroup 
archives for those functions.

> In IIS, CGI is excuted using IUser_ComputerName, I need to execute a
> function inside this CGI application using different user, adminstrator for
> example.

Special privileges are needed to call LogonUser and 
impersonateLoggedOnUser. The IIS account might not have those privileges 
by default. I have no idea how to configure IIS or Windows to allow such 
privileges, if you find that you don't already have them.

-- 
Rob


-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to