You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.
As we still have some older servers with adfs 2.0, the log for those is not "AD FS/Admin" and "AD FS Tracing/Debug" but "AD FS 2.0/Admin" and "AD FS 2.0 Tracing/Debug"
I was not able to list those logs using Get-EventLog so I was checking for existence via
@rattuscz, thanks for catching this, this is a great find.
I think probably the best way would be to list the providers that match 'AD FS', and then get the log link from what gets returned. That should work for both modern AD FS and 2.0
PS C:\> Get-WinEvent -ListProvider '*AD FS*'
Name : AD FS Auditing
LogLinks : {Security}
Opcodes : {}
Tasks : {}
Name : AD FS Tracing
LogLinks : {AD FS Tracing/Debug}
Opcodes : {}
Tasks : {}
Name : AD FS
LogLinks : {AD FS/Admin}
Opcodes : {}
Tasks : {}
It might make sense to change the $script log constant to be an array of known strings for each log, and then check the output of -ListProvider against that list, that way you don't accidentally grab the wrong log on a machine that happens to have a log that contains "AD FS". The list of known strings would then contain both the current string const, and the 2.0 versions.
As we still have some older servers with adfs 2.0, the log for those is not
"AD FS/Admin"
and"AD FS Tracing/Debug"
but"AD FS 2.0/Admin"
and"AD FS 2.0 Tracing/Debug"
I was not able to list those logs using
Get-EventLog
so I was checking for existence viaNot sure this is correct practice, or how it should be correctly handled.
I can make PR for 2.0 support but need a guidance how to correctly check it :-)
The text was updated successfully, but these errors were encountered: