New-LMAPIToken
Syntax
Section titled “Syntax”New-LMAPIToken -Id <String[]> [-Note <String>] [-CreateDisabled] [-Type <String>] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]Username
Section titled “Username”New-LMAPIToken -Username <String> [-Note <String>] [-CreateDisabled] [-Type <String>] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]Description
Section titled “Description”The New-LMAPIToken function creates a new API token for a specified user in LogicMonitor.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”#Create a token by user IDNew-LMAPIToken -Id "12345" -Note "API Token for automation"Example 2
Section titled “Example 2”#Create a token by usernameNew-LMAPIToken -Username "john.doe" -Type "Bearer" -CreateDisabledParameters
Section titled “Parameters”The ID of the user to create the token for. Required for Id parameter set.
Type: String[]Parameter Sets: IdAliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-Username
Section titled “-Username”The username to create the token for. Required for Username parameter set.
Type: StringParameter Sets: UsernameAliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: FalseA note describing the purpose of the API token.
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-CreateDisabled
Section titled “-CreateDisabled”Switch to create the token in a disabled state.
Type: SwitchParameterParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: FalseAccept pipeline input: FalseAccept wildcard characters: FalseThe type of API token to create. Valid values are “LMv1” and “Bearer”. Defaults to “LMv1”.
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: LMv1Accept 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”None. You cannot pipe objects to this command.
Section titled “None. You cannot pipe objects to this command.”Outputs
Section titled “Outputs”Returns LogicMonitor.APIToken object.
Section titled “Returns LogicMonitor.APIToken object.”You must run Connect-LMAccount before running this command.