Logging file access windows

Get Started with User Access Logging

Applies To: Windows Server (Semi-Annual Channel), Windows Server 2016, Windows Server 2012 R2, Windows Server 2012

User Access Logging (UAL) is feature in Windows Server that aggregates client usage data by role and products on a local server. It helps Windows server administrators quantify requests from client computers for roles and services on a local server.

UAL is installed and enabled by default, and collects data in nearly real-time. No administrator configuration is required, although UAL can be disabled or enabled. For more information, see Manage User Access Logging. The User Access Logging service aggregates client usage data by roles and products into local database files. IT administrators can later use Windows Management Instrumentation (WMI) or Windows PowerShell cmdlets to retrieve quantities and instances by server role (or software product), by user, by device, by the local server, and by date.

Practical applications

UAL aggregates unique client device and user request events that are logged into a local database. These records are then made available (through a query by a server administrator) to retrieve quantities and instances by server role, by user, by device, by the local server, and by date. In addition, UAL has been extended to enable non-Microsoft software developers to instrument their UAL events to be aggregated by Windows Server.

UAL can perform the following tasks:

Quantify client user requests for local physical or virtual servers.

Quantify client user requests for installed software products on a local physical or virtual server.

Retrieve data on a local server running Hyper-V to identify periods of high and low demand on a Hyper-V virtual computer.

Retrieve UAL data from multiple remote servers.

In addition, software developers can instrument UAL events that can then be aggregated and retrieved by using WMI and Windows PowerShell interfaces.

The following server roles and services can be supported by UAL:

Active Directory Certificate Services (ADВ CS)

Active Directory Rights Management Services (ADВ RMS)

Domain Name System (DNS)

UAL collects DNS data every 24 hours, and there is a separate UAL cmdlet for this scenario.

Dynamic Host Configuration Protocol (DHCP)

File Transfer Protocol (FTP) Server

UAL collects Hyper-V data every 24 hours, and there is a separate UAL cmdlet for this scenario.

To use UAL with IIS, you must use iisual.exe. For more information, see Analyzing Client Usage Data with IIS User Access Logging.

Microsoft Message Queue (MSMQ) Services

Network Policy and Access Services

Print and Document Services

Routing and Remote Access Service (RRAS)

Windows Deployment Services (WDS)

Windows Server Update Services (WSUS)

UAL is not recommended for use on servers that are connected directly to the Internet, such as web servers on an Internet-accessible address space, or in scenarios where extremely high performance is the primary function of the server (such as in HPC workload environments). UAL is primarily intended for small, medium, and enterprise intranet scenarios where high volume is expected, but not as high as deployments that serve Internet-facing traffic volume on a regular basis.

Important functionality

The following table describes key functions of UAL and their potential value.

Functionality Value
Collect and aggregate client request event data in near real-time. Up to three years of data can be saved. Important: Administrators need to enforce compliance of the data collected and data retention periods with the organization’s privacy policy and local regulations.
Query UAL by using WMI or Windows PowerShell interfaces to retrieve client request data on a local or remote server. UAL enables a single view of ongoing usage data. Server and enterprise administrators can retrieve this data and coordinate with business administrators to optimize use of their volume software licenses.
Enabled by default. Server administrators do not need to configure or otherwise set up this feature for all core functionality to be available and working.

Data logged with UAL

The following user-related data is logged with UAL.

Data Description
UserName The user name on the client that accompanies the UAL entries from installed roles and products, if applicable.
ActivityCount The number of times a particular user accessed a role or service.
FirstSeen The date and time when a user first accesses a role or service.
LastSeen The date and time when a user last accessed a role or service.
ProductName The name of the software parent product, such as Windows, that is providing UAL data.
RoleGUID The UAL assigned or registered GUID that represents the server role or installed product.
RoleName The name of the role, component, or subproduct that is providing UAL data. This is also associated with a ProductName and a RoleGUID.
TenantIdentifier A unique GUID for a tenant client of an installed role or product that accompanies the UAL data, if applicable.

The following device-related data is logged with UAL.

