< Back

New-ZabbixUser

Sun Jan 19, 2020 6:12 pm

NAME New-ZabbixUser



SYNOPSIS

Create new user





SYNTAX

New-ZabbixUser [-Alias] <String> [-Passwd] <String> [[-UserGroupID] <Array>] [[-Name] <String>] [[-Surname]

<String>] [[-usrgrpid] <Array>] [[-UserMediaSeverity] <Int32>] [[-UserMediaPeriod] <String>] [[-UserMediaSendto]

<String>] [[-mediatypeid] <Int32>] [[-usrgrps] <Array>] [[-RowsPerPage] <Int32>] [[-UserMediaActive] <String>]

[[-medias] <Array>] [[-Type] <Int32>] [[-mediaTypes] <Array>] [[-Refresh] <String>] [[-Autologin] <Int32>]

[[-Autologout] <String>] [[-Theme] <String>] [[-UserDefaultURL] <String>] [[-jsonrpc] <String>] [[-session]

<String>] [[-id] <String>] [[-URL] <String>] [<CommonParameters>]





DESCRIPTION





PARAMETERS

-Alias <String>

User alias. Example: firstname.lastname



Required? true

Position? 1

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Passwd <String>

User password



Required? true

Position? 2

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-UserGroupID <Array>

GroupID user belongs to



Required? false

Position? 3

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Name <String>

User name



Required? false

Position? 4

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Surname <String>

User last name



Required? false

Position? 5

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-usrgrpid <Array>



Required? false

Position? 6

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-UserMediaSeverity <Int32>

User media settings: Severity. Trigger severities: Default: 63



Required? false

Position? 7

Default value 63

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-UserMediaPeriod <String>

User media settings: Period. Example: "1-7,00:00-24:00"



Required? false

Position? 8

Default value 1-7,00:00-24:00

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-UserMediaSendto <String>

User media settings: SendTo. Mostly email address



Required? false

Position? 9

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-mediatypeid <Int32>

Unique global media type id



Required? false

Position? 10

Default value 0

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-usrgrps <Array>



Required? false

Position? 11

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-RowsPerPage <Int32>

GUI frontend: Rows per page in web browser



Required? false

Position? 12

Default value 0

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-UserMediaActive <String>

User media settings: Active. User media enabled=0/disabled=1



Required? false

Position? 13

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-medias <Array>



Required? false

Position? 14

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Type <Int32>

Type of the user. Possible values: 1 - (default) Zabbix user; 2 - Zabbix admin; 3 - Zabbix super admin



Required? false

Position? 15

Default value 0

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-mediaTypes <Array>



Required? false

Position? 16

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Refresh <String>

GUI frontend: Automatic refresh period. Accepts seconds and time unit with suffix. Default: 30s



Required? false

Position? 17

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Autologin <Int32>

GUI frontend: Possible values: 0 - (default) auto-login disabled; 1 - auto-login enabled



Required? false

Position? 18

Default value 0

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Autologout <String>

GUI frontend: User session life time. Accepts seconds and time unit with suffix. If set to 0s, the session

will never expire. Default: 15m



Required? false

Position? 19

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Theme <String>

GUI frontend: User's theme. Possible values: default - (default) system default; blue-theme - Blue; dark-theme

- Dark



Required? false

Position? 20

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-UserDefaultURL <String>

GUI frontend: URL of the page to redirect the user to after logging in



Required? false

Position? 21

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-jsonrpc <String>



Required? false

Position? 22

Default value ($global:zabSessionParams.jsonrpc)

Accept pipeline input? false

Accept wildcard characters? false



-session <String>



Required? false

Position? 23

Default value ($global:zabSessionParams.session)

Accept pipeline input? false

Accept wildcard characters? false



-id <String>



Required? false

Position? 24

Default value ($global:zabSessionParams.id)

Accept pipeline input? false

Accept wildcard characters? false



-URL <String>



