Skip to content

Remove-LMAPIToken

Syntax

Id (Default)

Terminal window
Remove-LMAPIToken -UserId <Int32> -APITokenId <Int32> [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm]
[<CommonParameters>]

Name

Terminal window
Remove-LMAPIToken -UserName <String> -APITokenId <Int32> [-ProgressAction <ActionPreference>] [-WhatIf]
[-Confirm] [<CommonParameters>]

AccessId

Terminal window
Remove-LMAPIToken -AccessId <String> [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm]
[<CommonParameters>]

Description

The Remove-LMAPIToken function is used to remove an API token from Logic Monitor. It supports removing the token by specifying either the token’s ID, the user’s ID and token’s ID, or the user’s name and token’s ID.

Examples

Example 1

Terminal window
Remove-LMAPIToken -UserId 1234 -APITokenId 5678
Removes the API token with ID 5678 associated with the user with ID 1234.

Example 2

Terminal window
Remove-LMAPIToken -UserName "john.doe" -APITokenId 5678
Removes the API token with ID 5678 associated with the user with name "john.doe".

Example 3

Terminal window
Remove-LMAPIToken -AccessId "abcd1234"
Removes the API token with the specified access ID.

Parameters

-UserId

The ID of the user associated with the API token. This parameter is mandatory when using the ‘Id’ parameter set.

Type: Int32
Parameter Sets: Id
Aliases:
Required: True
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-UserName

The name of the user associated with the API token. This parameter is mandatory when using the ‘Name’ parameter set.

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

-AccessId

The access ID of the API token. This parameter is mandatory when using the ‘AccessId’ parameter set.

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

-APITokenId

The ID of the API token. This parameter is mandatory when using the ‘Id’ or ‘Name’ parameter set.

Type: Int32
Parameter Sets: Id, Name
Aliases:
Required: True
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

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

-Confirm

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

-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

You can pipe API token objects to this function.

Outputs

Returns a PSCustomObject containing the ID of the removed API token and a success message confirming the removal.

Notes

This function requires a valid API authentication. Make sure to log in using Connect-LMAccount before running this command.