Skip to content

New-LMAPIToken

Terminal window
New-LMAPIToken -Id <String[]> [-Note <String>] [-CreateDisabled] [-Type <String>]
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
Terminal window
New-LMAPIToken -Username <String> [-Note <String>] [-CreateDisabled] [-Type <String>]
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]

The New-LMAPIToken function creates a new API token for a specified user in LogicMonitor.

Terminal window
#Create a token by user ID
New-LMAPIToken -Id "12345" -Note "API Token for automation"
Terminal window
#Create a token by username
New-LMAPIToken -Username "john.doe" -Type "Bearer" -CreateDisabled

The ID of the user to create the token for. Required for Id parameter set.

Type: String[]
Parameter Sets: Id
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

The username to create the token for. Required for Username parameter set.

Type: String
Parameter Sets: Username
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

A note describing the purpose of the API token.

Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Switch to create the token in a disabled state.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

The type of API token to create. Valid values are “LMv1” and “Bearer”. Defaults to “LMv1”.

Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: LMv1
Accept pipeline input: False
Accept wildcard characters: False

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

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

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

None. You cannot pipe objects to this command.

Section titled “None. You cannot pipe objects to this command.”

You must run Connect-LMAccount before running this command.