Required? false

Position? 25

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-ZabbixUser -Name NewName -Surname NewSurname -Alias first.last -passwd "123456" -sendto

first.last@domain.com -UserGroupID 7,9



Create new user









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



PS C:\\>New-ZabbixUser -Name NewName -Surname NewSurname -Alias first.last -passwd "123456" -sendto

first.last@domain.com -UserMediaActive 0 -rows_per_page 100 -Refresh 300 -UserGroupID (Get-ZabbixUserGroup | ?

name -match "disabled|administrator" | select usrgrpid)



Create new user (disabled)









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



PS C:\\>New-ZabbixUser -Name NewName -Surname NewSurname -Alias first.last -passwd "123456" -sendto

first.last@domain.com -UserMediaActive 0 -rows_per_page 100 -Refresh 300 -UserGroupID (Get-ZabbixUserGroup | ?

name -match "disabled|administrator").usrgrpid



Create new user (disabled)









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



PS C:\\>Import-Csv C:\\zabbix-users.csv | %{New-ZabbixUser -Name $_.UserName -Surname $_.UserSurname -Alias

$_.UserAlias -passwd "$_.Passwd" -UserMediaSendto $_.UserMediaSendto -UserMediaActive $_.UserMediaActive

-rows_per_page $_.rows_per_page -Refresh $_.refresh -usrgrps (Get-ZabbixUserGroup | ? name -match

"guest").usrgrpid}



Mass create new users from the csv file









-------------------------- EXAMPLE 5 --------------------------



PS C:\\>Import-Csv C:\\zabbix-users.csv | %{New-ZabbixUser -Name $_.UserName -Surname $_.UserSurname -Alias

$_.UserAlias -passwd "$_.Passwd" -UserMediaSendto $_.UserEmail -mediatypeid 1 -RowsPerPage 120 -Refresh 60s

-UserGroupID (Get-ZabbixUserGroup | ? name -match "guest").usrgrpid}



Mass create new users from the csv file









-------------------------- EXAMPLE 6 --------------------------



PS C:\\>Get-ZabbixUser | ? alias -eq "SourceUser" | New-ZabbixUser -Name NewName -Surname NewSurname -Alias

first.last -passwd "123456" -sendto first@first.com -UserMediaActive 0 -rows_per_page 100 -Refresh 300



Clone user. Enable media (-UserMediaActive 0)









-------------------------- EXAMPLE 7 --------------------------



PS C:\\>Get-Zabbixuser | ? alias -eq "SourceUser" | New-ZabbixUser -Name NewName -Surname NewSurname -Alias

first.last -passwd "123456"



Clone user









-------------------------- EXAMPLE 8 --------------------------



PS C:\\>Get-ZabbixUser | ? alias -match "SourceUser" | New-ZabbixUser -Name NewName -Surname NewSurname -Alias

first.last -passwd "123456" -usrgrps (Get-ZabbixUserGroup | ? name -match disabled).usrgrpid



Clone user, but disable it (assign to usrgrp Disabled)









-------------------------- EXAMPLE 9 --------------------------



PS C:\\>Import-Csv C:\\zabbix-users.csv | %{Get-Zabbixuser | ? alias -eq template.user | New-ZabbixUser -Name

$_.UserName -Surname $_.UserSurname -Alias $_UserAlias -passwd "$_.Passwd" -UserMediaSendto $_.UserEmail}



Mass create/clone from the user template









-------------------------- EXAMPLE 10 --------------------------



PS C:\\>Import-Csv C:\\zabbix-users.csv | %{Get-Zabbixuser | ? alias -eq template.user | New-ZabbixUser -Name

$_.UserName -Surname $_.UserSurname -Alias $_UserAlias -passwd "$_.Passwd" -UserMediaSendto $_.UserEmail

-UserMediaActive 1}



Mass create/clone from the user template, but disable all medias for new users











RELATED LINKS