Data Description
IPAddress The IP address of a client device that is used to access a role or service.
ActivityCount The number of times a particular device accessed the role or service.
FirstSeen The date and time when an IP address was first used to access a role or service.
LastSeen The date and time when an IP address was last used to access a role or service.
ProductName The name of the software parent product, such as Windows, that is providing UAL data.
RoleGUID The UAL-assigned or registered GUID that represents the server role or installed product.
RoleName The name of the role, component, or subproduct that is providing UAL data. This is also associated with a ProductName and a RoleGUID.
TenantIdentifier A unique GUID for a tenant client of an installed role or product that accompanies the UAL data, if applicable.

Software requirements

UAL can be used on any computer running versions of Windows Server after Windows Server 2012.

Windows Setup Log Files and Event Logs

Windows® Setup creates log files for all actions that occur during installation. If you are experiencing problems installing Windows, consult the log files to troubleshoot the installation.

WindowsВ Setup log files are available in the following directories:

Log location before Setup can access the drive.

Log location when Setup rolls back in the event of a fatal error.

Log location of Setup actions after disk configuration.

Used to log Plug and Play device installations.

Location of memory dump from bug checks.

Location of log minidumps from bug checks.

Location of Sysprep logs.

WindowsВ Setup Event Logs

WindowsВ Setup includes the ability to review the WindowsВ Setup performance events in the Windows Event Log viewer. This enables you to more easily review the actions that occurred during WindowsВ Setup and to review the performance statistics for different parts of WindowsВ Setup. You can filter the log so as to view only relevant items that you are interested in. The WindowsВ Setup performance events are saved into a log file that is named Setup.etl, which is available in the %WINDIR%\Panther directory of all installations. To view the logs, you must use the Event Viewer included with the Windows media that corresponds to the version of the customized image that you are building.

To view the logs on a computer that does not include the corresponding kit, you must run a script from the root of the media that installs the Event Trace for Windows (ETW) provider. From the command line, type:

where D is the drive letter of the Windows DVD media.

To view the WindowsВ Setup event logs

Start the Event Viewer, expand the Windows Logs node, and then click System.

In the Actions pane, click Open Saved Log and then locate the Setup.etl file. By default, this file is available in the %WINDIR%\Panther directory.

The log file contents appear in the Event Viewer.

To Export the log to a file

From the command line, use the Wevtutil or Tracerpt commands to save the log to an .xml or text file. For information about how to use these tools, see the command-line Help. The following commands show examples of how to use the tools:

Manage User Access Logging

Applies To: Windows Server (Semi-Annual Channel), Windows Server 2016, Windows Server 2012 R2, Windows Server 2012

This document describes how to manage User Access Logging (UAL).

UAL is a feature that can help server administrators quantify the number of unique client requests of roles and services on a local server.

UAL is installed and enabled by default and collects data on a nearly real-time basis. There are only a few configuration options for UAL. This document describes these options and their intended purpose.

To learn more about the benefits of UAL, see the Get Started with User Access Logging.

In this document

The configuration options covered in this document include:

Disabling and enabling the UAL service

Collecting and removing data

Deleting data logged by UAL

Managing UAL in high volume environments

Recovering from a corrupt state

Enable Work Folders usage license tracking

Disabling and enabling the UAL service

UAL is enabled and runs by default when a computer running Windows Server 2012, or later, is installed and started for the first time. Administrators may want to turn off and disable UAL to comply with privacy requirements or other operational needs. You can turn off UAL using the Services console, from the command line, or by using PowerShell cmdlets. However, to ensure that UAL does not run again the next time the computer is started, you also need to disable the service. The following procedures describes how to turn off and disable UAL.

You can use the Get-Service UALSVC PowerShell cmdlet to retrieve information about the UAL Service including whether it is running or stopped and whether it is enabled or disabled.

To stop and disable the UAL service by using the Services console

Sign in to the server with an account that has local administrator privileges.

In Server Manager, point to Tools, and then click Services.

Scroll down and select User Access Logging Service.Click Stop the service.

Right-click the service name and select Properties. On the General tab, change the Startup type to Disabled, and then click OK.

