Remove-LMAPIToken
Syntax
Id (Default)
Remove-LMAPIToken -UserId <Int32> -APITokenId <Int32> [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
Name
Remove-LMAPIToken -UserName <String> -APITokenId <Int32> [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
AccessId
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
Remove-LMAPIToken -UserId 1234 -APITokenId 5678Removes the API token with ID 5678 associated with the user with ID 1234.
Example 2
Remove-LMAPIToken -UserName "john.doe" -APITokenId 5678Removes the API token with ID 5678 associated with the user with name "john.doe".
Example 3
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: Int32Parameter Sets: IdAliases:
Required: TruePosition: NamedDefault value: 0Accept pipeline input: FalseAccept 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: StringParameter Sets: NameAliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-AccessId
The access ID of the API token. This parameter is mandatory when using the ‘AccessId’ parameter set.
Type: StringParameter Sets: AccessIdAliases:
Required: TruePosition: NamedDefault value: NoneAccept 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: Int32Parameter Sets: Id, NameAliases:
Required: TruePosition: NamedDefault value: 0Accept pipeline input: FalseAccept wildcard characters: False
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameterParameter Sets: (All)Aliases: wi
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameterParameter Sets: (All)Aliases: cf
Required: FalsePosition: NamedDefault value: NoneAccept 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
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.