< Back

Set-ZabbixUserGroup

Sun Jan 19, 2020 6:15 pm

NAME Set-ZabbixUserGroup



SYNOPSIS

Update user group





SYNTAX

Set-ZabbixUserGroup [[-UserGroupName] <String>] [[-UserGroupID] <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

Update user group





PARAMETERS

-UserGroupName <String>

User group name



Required? false

Position? 1

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-UserGroupID <String>



Required? false

Position? 2

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? 3

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? 4

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? 5

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? 6

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-UserID <Array>

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



Required? false

Position? 7

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-userids <Array>



Required? false

Position? 8

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-users <Array>



Required? false

Position? 9

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-jsonrpc <String>



Required? false

Position? 10

Default value ($global:zabSessionParams.jsonrpc)

Accept pipeline input? false

Accept wildcard characters? false



-session <String>



Required? false

Position? 11

Default value ($global:zabSessionParams.session)

Accept pipeline input? false

Accept wildcard characters? false



-id <String>



Required? false

Position? 12

Default value ($global:zabSessionParams.id)

Accept pipeline input? false

Accept wildcard characters? false



-URL <String>



Required? false

Position? 13

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:\\>Get-ZabbixUserGroup | ? name -eq "UserGroup" | Set-ZabbixUserGroup -UserID 2,4,8



Replace users in the user group by new ones









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



PS C:\\>$CurrentUsers=(Get-ZabbixUserGroup | ? name -eq "UserGroup").users.userid



$NewUsers=(Get-ZabbixUser | ? name -match "user1|user2|user3|user4").userid

(Get-ZabbixUserGroup | ? name -eq "UserGroup") | Set-ZabbixUserGroup -UserID ($currentUsers+$NewUsers)

Add users to the user group









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



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



Rename 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 -eq "UserGroup) | Set-ZabbixUserGroup -UserGroupAccessRights ($ROAccess+$FullAccess)

3. Replace access permissions to the user group











RELATED LINKS





CommonParameters : False

WorkflowCommonParameters : False

details : @{name=Write-MissingParamsMessage; noun=; verb=}

Syntax : @{syntaxItem=System.Object[]}

parameters : @{parameter=System.Object[]}

inputTypes : @{inputType=}

returnValues : @{returnValue=}

aliases : None



remarks : None

alertSet :

description :

examples :

Synopsis :

Write-MissingParamsMessage



ModuleName : psbbix

nonTerminatingErrors :

xmlns:command : http://schemas.microsoft.com/maml/dev/command/2004/10

xmlns:dev : http://schemas.microsoft.com/maml/dev/2004/10

xmlns:maml : http://schemas.microsoft.com/maml/2004/10

Name : Write-MissingParamsMessage

Category : Function

Component :

Role :

Functionality :