Public/Test-AdfsServerToken.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<#
.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
}