To stop and disable UAL from the command line

Sign in to the server with an account that has local administrator privileges.

Press the Windows logo + R, then type cmd to open a Command Prompt window.

If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Yes.

Type net stop ualsvc, and then press ENTER.

Type netsh ualsvc set opmode mode=disable, and then press ENTER.

The following Windows PowerShell cmdlet or cmdlets perform the same function as the preceding procedure. Enter each cmdlet on a single line, even though they may appear word-wrapped across several lines here because of formatting constraints.

You can also stop and disable UAL by using the Stop-service and Disable-Ual Windows PowerShell commands.

If at a later date you want to restart and re-enable UAL you can do so with the following procedures.

To start and enable the UAL service by using the Services console

Sign in to the server an account that has local administrator privileges.

In Server Manager, point to Tools, and then click Services.

Scroll down and select User Access Logging Service.Click Start the service.

Right-click the service name and select Properties. On the General tab, change the Startup type to Automatic, and then click OK.

To start and enable UAL from the command line

Sign in to the server with local administrator credentials.

Press the Windows logo + R, then type cmd to open a Command Prompt window.

If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Yes.

Type net start ualsvc, and then press ENTER.

Type netsh ualsvc set opmode mode=enable, and then press ENTER.

The following Windows PowerShell cmdlet or cmdlets perform the same function as the preceding procedure. Enter each cmdlet on a single line, even though they may appear word-wrapped across several lines here because of formatting constraints.

You can also start and reenable UAL by using the Start-service and Enable-Ual Windows PowerShell commands.

Collecting UAL data

In addition to the PowerShell cmdlets described in the previous section, 12 additional cmdlets can be used to collect UAL data:

Get-UalOverview: Provides UAL related details and history of installed products and roles.

Get-UalServerUser: Provides client user access data for the local or targeted server.

Get-UalServerDevice: Provides client device access data for the local or targeted server.

Get-UalUserAccess: Provides client user access data for each role or product installed on the local or targeted server.

Get-UalDeviceAccess: Provides client device access data for each role or product installed on the local or targeted server.

Get-UalDailyUserAccess: Provides client user access data for each day of the year.

Get-UalDailyDeviceAccess: Provides client device access data for each day of the year.

Get-UalDailyAccess: Provides both client device and user access data for each day of the year.

Get-UalHyperV: Provides virtual machine data relevant to the local or targeted server.

Get-UalDns: Provides DNS client specific data of the local or targeted DNS server.

Get-UalSystemId: Provides system specific data to uniquely identify the local or targeted server.

Get-UalSystemId is meant to provide a unique profile of a server for all other data from that server to be correlated with.В If a server experiences any change in the in one of the parameters of Get-UalSystemId a new profile is created.В Get-UalOverview is meant to provide the administrator with a list of roles installed and being used on the server.

Basic features of Print and Document Services and File Services are installed by default. Therefore administrators can expect to always see information on these displayed as if the full roles are installed.В Separate UAL cmdlets are included for Hyper-V and DNS because of the unique data that UAL collects for these server roles.

A typical use case scenario for UAL cmdlets would be for an administrator to query UAL for unique client accesses over the course of a date range.В This can be done in a variety of ways.В The following is a recommended method to query unique device accesses over a date range.

This will return a verbose listing of all unique client devices, by IP address, that have made requests of the server in that date range.

‘ActivityCount’ for each unique client is limited to 65,535 per day.В Also, calling into WMI from PowerShell is only required when you query by date.В All other UAL cmdlet parameters can be used within PS queries as expected, as in the following example:

UAL retains up to two years’ worth of history. To allow retrieval of UAL data by an administrator when the service is running, UAL makes a copy of the active database file, current.mdb, to a file named GUID.mdb every 24 hours for the WMI provider’s use.

On the first day of the year, UAL will create a new GUID.mdb. The old GUID.mdb is retained as an archive for the provider’s use. After two years, the original GUID.mdb will be overwritten.

The following procedure should be performed only by an advanced user and would commonly be used by a developer testing their own instrumentation of UAL application programming interfaces.

