To change the security context within your script, you can use the LogonUser method. LogonUser allows you to change the user context of the script, perform some privileged actions, and then return to the previous security context within the script, using the RevertToSelf method.
LogonUser has advantages over other methods of changing the security context, such as using Basic or Window Integrated authentication, because both of these methods can only be used on the virtual directory or page level, while LogonUser can be used to execute just a few lines of code as the priviledged user.
For more information regarding LogonUser, please see the LogonUser Method documentation. |