FleetDM-PowerShell

PowerShell module for FleetDM API integration

View the Project on GitHub jorgeasaurus/FleetDM-PowerShell

Remove-FleetHost

SYNOPSIS

Removes hosts from FleetDM

SYNTAX

Remove-FleetHost [-Id] <Int32[]> [-Force] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm]
 [<CommonParameters>]

DESCRIPTION

Removes one or more hosts from FleetDM. Supports pipeline input for bulk operations. Use with caution as this operation cannot be undone.

EXAMPLES

EXAMPLE 1

Remove-FleetHost -Id 123

Removes host with ID 123 after confirmation

EXAMPLE 2

Remove-FleetHost -Id 123 -Force

Removes host with ID 123 without confirmation

EXAMPLE 3

Get-FleetHost -Status offline | Remove-FleetHost -Force

Removes all offline hosts without confirmation

EXAMPLE 4

@(123, 456, 789) | Remove-FleetHost -WhatIf

Shows what would happen if you removed hosts 123, 456, and 789

EXAMPLE 5

Get-FleetHost -Hostname "old-*" | Remove-FleetHost

Removes all hosts with hostnames starting with “old-“ after confirmation for each

PARAMETERS

-Id

The ID(s) of the host(s) to remove. Accepts pipeline input.

Type: Int32[]
Parameter Sets: (All)
Aliases: HostId

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-Force

Skip confirmation prompts

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

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

OUTPUTS

NOTES

https://fleetdm.com/docs/using-fleet/rest-api#delete-host