Skip to content

New-LMAPIUser

Syntax

Terminal window
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

Terminal window
#Create a new API user
New-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: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-UserGroups

The user groups to add the new user to.

Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Note

A note describing the purpose of the API user.

Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-RoleNames

The roles to assign to the user. Defaults to “readonly”.

Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: @("readonly")
Accept pipeline input: False
Accept wildcard characters: False

-Status

The status of the user. Valid values are “active” and “suspended”. Defaults to “active”.

Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: Active
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

Fill ProgressAction Description

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept 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.