< Back

New-AemApiAccessToken

Sat Jul 18, 2020 3:58 pm

NAME
New-AemApiAccessToken

SYNOPSIS


SYNTAX
New-AemApiAccessToken [-ApiKey] <String> [-ApiSecretKey] <SecureString> [[-ApiUrl] <String>] [[-EventLogSource] <String>] [[-LogPath] <String>] [<CommonParameters>]


DESCRIPTION
Retrieves an authorization token from AutoTask.


PARAMETERS
-ApiKey <String>
Mandatory parameter. Represents the API key to AEM's REST API.

Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false

-ApiSecretKey <SecureString>
Mandatory parameter. Represents the API secret key to AEM's REST API.

Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false

-ApiUrl <String>
Default value is 'https://zinfandel-api.centrastage.net'. Represents the URL to AutoTask's AEM API, for the desired instance.

Required? false
Position? 3
Default value https://zinfandel-api.centrastage.net
Accept pipeline input? false
Accept wildcard characters? false

-EventLogSource <String>
Default value is 'AemPowerShellModule'. This parameter is used to specify the event source, that script/modules will use for logging.

Required? false
Position? 4
Default value
Accept pipeline input? false
Accept wildcard characters? false

-LogPath <String>
When included (when EventLogSource is null), represents the file, to which the cmdlet will output will be logged. If no path or event log source are provided, output is sent only to the host.

Required? false
Position? 5
Default value
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

NOTES


Author: Mike Hashemi
V1.0.0.0 date: 15 June 2018
- Initial release.
V1.0.0.1 date: 17 June 2018
- Added missing closing backet.
V1.0.0.2 date: 16 August 2018
- Removed Ssl3 and Tsl protocol support.
- Added return.
- Fixed output bug. The -BlockLogging parameter was blocking all output.
- Updated white space.
V1.0.0.3 date: 27 October 2018 - by Konstantin Kaminskiy
- Adjusted returned data to include only the access token itself to increase ease of use.
V1.0.0.4 date: 16 October 2019
V1.0.0.5 date: 5 December 2019

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

PS C:\>.\New-AemApiAccessToken -ApiKey XXXXXXXXXXXXXXXXXXXX -ApiSecretKey XXXXXXXXXXXXXXXXXXXX | ConvertTo-SecureString -AsPlainText -Force






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

PS C:\>$token = New-AemApiAccessToken -ApiKey XXXXXXXXXXXXXXXXXXXX -ApiSecretKey XXXXXXXXXXXXXXXXXXXX | ConvertTo-SecureString -AsPlainText -Force

Store your token in a variable for later use and re-use.





RELATED LINKS
https://github.com/wetling23/Public.AEM ... hellModule