Skip to main content

Get-MsIdAdfsWsFedToken

SYNOPSIS

Initiates a Ws-Fed logon request to and AD FS server to generate log activity and returns the user token.

SYNTAX

Get-MsIdAdfsWsFedToken [-WtRealm] <String> -HostName <String> [-Credential <PSCredential>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

This command will generate log activity on the ADFS server, by requesting a Ws-Fed token using the windows or forms authentication.

EXAMPLES

EXAMPLE 1

Get-MsIdAdfsWsFedToken urn:federation:MicrosoftOnline -HostName adfs.contoso.com

Sign in to an application on an AD FS server using logged user credentials using the Ws-Fed protocol.

EXAMPLE 2

$credential = Get-Credential
PS > Get-MsIdAdfsWsFedToken urn:federation:MicrosoftOnline -HostName adfs.contoso.com

Sign in to an application on an AD FS server using credentials provided by the user using the Ws-Fed endpoint and forms based authentication.

EXAMPLE 3

$WsFedIdentifiers = Get-AdfsRelyingPartyTrust | where { $_.WSFedEndpoint -ne $null -and $_.Identifier -notcontains "urn:federation:MicrosoftOnline" } | foreach { $_.Identifier.Item(0) }
PS > $WsFedIdentifiers | foreach { Get-MsIdAdfsWsFedToken $_ -HostName adfs.contoso.com }

Get all Ws-Fed relying party trusts from the AD FS server excluding Azure AD and sign in using the logged user credentials.

PARAMETERS

-WtRealm

Enter the application identifier

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-HostName

Enter host name for the AD FS server

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Credential

Provide the credential for the user to be signed in

Type: PSCredential
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

System.String

NOTES