Skip to main content

Get-MsIdAdfsWsTrustToken

SYNOPSIS

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

SYNTAX

Get-MsIdAdfsWsTrustToken [-Identifier] <String> -HostName <String> [-Credential <PSCredential>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

This command will generate log activity on the ADFS server, by requesting a Ws-Trust token using the windows transport or user name mixed endpoint.

EXAMPLES

EXAMPLE 1

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

Sign in to an application on an AD FS server using logged user credentials using the WindowsTransport endpoint.

EXAMPLE 2

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

Sign in to an application on an AD FS server using credentials provided by the user using the UserNameMixed endpoint.

EXAMPLE 3

$identifiers =  Get-AdfsRelyingPartyTrust | foreach { $_.Identifier.Item(0) }
PS > $identifiers | foreach { Get-MsIdAdfsWsTrustToken $_ -HostName adfs.contoso.com }

Get all relying party trusts from the AD FS server and sign in using the logged user credentials.

PARAMETERS

-Identifier

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