New-LMAPIUser
Syntax
New-LMAPIUser [-Username] <String> [[-UserGroups] <String[]>] [[-Note] <String>] [[-RoleNames] <String[]>] [[-Status] <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Description
The New-LMAPIUser function creates a new API-only user in LogicMonitor with specified roles and group memberships.
Examples
Example 1
#Create a new API userNew-LMAPIUser -Username "api.user" -UserGroups @("Group1","Group2") -RoleNames @("admin") -Note "API user for automation"
Parameters
-Username
The username for the new API user. This parameter is mandatory.
Type: StringParameter Sets: (All)Aliases:
Required: TruePosition: 1Default value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-UserGroups
The user groups to add the new user to.
Type: String[]Parameter Sets: (All)Aliases:
Required: FalsePosition: 2Default value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-Note
A note describing the purpose of the API user.
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: 3Default value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-RoleNames
The roles to assign to the user. Defaults to “readonly”.
Type: String[]Parameter Sets: (All)Aliases:
Required: FalsePosition: 4Default value: @("readonly")Accept pipeline input: FalseAccept wildcard characters: False
-Status
The status of the user. Valid values are “active” and “suspended”. Defaults to “active”.
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: 5Default value: ActiveAccept 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
None. You cannot pipe objects to this command.
Outputs
Returns the created user object.
Notes
You must run Connect-LMAccount before running this command.