ANAVEM
Languagefr
Network operations center with Windows Event Viewer displaying security authentication logs
Event ID 5142InformationMicrosoft-Windows-Security-AuditingWindows

Windows Event ID 5142 – Microsoft-Windows-Security-Auditing: Network Policy Server Granted User Access

Event ID 5142 logs when Network Policy Server (NPS) grants network access to a user after successful authentication and authorization through RADIUS policies.

Emanuel DE ALMEIDAEmanuel DE ALMEIDA
18 March 20269 min read 1
Event ID 5142Microsoft-Windows-Security-Auditing 5 methods 9 min
Event Reference

What This Event Means

Event ID 5142 represents a successful network access authorization event generated by the Network Policy Server role in Windows Server. When NPS receives a RADIUS Access-Request from a network access server (like a wireless access point, VPN server, or switch), it evaluates the request against configured connection request policies and network policies.

The event contains detailed information about the authentication session, including the user account, client machine, authentication method (such as PEAP-MS-CHAPv2, EAP-TLS, or PAP), and the network policy that granted access. This information proves invaluable for security auditing, troubleshooting authentication issues, and ensuring compliance with organizational access policies.

NPS logs this event after successful policy evaluation, meaning the user met all conditions specified in the matching network policy. The event includes session identifiers that correlate with other network infrastructure logs, enabling comprehensive analysis of user network access patterns. In 2026 environments, this event is particularly important for Zero Trust network architectures where every access request requires verification.

Applies to

Windows Server 2019Windows Server 2022Windows Server 2025
Analysis

Possible Causes

  • User successfully authenticates through 802.1X wireless network access
  • VPN client establishes connection through NPS RADIUS authentication
  • Dial-up or broadband connection authenticated via NPS policies
  • Network Access Protection (NAP) client granted access after health validation
  • Switch or access point forwards successful RADIUS authentication to NPS
  • DirectAccess client authentication processed through NPS
  • Web Application Proxy authentication delegated to NPS
Resolution Methods

Troubleshooting Steps

01

Review Event Details in Event Viewer

Start by examining the complete event details to understand the authentication context:

  1. Open Event ViewerWindows LogsSecurity
  2. Filter for Event ID 5142 using the filter option
  3. Double-click a recent Event ID 5142 entry
  4. Review key fields in the event details:
    • Subject: The user account that was granted access
    • Client Machine: Source computer or device
    • Authentication Provider: Method used (Windows, RADIUS proxy)
    • Authentication Server: NPS server processing the request
    • Authentication Type: Protocol used (PEAP, EAP-TLS, PAP, etc.)
    • Network Policy Name: Policy that granted access
  5. Note the Calling Station ID and NAS Identifier to identify the access point or switch

Use PowerShell to query multiple events efficiently:

Get-WinEvent -FilterHashtable @{LogName='Security'; Id=5142} -MaxEvents 50 | Select-Object TimeCreated, Id, @{Name='User';Expression={($_.Properties[0].Value)}}, @{Name='ClientMachine';Expression={($_.Properties[4].Value)}}
02

Analyze Authentication Patterns with PowerShell

Use PowerShell to identify authentication trends and potential security concerns:

  1. Extract authentication data for analysis:
    $Events = Get-WinEvent -FilterHashtable @{LogName='Security'; Id=5142; StartTime=(Get-Date).AddDays(-7)}
    $AuthData = $Events | ForEach-Object {
        [PSCustomObject]@{
            Time = $_.TimeCreated
            User = $_.Properties[0].Value
            ClientMachine = $_.Properties[4].Value
            AuthType = $_.Properties[10].Value
            NetworkPolicy = $_.Properties[11].Value
            CallingStationId = $_.Properties[5].Value
        }
    }
  2. Group authentications by user to identify patterns:
    $AuthData | Group-Object User | Sort-Object Count -Descending | Select-Object Name, Count
  3. Identify authentication methods in use:
    $AuthData | Group-Object AuthType | Sort-Object Count -Descending
  4. Check for unusual authentication times or locations:
    $AuthData | Where-Object {$_.Time.Hour -lt 6 -or $_.Time.Hour -gt 22} | Format-Table Time, User, ClientMachine