To adjust the default 24-hour interval to make data visible to the WMI provider

Sign in to the server with an account that has local administrator privileges.

Press the Windows logo + R, then type cmd to open a Command Prompt window.

Add the registry value: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\WMI\AutoLogger\Sum\PollingInterval (REG_DWORD).

Incorrectly editing the registry may severely damage your system. Before making changes to the registry, you should back up any valued data on your computer.

The following example shows how to add a two-minute interval (not recommended as a long term running state): REG ADD HKLM\System\CurrentControlSet\Control\WMI\AutoLogger\Sum /v PollingInterval /t REG_DWORD /d 120000 /F

Time values are in milliseconds. The minimum value is 60 seconds, the maximum is seven days, and the default is 24 hours.

Use the Services console to stop and restart the User Access Logging Service.

Deleting data logged by UAL

UAL is not intended to be a mission critical component. Its design is intended to impact local system operations as little as possible while maintaining a high level of reliability. This also allows the administrator to manually delete UAL database and supporting files (every file in \Windows\System32\LogFiles\SUM\ directory) to meet operational needs.

To delete data logged by UAL

Stop the User Access Logging Service.

Open Windows Explorer.

Go to \Windows\System32\Logfiles\SUM\.

Delete all files in the folder.

Managing UAL in high volume environments

This section describes what an administrator can expect when UAL is used on a server with high client volume:

The maximum number of accesses that can be recorded with UAL is 65,535 per day.В UAL is not recommended for use on servers that are connected directly to the Internet, such as web servers that are connected directly to the Internet, or in scenarios where extremely high performance is the primary function of the server (such as in HPC workload environments). UAL is primarily intended for small, medium, and enterprise intranet scenarios where high volume is expected, but not as high as many deployment that serve Internet-facing traffic volume on a regular basis.

UAL in Memory: Because UAL uses the Extensible Storage Engine (ESE), UAL’s memory requirements will increase over time (or by quantity of client requests). But memory will be relinquished as the system requires it to minimize impact on system performance.

UAL on Disk: UAL’s hard disk requirements are approximately as shown below:

0 unique client records: 22M

50,000 unique client records: 80 M

500,000 unique client records: 384M

1,000,000 unique client records: 729M

Recovering from a corrupt state

This section discusses UAL’s use of the Extensible Storage Engine (ESE) at a high level and what an administrator can do if UAL data is corrupted or unrecoverable.

UAL uses ESE to optimize use of system resources and for its resistance to corruption. For more information about the benefits of ESE, see Extensible Storage Engine on MSDN.

Each time the UAL service starts ESE performs a soft recovery. For more information, see Extensible Storage Engine Files on MSDN.

If there is a problem with the soft recovery, ESE will perform a crash recovery. For more information, see JetInit Function on MSDN.

If UAL is still unable to start with the existing set of ESE files, it will delete all files in the \Windows\System32\LogFiles\SUM\ directory. After these files are deleted, the User Access Logging Service will restart and new files are created. The UAL service will then resume as if on a freshly installed computer.

The files in UAL database directory should never be moved or modified. Doing so will initiate the recovery steps, including the cleanup routine described in this section. If backups of the\Windows\System32\LogFiles\SUM\ directory are needed, then every file in this directory must be backed up together in order for a restore operation to function as expected.

Enable Work Folders usage license tracking

Work Folders server can use UAL to report client usage. Unlike UAL, Work Folder logging is not turned on by default. You can enable it with the following regkey change:

After the regkey is added, you must restart the SyncShareSvc service on the server, to enable logging.

After logging is enabled, 2 informational events get logged to the Windows Logs\Application channel each time a client connects to the server. For Work Folders, each user may have one or more client devices that connect to the server and check for data updates every 10 minutes. If the server is experiencing 1000 users, each with 2 devices the application logs will overwrite every 70 minutes, making troubleshooting unrelated issues difficult. To avoid this, you can disable the User Access Logging service temporarily, or increase the size of the server’s Windows Logs\Application channel.

Читайте также:  При изменении path windows
Оцените статью
Log file location Description