< Back

New-ZabbixUserGroup

Sun Jan 19, 2020 6:13 pm

NAME New-ZabbixUserGroup



SYNOPSIS

Create user group





SYNTAX

New-ZabbixUserGroup [[-UserGroupName] <String>] [[-UserGroupDebugMode] <String>] [[-UserGroupGuiAccess] <String>]

[[-UserGroupUsersStatus] <String>] [[-UserGroupAccessRights] <Array>] [[-UserID] <Array>] [[-userids] <Array>]

[[-users] <Array>] [[-jsonrpc] <String>] [[-session] <String>] [[-id] <String>] [[-URL] <String>]

[<CommonParameters>]





DESCRIPTION

Create user group





PARAMETERS

-UserGroupName <String>

User group name



Required? false

Position? 1

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-UserGroupDebugMode <String>

Enable/Disable debug mode for group members. Possible values are: 0 - (default) disabled; 1 - enabled



Required? false

Position? 2

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-UserGroupGuiAccess <String>

Enable/Disable GUI access for group members. Possible values: 0 - (default) use the system default

authentication method; 1 - use internal authentication; 2 - disable access to the frontend



Required? false

Position? 3

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-UserGroupUsersStatus <String>

Enable/Disable status for group members. Possible values are: 0 - (default) enabled; 1 - disabled



Required? false

Position? 4

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-UserGroupAccessRights <Array>

Define access level for group members to the host groups. Possible values: 0 - access denied; 2 - read-only

access; 3 - read-write access



Required? false

Position? 5

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-UserID <Array>

[Parameter(Mandatory=$False,ValueFromPipelineByPropertyName=$True)][array]$rights,



Required? false

Position? 6

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-userids <Array>



Required? false

Position? 7

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-users <Array>



Required? false

Position? 8

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-jsonrpc <String>



Required? false

Position? 9

Default value ($global:zabSessionParams.jsonrpc)

Accept pipeline input? false

Accept wildcard characters? false



-session <String>



Required? false

Position? 10

Default value ($global:zabSessionParams.session)

Accept pipeline input? false

Accept wildcard characters? false



-id <String>



Required? false

Position? 11

Default value ($global:zabSessionParams.id)

Accept pipeline input? false

Accept wildcard characters? false



-URL <String>



Required? false

Position? 12

Default value ($global:zabSessionParams.url)

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>New-ZabbixUserGroup -UserGroupName "NewUserGroup" -UserID 2,41,84



Create new user group and assign the members









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>New-ZabbixUserGroup -UserGroupName "NewUserGroup" -UserID (Get-ZabbixUser | ? alias -match

"user1|user2").userid -UserGroupUsersStatus 1 -UserGroupGuiAccess 2



Create new user group, assign the members, all group members will be in disabled state, and will have no access to

GUI frontend









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>(Get-ZabbixUserGroup | ? name -Match "SourceUserGroup") | New-ZabbixUserGroup -UserGroupName "NewUserGroup"



Clone user group









-------------------------- EXAMPLE 4 --------------------------



PS C:\\>$ROAccess=(Get-ZabbixHostGroup | ? name -match "ROHostGroup1|ROHostGroup2|ROHostGroup3").groupid |

%{@{"permission"=2;"id"=$_}}



1. Generate Read-Only access rights for certain host groups

$FullAccess=(Get-ZabbixHostGroup | ? name -match "RWHostGroup1|RWHostGroup2|RWHostGroup3").groupid |

%{@{"permission"=3;"id"=$_}}

2. Generate Read/Write access rights for certain host groups

(Get-ZabbixUserGroup | ? name -Match "SourceUserGroup) | New-ZabbixUserGroup -UserGroupName "NewUserGroup"

-UserGroupAccessRights ($ROAccess+$FullAccess)

3. Clone user group and assign the new access rights











RELATED LINKS