New-LMAPIToken
Syntax
Section titled “Syntax”New-LMAPIToken -Id <string[]> [-Note <string>] [-CreateDisabled] [-Type <string>] [-WhatIf] [-Confirm] [<CommonParameters>]Username
Section titled “Username”New-LMAPIToken -Username <string> [-Note <string>] [-CreateDisabled] [-Type <string>] [-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”-Confirm
Section titled “-Confirm”Prompts you for confirmation before running the cmdlet.
Type: System.Management.Automation.SwitchParameterDefaultValue: ''SupportsWildcards: falseAliases:- cfParameterSets:- Name: (All) Position: Named IsRequired: false ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''-CreateDisabled
Section titled “-CreateDisabled”Switch to create the token in a disabled state.
Type: System.Management.Automation.SwitchParameterDefaultValue: FalseSupportsWildcards: falseAliases: []ParameterSets:- Name: (All) Position: Named IsRequired: false ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''The ID of the user to create the token for. Required for Id parameter set.
Type: System.String[]DefaultValue: ''SupportsWildcards: falseAliases: []ParameterSets:- Name: Id Position: Named IsRequired: true ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''A note describing the purpose of the API token.
Type: System.StringDefaultValue: ''SupportsWildcards: falseAliases: []ParameterSets:- Name: (All) Position: Named IsRequired: false ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''The type of API token to create. Valid values are “LMv1” and “Bearer”. Defaults to “LMv1”.
Type: System.StringDefaultValue: LMv1SupportsWildcards: falseAliases: []ParameterSets:- Name: (All) Position: Named IsRequired: false ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''-Username
Section titled “-Username”The username to create the token for. Required for Username parameter set.
Type: System.StringDefaultValue: ''SupportsWildcards: falseAliases: []ParameterSets:- Name: Username Position: Named IsRequired: true ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''-WhatIf
Section titled “-WhatIf”Runs the command in a mode that only reports what would happen without performing the actions.
Type: System.Management.Automation.SwitchParameterDefaultValue: ''SupportsWildcards: falseAliases:- wiParameterSets:- Name: (All) Position: Named IsRequired: false ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''CommonParameters
Section titled “CommonParameters”This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.