Remove-LMAPIToken
Syntax
Section titled “Syntax”Id (Default)
Section titled “Id (Default)”Remove-LMAPIToken -UserId <Int32> -APITokenId <Int32> [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]Remove-LMAPIToken -UserName <String> -APITokenId <Int32> [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]AccessId
Section titled “AccessId”Remove-LMAPIToken -AccessId <String> [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]Description
Section titled “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
Section titled “Examples”Example 1
Section titled “Example 1”Remove-LMAPIToken -UserId 1234 -APITokenId 5678Removes the API token with ID 5678 associated with the user with ID 1234.Example 2
Section titled “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
Section titled “Example 3”Remove-LMAPIToken -AccessId "abcd1234"Removes the API token with the specified access ID.Parameters
Section titled “Parameters”-UserId
Section titled “-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
Section titled “-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
Section titled “-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
Section titled “-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
Section titled “-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
Section titled “-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
Section titled “-ProgressAction”Fill ProgressAction Description
Type: ActionPreferenceParameter Sets: (All)Aliases: proga
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: FalseCommonParameters
Section titled “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
Section titled “Inputs”You can pipe API token objects to this function.
Section titled “You can pipe API token objects to this function.”Outputs
Section titled “Outputs”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.