WindowsSecurityContext Class | Apache log4net™ SDK Documentation

Impersonate a Windows Account
Inheritance Hierarchy

System
Object
log4net.Core
SecurityContext
log4net.Util
WindowsSecurityContext

Namespace: log4net.Util
Assembly: log4net (in log4net.dll) Version: 2.0.8.0-.NET 4.0
Syntax

C#
VB
C++
F#
Copy

    public class WindowsSecurityContext : SecurityContext,
    	IOptionHandler

    Public Class WindowsSecurityContext
    	Inherits SecurityContext
    	Implements IOptionHandler

    public ref class WindowsSecurityContext : public SecurityContext,
    	IOptionHandler

    type WindowsSecurityContext =
        class
            inherit SecurityContext
            interface IOptionHandler
        end

The WindowsSecurityContext type exposes the following members.

Constructors

| Name | Description
--- | --- | ---
| WindowsSecurityContext | Default constructor

Top
Properties

| Name | Description
--- | --- | ---
| Credentials | Gets or sets the impersonation mode for this security context
| DomainName | Gets or sets the Windows domain name for this security context
| Password | Sets the password for the Windows account specified by the UserName and DomainName properties.
| UserName | Gets or sets the Windows username for this security context

Top
Methods

| Name | Description
--- | --- | ---
| ActivateOptions | Initialize the SecurityContext based on the options set.
| Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
| Finalize | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
| GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
| GetType | Gets the Type of the current instance. (Inherited from Object.)
| Impersonate | Impersonate the Windows account specified by the UserName and DomainName properties. (Overrides SecurityContext Impersonate(Object).)
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.)
| ToString | Returns a String that represents the current Object. (Inherited from Object.)

Top
Remarks

This SecurityContext impersonates a Windows account.

How the impersonation is done depends on the value of Impersonate(Object). This allows the context to either impersonate a set of user credentials specified using username, domain name and password or to revert to the process credentials.

See Also

#### Reference

log4net.Util Namespace