Pro tip: Export results to CSV for further analysis in Excel or import into SIEM systems for correlation with other security events.
03

Correlate with NPS Configuration and Policies

Verify that successful authentications align with intended network policies:

  1. Open Network Policy Server console from Administrative Tools
  2. Navigate to PoliciesNetwork Policies
  3. Review the network policy mentioned in Event ID 5142
  4. Check policy conditions and constraints:
    • User/Group membership requirements
    • Authentication method restrictions
    • Time-of-day limitations
    • Calling station ID filters
  5. Verify RADIUS client configuration under RADIUS Clients and Servers
  6. Use PowerShell to export NPS configuration for documentation:
    Export-NpsConfiguration -Path "C:\NPSBackup\NPS-Config-$(Get-Date -Format 'yyyy-MM-dd').xml"
  7. Review connection request policies that may affect authentication flow
  8. Check accounting settings to ensure proper logging is enabled
Warning: Changes to NPS policies affect all network access immediately. Test policy modifications in a lab environment first.
04

Cross-Reference with Network Infrastructure Logs

Correlate NPS events with network device logs for complete authentication visibility:

  1. Identify the network access server from the NAS-Identifier field in Event ID 5142
  2. Access logs on the corresponding network device (wireless controller, switch, VPN server)
  3. Match timestamps and session identifiers between NPS and network device logs
  4. Use PowerShell to create correlation reports:
    $NPSEvents = Get-WinEvent -FilterHashtable @{LogName='Security'; Id=5142; StartTime=(Get-Date).AddHours(-1)}
    $CorrelationData = $NPSEvents | ForEach-Object {
        $EventXML = [xml]$_.ToXml()
        [PSCustomObject]@{
            NPSTime = $_.TimeCreated
            SessionId = $EventXML.Event.EventData.Data | Where-Object {$_.Name -eq 'AcctSessionId'} | Select-Object -ExpandProperty '#text'
            CallingStationId = $EventXML.Event.EventData.Data | Where-Object {$_.Name -eq 'CallingStationId'} | Select-Object -ExpandProperty '#text'
            NASIdentifier = $EventXML.Event.EventData.Data | Where-Object {$_.Name -eq 'NASIdentifier'} | Select-Object -ExpandProperty '#text'
        }
    }
  5. Export correlation data for analysis:
    $CorrelationData | Export-Csv -Path "C:\Logs\NPS-Correlation-$(Get-Date -Format 'yyyy-MM-dd-HHmm').csv" -NoTypeInformation
  6. Review for authentication delays or failures not reflected in NPS logs
05

Implement Advanced Monitoring and Alerting

Set up proactive monitoring for authentication patterns and security anomalies:

  1. Create custom Event Viewer views for NPS authentication monitoring:
    • Right-click Custom Views in Event Viewer
    • Select Create Custom View
    • Filter for Event IDs 5140, 5141, 5142 from Security log
    • Save as "NPS Authentication Events"
  2. Configure Windows Event Forwarding for centralized logging:
    wecutil cs "C:\Config\NPSSubscription.xml"
  3. Set up PowerShell scheduled tasks for automated analysis:
    $Action = New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "-File C:\Scripts\NPS-Analysis.ps1"
    $Trigger = New-ScheduledTaskTrigger -Daily -At "06:00AM"
    $Settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries
    Register-ScheduledTask -TaskName "NPS Daily Analysis" -Action $Action -Trigger $Trigger -Settings $Settings
  4. Integrate with SIEM solutions using Windows Event Forwarding or log shipping
  5. Create baseline authentication patterns and alert on deviations
  6. Monitor for authentication attempts from unusual locations or times
Pro tip: Use Azure Sentinel or Microsoft Defender for Identity to leverage machine learning for authentication anomaly detection in hybrid environments.

