< Back

Remove-ZabbixHost

Sun Jan 19, 2020 6:13 pm

NAME Remove-ZabbixHost



SYNOPSIS

Delete/Remove selected host





SYNTAX

Remove-ZabbixHost [[-HostID] <Array>] [[-Name] <String>] [[-jsonrpc] <String>] [[-session] <String>] [[-id]

<String>] [[-URL] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

Delete/Remove selected host





PARAMETERS

-HostID <Array>

To filter by ID/IDs



Required? false

Position? 1

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Name <String>



Required? false

Position? 2

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-jsonrpc <String>



Required? false

Position? 3

Default value ($global:zabSessionParams.jsonrpc)

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-session <String>



Required? false

Position? 4

Default value ($global:zabSessionParams.session)

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-id <String>



Required? false

Position? 5

Default value ($global:zabSessionParams.id)

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-URL <String>



Required? false

Position? 6

Default value ($global:zabSessionParams.url)

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

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:\\>Remove-ZabbixHost -HostID (Get-ZabbixHost | ? name -match "RetiredHosts").hostid -WhatIf



Remove host(s) by name match (case insensitive) (check only: -WhatIf)









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



PS C:\\>Remove-ZabbixHost -HostID (Get-ZabbixHost | ? name -match "RetiredHosts").hostid



Remove host(s) by name match (case insensitive)









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



PS C:\\>Remove-ZabbixHost -HostID "10001","10002"



Remove hosts by IDs









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



PS C:\\>Remove-ZabbixHost -HostID (Get-ZabbixHost -HostName HostRetired).hostid



Remove single host by name (exact match, case sensitive)









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



PS C:\\>Get-ZabbixHost | ? name -eq HostName | Remove-ZabbixHost -WhatIf



Remove hosts (check only: -WhatIf)









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



PS C:\\>Get-ZabbixHost | ? name -eq HostName | Remove-ZabbixHost



Remove host









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



PS C:\\>Get-ZabbixHost | ? name -match HostName0[1-8] | Remove-ZabbixHost



Remove multiple hosts









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



PS C:\\>Get-ZabbixHost | Remove-ZabbixHost



Will delete ALL hosts from Zabbix











RELATED LINKS