Así que uno de sus usuarios ha recibido un error de AD FS 2.0, y usted necesita determinar cuál es el problema. Por desgracia, a veces el mensaje de error no da muchas pistas, por ejemplo, la página web que se muestra a continuación.
Afortunadamente, AD FS le proporciona un número de referencia que normalmente corresponde a algunas entradas del registro de eventos. Si usted tiene uno de estos, usted puede encontrar la siguiente secuencia de comandos PowerShell y el archivo por lotes asociado lanzador útil para ayudar a encontrar la entrada real rápidamente.
Puede editar el script para añadir todos sus servidores AD FS o simplemente ejecutarlo en cada servidor AD FS.
Para ejecutarlo, basta con hacer doble clic en find-adfs-error.bat y, a continuación, escribir o pegar uno de los números de referencia de una página de error. Una vez que hayas encontrado la entrada exacta en el registro de sucesos, puede que te resulte útil mirar en el registro de sucesos para ver qué más estaba ocurriendo cerca del momento en que se produjo el error.
Aquí están los guiones. Échales un vistazo y puede que encuentres algunas técnicas útiles. Si las encuentras útiles, por favor deja un comentario. Si tienes preguntas, hazlas también, y si tienes sugerencias para mejorarlos, házmelas saber también.
Disfrútalo.
encontrar-error-adfs.ps1
$ADFSServers = @($env:computername) # Add your list of AD FS servers here (not proxies) to have this script search # all your servers. The names should be the hostnames of the AD FS servers not # the AD FS service name. # Then uncomment the line with your servers by removing the leading # # example: $ADFSServers = @("adfs01.example.com","adfs02.example.com") #$ADFSServers = @("","") Write-Host "Type or paste the reference number from an AD FS 2.0 error web page" Write-Host " this should be a string such as: 6906F0A7-BDF5-4EDB-B624-DE9CDAE7938F" $userinput = Read-Host "Reference Number" $CorrelationActivityID = $userinput.Trim() $FilterXPath = "*[System/Correlation[@ActivityID='{" + $CorrelationActivityID + "}']]" $LogName = "AD FS 2.0/Admin" $DebugLogName = "AD FS 2.0 Tracing/Debug" foreach ($ComputerName in $ADFSServers) { try { #this requires "-ErrorAction Stop" on the commands $ADFSevent = Get-WinEvent -ComputerName $ComputerName -LogName $LogName ` -FilterXPath $FilterXPath -ErrorAction Stop $ADFSevent | Format-list Id, MachineName, LogName, TimeCreated, Message } catch [Exception] { if ($_.Exception -match "No events were found that match the specified selection criteria") { # do nothing, it just means no events were found in this log } else { # Some other error happened so rethrow it so the user will see it Throw $_ } } try { #this requires "-ErrorAction Stop" on the commands # You need to specify -Oldest when looking in Analytical and Debug/Trace logs $ADFSevent = Get-WinEvent -ComputerName $ComputerName -Oldest -LogName $DebugLogName ` -FilterXPath $FilterXPath -ErrorAction Stop $ADFSevent | Format-list Id, MachineName, LogName, TimeCreated, Message } catch [Exception] { if ($_.Exception -match "No events were found that match the specified selection criteria") { # do nothing, it just means no events were found in this log } else { # Some other error happened so rethrow it so the user will see it Throw $_ } } }
Si quieres una manera fácil de lanzar el script PowerShell, prueba este archivo batch. Simplemente haga doble clic en él, y ya está.
encontrar-error-adfs.bat
powershell.exe -command ^ "& {set-executionpolicy Remotesigned -Scope Process; .'.\find-adfs-error.ps1' }" pause
Referencias:
Diagnóstico en AD FS 2.0
https://blogs.msdn.com/b/card/archive/2010/01/21/diagnostics-in-ad-fs-2-0.aspx
Configuración de ordenadores para la resolución de problemas de AD FS 2.0
https://technet.microsoft.com/en-us/library/adfs2-troubleshooting-configuring-computers%28WS.10%29.aspx
Para obtener más información sobre la política de ejecución de PowerShell y la firma de código o scripts firmados, abra PowerShell e introduzca la dirección command:
Obtener_ayuda_Sobre_Firma
Para que sea más fácil para la gente encontrar estos scripts, estoy incluyendo algunas palabras clave aquí que la gente podría haber estado buscando. Las palabras clave incluyen Active Directory Federation Services, ADFS, registro de eventos, eventid, visor de eventos, id de correlación o identificador de correlación. Se ha producido un problema al acceder al sitio. Intente acceder de nuevo al sitio. Si el problema persiste, póngase en contacto con el administrador de este sitio y facilite el número de referencia para identificar el problema. Número de referencia: