Public/Test-AdfsServerToken.ps1

<#
.SYNOPSIS
Performs a synthetic transaction to get a token against an AD FS farm
 
.DESCRIPTION
If a credential is provided, then the 2005/usernamemixed Endpoint will be used to get the token.
Otherwise, the 2005/windowstransport endpoint will be used with the windows identity of the logged on user.
The token is returned in XML format. By default this cmdlet will perform three transactions using Tls 1.0, Tls 1.1, and Tls 1.2.
 
.PARAMETER FederationServer
Federation Server (Farm) host name
 
.PARAMETER AppliesTo
Identifier of the target relying party
 
.PARAMETER Credential
Optional Username Credential used to retrieve the token
 
.PARAMETER TestTls10
Optional switch to specify performing a synthetic transaction using Tls 1.0
 
.PARAMETER TestTls11
Optional switch to specify performing a synthetic transaction using Tls 1.1
 
.PARAMETER TestTls12
Optional switch to specify performing a synthetic transaction using Tls 1.2
 
.EXAMPLE
Test-AdfsServerToken -FederationServer sts.contoso.com -AppliesTo urn:payrollapp
Retrieves a token for the relying party with identifier urn:payrollapp against the farm 'sts.contoso.com' with logged on user windows credentials
 
.EXAMPLE
Test-AdfsServerToken -FederationServer sts.contoso.com -AppliesTo urn:payrollapp -Credential (Get-Credential)
Retrieves a token for the relying party with identifier urn:payrollapp against the farm 'sts.contoso.com' using a UserName/Password credential
 
.EXAMPLE
$tokenString = Test-AdfsServerToken -FederationServer sts.contoso.com -AppliesTo urn:payrollapp
$tokenXml = [Xml]$tokenString
$tokenXml.Envelope.Body.RequestSecurityTokenResponse.RequestedSecurityToken.Assertion.AttributeStatement.Attribute | ft
 
Retrieves a token, and see the claims in the attribute statement in a table format
 
.EXAMPLE
Test-AdfsServerToken -FederationServer sts.contoso.com -AppliesTo urn:payrollapp -TestTls10 -TestTls11
Perform two synthetic transactions using Tls 1.0 and Tls 1.1 for the relying party with identifier urn:payrollapp against the farm 'sts.contoso.com' with logged on user windows credentials.
 
.NOTES
If credential parameter is provided, then the 2005/usernamemixed Endpoint needs to be enabled
Otherwise, the 2005/windowstransport endpoint needs to be enabled
 
#>


Function Test-AdfsServerToken
{
    Write-DeprecationNotice
}