<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Azure AD Customer Experience Engineering Team</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/aadceeteam/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/aadceeteam/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:20:24 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Under the hood tour of Azure AD Connect Health: AD FS Diagnostics Module</title>
      <link>https://docs.microsoft.com/archive/blogs/aadceeteam/under-the-hood-tour-of-azure-ad-connect-health-ad-fs-diagnostics-module</link>
      <pubDate>Fri, 13 Feb 2015 13:47:06 GMT</pubDate>
      <dc:creator><![CDATA[Ramiro Calderon - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/aadceeteam/2015/02/13/under-the-hood-tour-of-azure-ad-connect-health-ad-fs-diagnostics-module/</guid>
      <description><![CDATA[Hello there, my name is Ramiro Calderon, and I am an engineering manager in the Active Directory...]]></description>
      <content:encoded><![CDATA[<p>Hello there, my name is Ramiro Calderon, and I am an engineering manager in the Active Directory team. In this post, I want to walk you through the AD FS Diagnostics PowerShell module, which is deployed to the AD FS Servers as part of <a href="https://go.microsoft.com/fwlink/?LinkID=518643">Azure Active Directory Connect Health</a> agent.  This PowerShell module has cmdlets that are executed by the health agent on a regular basis and uploads the results to the cloud for visualization in the <a href="https://portal.azure.com/">Azure Portal</a> and alert generation.
</p><p>While this module is used by the Azure AD Connect Health Agent, we have also published a copy of it in the <a href="https://gallery.technet.microsoft.com/scriptcenter/AD-FS-Diagnostics-Module-8269de31">AD Script Center</a>.  This way if you are not using the Azure AD Connect Health service, you have a way to run this locally on your AD FS servers. 
</p><p>The module file name is <span style="color:#2e74b5;font-family:Consolas;">ADFSDiagnostics.psm1</span>, is located under &quot;%programfiles%\Microsoft AD Health Agent\Microsoft AD Diagnostics Service&quot;.  Note that it requires elevated access, and <a href="https://www.microsoft.com/en-us/download/details.aspx?id=40855">PowerShell 4.0</a> to run.  Below are the cmdlets available in the module:
</p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">PS C:\Program Files\Microsoft AD Health Agent\Microsoft AD Diagnostics Service&gt; Get-Command -Module ADFSDiagnostics
</span></p><p style="margin-left:21pt;">
 </p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">CommandType     Name                                               ModuleName
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">-----------     ----                                               ----------
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">Function        Get-AdfsServerConfiguration                        ADFSDiagnostics
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">Function        Get-AdfsServerTrace                                ADFSDiagnostics
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">Function        Get-AdfsSystemInformation                          ADFSDiagnostics
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">Function        Get-AdfsVersionEx                                  ADFSDiagnostics
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">Function        Receive-AdfsServerTrace                            ADFSDiagnostics
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">Function        Set-ADFSDiagTestMode                               ADFSDiagnostics
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">Function        Start-AdfsServerTrace                              ADFSDiagnostics
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">Function        Test-AdfsServerHealth                              ADFSDiagnostics
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">Function        Test-AdfsServerHealthSingleCheck                   ADFSDiagnostics
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">Function        Test-AdfsServerToken                               ADFSDiagnostics
</span></p><p>
 </p><p>Let&#39;s take a look at the most important usage scenarios for the module. If you want to learn more about a specific cmdlet, you can use the <span style="color:#2e74b5;font-family:Consolas;">Get-Help</span> cmdlet to see detailed description and examples.
</p><h1>Performing AD FS Server Health Checks
</h1><p>This is perhaps the most useful during troubleshooting. The <span style="color:#2e74b5;font-family:Consolas;">Test-ADFSServerHealth</span> cmdlet contains a series of health checks for the most common AD FS issues with configuration that we have observed over the years.  
</p><p>We have different kinds of checks:
</p><ul><li><strong>Configuration/Best practices:</strong> Examples include SPN, DNS configuration, service account properties, etc.  
</li><li><strong>Certificate Properties:</strong> For example, whether a certificate is about to expire, CRL failed, etc. You can also do inspection on the relying party trust and claims provider trust certificates by setting the parameter &quot;-VerifyTrustCerts&quot; to $true (it is $false by default).
</li><li><strong>Synthetic Checks:</strong> For example, retrieve federation metadata, and get a token from the STS). One thing worth mentioning here is that in order to have the synthetic transaction that gets a token from the STS using the actual server where the cmdlet is running, you should consider tweaking the host file to point to itself (either with IPv4 127.0.0.1 or IPv6 ::1) when resolving the AD FS host farm name. Otherwise, the synthetic transaction will go through the usual DNS resolution where another server will actually serve the request.
</li><li><strong>Office 365 Specific Checks:</strong> For example, verify that endpoints required for office 365 to work are enabled, Relying Party trusts are configured, etc.. You can skip the office 365 checks by setting the parameter &quot;-VerifyO365&quot; to false (it is true by default).
</li></ul><p>Each result has the following properties:
</p><ul><li><strong>Name:</strong> Name of the test being run
</li><li><strong>Result:</strong> This is the result of the test and can have a value of &#39;Pass&#39;, &#39;Fail&#39; and &#39;NotRun&#39;. A test might not run for a number of reasons such as OS version (IIS related checks only apply to  ADFS 2.x), or role (Some tests only apply to a primary node on a WID farm). 
</li><li><strong>Detail:</strong> Explanation of the &#39;Fail&#39; and &#39;NotRun&#39; result. It is typically empty when the check passes.
</li><li><strong>Output:</strong> Data collected for the specific test. It is a hashtable that contains a list of key value pairs with relevant data in the context of the test (for example, in the SPN test we add the service account name, the SPNs found in the service account, etc.,).
</li><li><strong>ExceptionMessage:</strong> If the test encountered an exception, this property contains the exception message.
</li></ul><p>See an example below.
</p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">Test-ADFSServerHealth | ft Name,Result -AutoSize
</span></p><p style="margin-left:21pt;">
 </p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">Name                                                             Result
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">----                                                             ------
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">IsAdfsRunning                                                      Pass
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">IsWidRunning                                                       Pass
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">PingFederationMetadata                                             Pass
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">CheckAdfsSslBindings                                               Pass
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">Test-Certificate-Service-Communications-Primary-NotFoundInStore    Pass
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">Test-Certificate-Service-Communications-Primary-IsSelfSigned       Pass
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">Test-Certificate-Service-Communications-Primary-PrivateKeyAbsent   Pass
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">…
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">Test-Certificate-SSL-Primary-AboutToExpire                         Pass
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">CheckFarmDNSHostResolution                                         Pass
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">CheckDuplicateSPN                                                  Pass
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">TestServiceAccountProperties                                       Pass
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">TestAppPoolIDMatchesServiceID                                      Pass
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">TestComputerNameEqFarmName                                         Pass
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">TestSSLUsingADFSPort                                               Pass
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">TestSSLCertSubjectContainsADFSFarmName                             Pass
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">TestAdfsAuditPolicyEnabled                                         Pass
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">TestAdfsRequestToken                                               Pass
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">CheckOffice365Endpoints                                            Pass
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">TestADFSO365RelyingParty                                           Pass
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">TestNtlmOnlySupportedClientAtProxyEnabled                          Pass
</span></p><p>
 </p><h1>Gathering deployment information
</h1><p>The <span style="color:#2e74b5;font-family:Consolas;">Get-AdfsSystemInformation</span> cmdlet gathers general information about the server (OS, hardware, hotfixes installed, etc.).  In the example below, I used a custom formatter so I can see some of the properties right out of the console output, which I find very useful when dealing with object in the pipeline that have complex data types:
</p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;"> Get-AdfsSystemInformation | fc -Depth 1
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">class PSCustomObject
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">{
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">  OSVersion =
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">    class Version
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">    {
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">      Major = 6
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">      Minor = 1
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">      Build = 7601
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">      Revision = 65536
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">      MajorRevision = 1
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">      MinorRevision = 0
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">    }
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">  OSName = Microsoft Windows Server 2008 R2 Datacenter
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">  MachineDomain = oneadhealthtest.com
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">  IPAddress = 10.0.0.9
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">  ..
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;"><span style="font-size:9pt;">}</span><span style="font-size:10pt;">
			</span></span></p><p>
 </p><p>Similarly, the <span style="color:#2e74b5;font-family:Consolas;">Get-ADFSServerConfiguration</span> cmdlet gets more detailed information for AD FS Farm (Certificates, endpoints, etc.): 
</p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">Get-AdfsServerConfiguration | fc –Depth 1
</span></p><p style="margin-left:21pt;">
 </p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">class PSCustomObject
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">{
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">  ADFSSyncProperties =
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">    class SyncPropertiesBase
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">    {
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">      Role = PrimaryComputer
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">    }
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">  ADFSAttributeStore =
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">    class AttributeStore
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">    {
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">…
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">    }
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">  ADFSCertificate =
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">    [
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">      @{Certificate=…
</span></p><p style="margin-left:21pt;">
 </p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">      ; CertificateType=Service-Communications; IsPrimary=True; StoreName=My; StoreLocation=LocalMachine;
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">      Thumbprint=4AF5D7FD8934C08D1CF7C3D9C8394EB586606AA5}
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">      @{Certificate=…
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">      ; CertificateType=Token-Decrypting; IsPrimary=True; StoreName=My; StoreLocation=LocalMachine;
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">      Thumbprint=4AF5D7FD8934C08D1CF7C3D9C8394EB586606AA5}
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">…
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">      AutoCertificateRollover = False
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">      CertificateCriticalThreshold = 2
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">      CertificateDuration = 365
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">      CertificateGenerationThreshold = 20
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">      CertificatePromotionThreshold = 5
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">      CertificateRolloverInterval = 720
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">      CertificateSharingContainer = CN=f056c184-835a-4fb8-9e0b-ebb421e8530f,CN=ADFS,CN=Microsoft,CN=Program
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">      Data,DC=oneadhealthtest,DC=com
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">      CertificateThresholdMultiplier = 1440
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">      ClientCertRevocationCheck = None
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">…
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">    }
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">  ADFSRelyingPartyTrustCount = 5
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">  ADFSClaimsProviderTrustCount = 1
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">..
</span></p><p style="margin-left:21pt;">
 </p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:9pt;">}
</span></p><p>
 </p><h1>Getting a token with specific credentials
</h1><p>We also added the cmdlet  <span style="color:#2e74b5;font-family:Consolas;">Test-ADFSServerToken</span>, which you can use to get a token against the federation service.  In the example below, we get a token against the &quot;<span style="color:#2e74b5;font-family:Consolas;">fs.contoso.com</span>&quot; AD FS farm, for the Relying Party identified by &quot;<span style="color:#2e74b5;font-family:Consolas;">urn:federation:MicrosoftOnline</span>&quot;, providing a credential for the user we want to get the token for:
</p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">Test-AdfsServerToken -federationServer fs.contoso.com -appliesTo urn:federation:MicrosoftOnline -credential (Get-Credential)
</span></p><p style="margin-left:36pt;">
 </p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">cmdlet Get-Credential at command pipeline position 1
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">Supply values for the following parameters:
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">Credential
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">&lt;s:Envelope xmlns:s=&quot;https://www.w3.org/2003/05/soap-envelope&quot; xmlns:a=&quot;https://www.w3.org/2005/08/addressing&quot; xmlns:u=&quot;h
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">ttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd&quot;&gt;…&lt;…&lt;/s:Envelope&gt;
</span></p><p>
 </p><p>Sometimes you may have a need to examine the contents of a token. For example, this could be to validate the issuance rules that you have configured for a specific relying party trust. You can use some PowerShell XML constructs to get the token as an object in the pipeline:
</p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">$token = Test-AdfsServerToken -federationServer localhost -appliesTo urn:federation:MicrosoftOnline -credential (Get-Credential)
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">$tokenXml = [Xml]$token
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">$tokenXml.Envelope.Body.RequestSecurityTokenResponse.RequestedSecurityToken.Assertion.AttributeStatement | fc -Depth 2
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">class 0:assertion#AttributeStatement
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">{
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">  Attribute =
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">    [
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">      class 0:assertion#Attribute
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">      {
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">        Name = https://schemas.microsoft.com/ws/2008/06/identity/claims/primarygroupsid
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">        AttributeValue = S-1-5-21-2474419537-1598421116-3968361607-513
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">      }
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">      class 0:assertion#Attribute
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">      {
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">        Name = https://schemas.microsoft.com/ws/2008/06/identity/claims/primarysid
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">        AttributeValue = S-1-5-21-2474419537-1598421116-3968361607-500
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">      }
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">…
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">     class 0:assertion#Attribute
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">      {
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">        Name = https://schemas.xmlsoap.org/ws/2005/05/identity/claims/name
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">        AttributeValue = ONEADHEALTHTEST\healthadmin
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">      }
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">      class 0:assertion#Attribute
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">      {
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">        Name = https://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">        AttributeValue = ONEADHEALTHTEST\healthadmin
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">      }
</span></p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">    ]
</span></p><p style="margin-left:36pt;">
 </p><p style="margin-left:36pt;"><span style="font-family:Consolas;font-size:10pt;">}
</span></p><p style="margin-left:14pt;">
 </p><h1>Getting events based on Activity ID
</h1><p>AD FS (especially 2012R2) does a great job of writing events into the Windows event logs. When you hit an error (see image below), you may see an activity ID. Think of this as a transaction identifier and multiple events can be generated with the same activity ID. This gives an account of what happened on the AD FS servers when it processed the token request. When tracing is enabled, the # of events increase with more detail. 
</p><p><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/03/84/metablogapi/021315_2147_Underthehoo1.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-03-84-metablogapi/021315_5F00_2147_5F00_Underthehoo1.png" alt=" " />
	</p><p>When troubleshooting issues and you have an activity ID handy, it is currently a challenge to go into each AD FS server and filter events looking for this activity ID. The script now makes it super simple for you. 
</p><p>You can run the <span style="color:#2e74b5;font-family:Consolas;">Get-ADFSServerTrace</span> cmdlet to find all the events related to that activity ID, across the different AD FS logs (Admin, Audits, and Trace).  You can run this across multiple servers in just one command! Just populate the <span style="color:#2e74b5;font-family:Consolas;">ComputerName</span> parameter as an array of machine names, provided that you have enabled <a href="https://technet.microsoft.com/en-us/library/cc766438.aspx">remote event log reading</a> on them.
</p><p>This example shows getting the activity Id from the error page above in the local AD FS server. Note below the &quot;Source&quot; property showing whether the event comes from audit or admin logs.
</p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">PS C:\adfsdiag&gt; Get-AdfsServerTrace -ActivityId 00000000-0000-0000-886e-0080000000df
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">ComputerName : localhost
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">Source       : Audits
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">TimeCreated  : 2/12/2015 5:40:07 PM
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">EventId      : 403
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">Message      : An HTTP request was received.
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">               Activity ID: 00000000-0000-0000-886e-0080000000df
</span></p><p style="margin-left:21pt;">
 </p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">               Request Details:
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">                   Date And Time: 2015-02-12 17:40:07
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">                   Client IP: ::1
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">…
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">ComputerName : localhost
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">Source       : Admin
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">TimeCreated  : 2/12/2015 5:40:07 PM
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">EventId      : 364
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">Message      : Encountered error during federation passive request.
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">               Additional Data
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">               Protocol Name:
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">               Relying Party:
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">               Exception details:
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">               Microsoft.IdentityServer.RequestFailedException: MSIS7065: There are no registered protocol handlers on
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">               path /adfs/ls to process the incoming request.
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">…
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">ComputerName : localhost
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">Source       : Audits
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">TimeCreated  : 2/12/2015 5:40:07 PM
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">EventId      : 404
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">Message      : An HTTP response was dispatched with:
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">               Activity ID: 00000000-0000-0000-886e-0080000000df
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">               Response Details:
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">                   Date And Time: 2015-02-12 17:40:07
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">                   Status Code: 200
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">                   Status Description: OK
</span></p><p>
 </p><p>Sometimes it is useful to have it in a table format. For that, use the parameter <span style="color:#2e74b5;font-family:Consolas;">OutHtmlFilePath</span>, and the cmdlet will format the output to an HTML file and opens up the browser:
</p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">Get-AdfsServerTrace -ActivityId 00000000-0000-0000-ce70-0080000000df  -OutHtmlFilePath .\report.htm
</span></p><p style="margin-left:21pt;"><span style="font-family:Consolas;font-size:10pt;">Report Generated at .\report.htm
</span></p><p>
 </p><p><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/03/84/metablogapi/021315_2147_Underthehoo2.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-03-84-metablogapi/021315_5F00_2147_5F00_Underthehoo2.png" alt=" " />
	</p><p> 
 </p><h1>Conclusion
</h1><p>The ADFSDiagnostics module is another tool in your toolbox to troubleshoot issues with your Hybrid environment. We are looking forward to your valuable feedback, either by signing up to the <a href="https://go.microsoft.com/fwlink/?LinkID=518643">Azure Active Directory Connect Health</a> or download the module stand-alone in the <a href="https://gallery.technet.microsoft.com/scriptcenter/AD-FS-Diagnostics-Module-8269de31">AD Script Center</a>. <br />As we learn more about your scenarios and issues, and get feedback from you we will add more health checks, gather more data, and add more functionality to make your life easier and your Hybrid Deployment in good shape!
</p>]]></content:encoded>
    </item>
    <item>
      <title>Gain insight into your AD FS traffic through “Azure Active Directory Connect Health”</title>
      <link>https://docs.microsoft.com/archive/blogs/aadceeteam/gain-insight-into-your-ad-fs-traffic-through-azure-active-directory-connect-health</link>
      <pubDate>Fri, 13 Feb 2015 10:42:41 GMT</pubDate>
      <dc:creator><![CDATA[Gerardo Perez Ocampo]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/aadceeteam/2015/02/13/gain-insight-into-your-ad-fs-traffic-through-azure-active-directory-connect-health/</guid>
      <description><![CDATA[Hello folks, my name is Gerardo Perez Ocampo, I&#39;m a Senior Software Developer in the Customer...]]></description>
      <content:encoded><![CDATA[<p>Hello folks, my name is Gerardo Perez Ocampo, I&#39;m a Senior Software Developer in the Customer Experience Engineering team at Microsoft.
</p><p>On this post I will describe in a nutshell the &quot;Usage analytics&quot; capability of the new Microsoft Azure AD premium feature &quot;<a href="https://msdn.microsoft.com/en-us/library/azure/dn906722.aspx">Azure Active Directory Connect Health</a>&quot; and how it can be used to gain insight into the traffic of your on-premises identity infrastructure.
</p><h2><br />Current AD FS Auditing story
</h2><p><a href="https://technet.microsoft.com/en-us/library/adfs2-troubleshooting-configuring-computers(WS.10).aspx">AD FS auditing</a> is a very useful tool for AD FS administrators to monitor closely the AD FS traffic.
</p><p>Unfortunately, the value of this auditing tool is often times not fully exploited by organizations due to the large amount of data that it generates and due to the fact that this data requires a deep understanding of AD FS concepts and must be parsed in order to discern each AD FS transaction and its corresponding outcome.
</p><p>For example; the image below shows the event log entries generated by the AD FS auditing on a Windows Server 2012 R2 Federation Server. 
</p><p>The highlighted events correspond to a <span style="text-decoration:underline;">single WS-Trust Authentication request</span>. <br />
	</p><p><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/03/84/metablogapi/021315_1846_Gaininsight1.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-03-84-metablogapi/021315_5F00_1846_5F00_Gaininsight1.png" alt=" " />
	</p><p>An AD FS request is processed by multiple subcomponents within the STS. These could be: receiving the HTTP request, decoding the headers, authorizing the caller, issuing the corresponding set of claims etc. Each of these subcomponents generate distinct audit events therefore, there is no single audit event that summarizes all the request&#39;s attributes. 
</p><p>In this particular case:
</p><ul><li>Event 403 specifies the client IP 
</li><li>Event 410 specifies the ADFS endpoint
</li><li>Event 431 specifies the key type
</li><li>Event 500 specifies the Issued identity
</li><li>Event 501 specifies the caller identity (among other things).
</li></ul><p>In order for an AD FS administrator to determine all the attributes of a &quot;logical login transaction&quot; (this AD FS WS-Trust request), <a href="https://blogs.msdn.com/b/card/archive/2010/01/21/diagnostics-in-ad-fs-2-0.aspx">these audits must be associated to each other through the &quot;Correlation ID&quot; and &quot;Activity ID&quot; fields included on each event log entry</a>. As you can imagine, this process can be tedious, error prone and time consuming.
</p><p>
 </p><h2>&quot;Usage Analytics&quot; feature of &quot;Azure Active Directory Connect Health&quot;
</h2><p>When the &quot;Azure Active Directory Connect Health&quot; agent is installed on any supported AD FS STS (we support ADFS 2.0 on Windows Server 2008R2 as well as ADFS in Windows Server 2012 and 2012R2), the agent takes on the burden of parsing and understanding the contents of the AD FS Audit logs away from the administrator and uses the power of the &quot;Azure AD Connect Health&quot; cloud service to analyze and present the traffic of your AD FS infrastructure in a user friendly format.
</p><p>Here is how it works:
</p><p>As explained above, multiple AD FS Audits are created on the AD FS STS through the lifecycle of an AD FS transaction. Whenever an audit is created, the &quot;Azure Active Directory Connect Health&quot; agent dissects its contents and uses its &quot;Activity ID&quot; and &quot;Instance ID&quot; to create a &quot;Logical AD FS Audit&quot;. As audit events come by, this logical audit will be updated to ultimately contain all the relevant information of each AD FS request such as Relying Party, Server Name, Authentication Method etc. (for security purposes, the agent does not include PII on the &quot;logical audit&quot;).
</p><p><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/03/84/metablogapi/021315_1846_Gaininsight2.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-03-84-metablogapi/021315_5F00_1846_5F00_Gaininsight2.png" alt=" " />
		<img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/03/84/metablogapi/021315_1846_Gaininsight3.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-03-84-metablogapi/021315_5F00_1846_5F00_Gaininsight3.png" alt=" " />
	</p><p>
 </p><p>At regular intervals, the &quot;Azure Active Directory Connect Health&quot; agent will take all the &quot;Logical AD FS Audits&quot; it has constructed so far and upload them to the &quot;Azure Active directory Connect Health&quot; service.
</p><p>Every 15 minutes, the cloud service will aggregate the data that has been uploaded by all &quot;Azure Active Directory Connect Health&quot; agents installed on all the AD FS servers across the AD FS farm and update the &quot;Usage Analytics&quot; views to offer &quot;Insights&quot; into the identity traffic such as &quot;Top application visits&quot;, &quot;Total Requests by server&quot;, &quot;Average unique users by Relying Party&quot; (amongst others):
</p><p>
 </p><p><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/03/84/metablogapi/021315_1846_Gaininsight4.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-03-84-metablogapi/021315_5F00_1846_5F00_Gaininsight4.png" alt=" " />
	</p><p>
 </p><p><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/03/84/metablogapi/021315_1846_Gaininsight5.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-03-84-metablogapi/021315_5F00_1846_5F00_Gaininsight5.png" alt=" " />
	</p><p>
 </p><p>At the moment, the service offers two pivots to look at your data: &quot;Total number of Requests&quot; or &quot;Unique User Count&quot;, each one of which has a different set of &quot;Groupings&quot;:
</p><p>
 </p><p><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/03/84/metablogapi/021315_1846_Gaininsight6.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-03-84-metablogapi/021315_5F00_1846_5F00_Gaininsight6.png" alt=" " />
	</p><p>
 </p><p>I hope you will find this new Azure Active Directory Premium feature a valuable addition to your identity control plane.
</p><p>Please try it out, as always, we&#39;d love to hear any feedback or suggestions you may have.
</p><p>For additional documentation, including step by step installation, please go to <a href="https://msdn.microsoft.com/en-us/library/azure/dn906722.aspx">https://msdn.microsoft.com/en-us/library/azure/dn906722.aspx</a>
	</p><p>Regards
</p>]]></content:encoded>
    </item>
  </channel>
</rss>