New-LMAPIToken
Syntax
Id
New-LMAPIToken -Id <String[]> [-Note <String>] [-CreateDisabled] [-Type <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Username
New-LMAPIToken -Username <String> [-Note <String>] [-CreateDisabled] [-Type <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Description
The New-LMAPIToken function creates a new API token for a specified user in LogicMonitor.
Examples
Example 1
#Create a token by user IDNew-LMAPIToken -Id "12345" -Note "API Token for automation"
Example 2
#Create a token by usernameNew-LMAPIToken -Username "john.doe" -Type "Bearer" -CreateDisabled
Parameters
-Id
The ID of the user to create the token for. Required for Id parameter set.
Type: String[]Parameter Sets: IdAliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-Username
The username to create the token for. Required for Username parameter set.
Type: StringParameter Sets: UsernameAliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-Note
A note describing the purpose of the API token.
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-CreateDisabled
Switch to create the token in a disabled state.
Type: SwitchParameterParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: FalseAccept pipeline input: FalseAccept wildcard characters: False
-Type
The type of API token to create. Valid values are “LMv1” and “Bearer”. Defaults to “LMv1”.
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: LMv1Accept pipeline input: FalseAccept wildcard characters: False
-ProgressAction
Fill ProgressAction Description
Type: ActionPreferenceParameter Sets: (All)Aliases: proga
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept 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
None. You cannot pipe objects to this command.
Outputs
Returns LogicMonitor.APIToken object.
Notes
You must run Connect-LMAccount before running this command.