Skip to content

Remove-LMAPIToken

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

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.

Terminal window
Remove-LMAPIToken -UserId 1234 -APITokenId 5678
Removes the API token with ID 5678 associated with the user with ID 1234.
Terminal window
Remove-LMAPIToken -UserName "john.doe" -APITokenId 5678
Removes the API token with ID 5678 associated with the user with name "john.doe".
Terminal window
Remove-LMAPIToken -AccessId "abcd1234"
Removes the API token with the specified access ID.

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

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

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

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

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.

You can pipe API token objects to this function.

Section titled “You can pipe API token objects to this function.”

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

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

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