Overview

Event ID 5142 fires when Microsoft Network Policy Server (NPS) successfully grants network access to a user or computer account. This event appears in the Security log whenever NPS processes a RADIUS Access-Request and responds with an Access-Accept message. The event captures critical authentication details including the requesting client, authentication method, and applied network policies.

NPS generates this event during successful 802.1X wireless authentications, VPN connections, dial-up access, and network access control scenarios. The event provides audit trail information for compliance requirements and helps administrators track successful network access attempts across their infrastructure.

You'll find Event ID 5142 in environments running NPS as a RADIUS server, typically in enterprise networks with centralized authentication. The event complements other NPS-related events like 5140 (network access denied) and 5141 (network access rejected), providing complete visibility into network access decisions.

Frequently Asked Questions

What does Event ID 5142 mean and when does it occur?+
Event ID 5142 indicates that Network Policy Server (NPS) successfully granted network access to a user or computer. It occurs when NPS processes a RADIUS Access-Request and determines that the requesting entity meets all conditions specified in the matching network policy. This event fires for successful 802.1X wireless authentications, VPN connections, dial-up access, and other network access scenarios managed by NPS. The event provides an audit trail of successful network access grants and includes details about the user, authentication method, and applied policy.
How can I identify which network policy granted access in Event ID 5142?+
The network policy name appears in the event details under the 'Network Policy Name' field. To view this information, open the event in Event Viewer and look for the policy name in the event data. You can also use PowerShell to extract this information: Get-WinEvent -FilterHashtable @{LogName='Security'; Id=5142} | ForEach-Object {($_.Properties[11].Value)}. Once you identify the policy name, you can review its configuration in the Network Policy Server console under Policies → Network Policies to understand what conditions were met for access to be granted.
Why am I seeing Event ID 5142 for the same user multiple times?+
Multiple Event ID 5142 entries for the same user are normal and expected behavior. Each event represents a separate authentication session or reauthentication attempt. Common causes include: 802.1X reauthentication intervals (typically every 8 hours), roaming between wireless access points, VPN reconnections, network interruptions requiring reauthentication, or multiple simultaneous connections from different devices. The frequency depends on your network policy settings, particularly the session timeout and reauthentication intervals configured in your network policies and on network infrastructure devices.
How do I correlate Event ID 5142 with failed authentication attempts?+
To get a complete authentication picture, monitor Event IDs 5140 (network access denied) and 5141 (network access rejected) alongside 5142. Use PowerShell to query all three events: Get-WinEvent -FilterHashtable @{LogName='Security'; Id=5140,5141,5142; StartTime=(Get-Date).AddDays(-1)} | Sort-Object TimeCreated. Look for patterns where failed attempts (5140/5141) precede successful ones (5142) for the same user, which might indicate password issues, policy misconfigurations, or potential brute force attempts. The Calling Station ID and NAS Identifier fields help correlate events from the same source device or location.
Can Event ID 5142 help with compliance and security auditing?+
Yes, Event ID 5142 is crucial for compliance and security auditing. It provides detailed logs of successful network access including user identity, authentication method, time stamps, source device information, and applied policies. This data supports compliance requirements for standards like PCI DSS, HIPAA, and SOX that require access logging and monitoring. For security auditing, analyze these events to establish baseline authentication patterns, identify unusual access times or locations, verify that only authorized authentication methods are being used, and ensure network policies are functioning as intended. Export the data to CSV or integrate with SIEM systems for comprehensive security analysis and reporting.
Documentation

References (2)

Emanuel DE ALMEIDA
Written by

Emanuel DE ALMEIDA

Senior IT Journalist & Cloud Architect

Microsoft MCSA-certified Cloud Architect | Fortinet-focused. I modernize cloud, hybrid & on-prem infrastructure for reliability, security, performance and cost control - sharing field-tested ops & troubleshooting.

Discussion

Share your thoughts and insights

You must be logged in to comment.

Loading comments...