< Back

Update-MgaAccessToken

Sat Jan 18, 2020 4:43 pm

NAME Update-MgaAccessToken



SYNOPSIS

Updates an existing access token





SYNTAX

Update-MgaAccessToken [-Token <AzureAccessToken>] [<CommonParameters>]



Update-MgaAccessToken [-Token <AzureAccessToken>] [-Register] [-PassThru] [<CommonParameters>]





DESCRIPTION

Updates an existing access token for contacting the specified application endpoint as long

as the token is still valid. Otherwise, a new access is called through New-MgaAccessToken.





PARAMETERS

-Token <AzureAccessToken>

The token object to renew.



Required? false

Position? named

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-Register [<SwitchParameter>]

Registers the renewed token, so all subsequent calls to Exchange Online reuse it by default.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-PassThru [<SwitchParameter>]

Outputs the token to the console, even when the register switch is set



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Update-MgaAccessToken -Register



Updates the default (registered) Accesstoken and register it again as the default token









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>$token = Update-MgaAccessToken -Token $token



Updates the AccessToken in $token and output a new AccessToken object.











RELATED LINKS