-
Notifications
You must be signed in to change notification settings - Fork 1.4k
ImpersonatingWrapper target
Impersonates another user for the duration of the write (Ex. give access-permission to file-target)
Platforms Supported: Limited - Windows only and requires nuget-package NLog.WindowsIdentity with NLog 5.0
<targets>
<target xsi:type="ImpersonatingWrapper"
name="String"
userName="Layout"
password="Layout"
domain="Layout"
revertToSelf="Boolean"
impersonationLevel="Enum"
logOnType="Enum"
logOnProvider="Enum">
<target xsi:type="wrappedTargetType" ...target properties... />
</target>
</targets>
- name - Name of the target.
-
userName - Username to change context to.
NLog.WindowsIdentity v5.3 changed data-type from
String
to Layout -
password - User account password.
NLog.WindowsIdentity v5.3 changed data-type from
String
to Layout -
domain - Windows domain name for user account. Default:
.
NLog.WindowsIdentity v5.3 changed data-type from
String
to Layout -
revertToSelf - Indicates whether to revert to the credentials of the process instead of impersonating another user. Boolean Default: False
-
impersonationLevel - Required impersonation level.
Possible values:- Anonymous - Anonymous Level.
- Delegation - Delegation Level.
- Identification - Identification Level.
- Impersonation - Impersonation Level.
-
logOnType - Logon Type.
Possible values:- Batch - Batch Logon.
- Interactive - Interactive Logon.
- Network - Network Logon.
- NetworkClearText - Network Clear Text Logon.
- NewCredentials - New Network Credentials.
- Service - Logon as a Service.
-
logOnProvider - Type of the logon provider.
Possible values:- Default - Use the standard logon provider for the system.
- Troubleshooting Guide - See available NLog Targets and Layouts: https://nlog-project.org/config
- Getting started
- How to use structured logging
- Troubleshooting
- FAQ
-
All targets, layouts and layout renderers
Popular: - Using NLog with NLog.config
- Using NLog with appsettings.json