Skip to content

Delete unit

Deletes a unit.

The Windows user who runs the script needs administrator rights for units on the Management Point that the unit belongs to. If several units have the same name, use the UUID to make sure that you delete the right unit.

DeleteUnit(Byval UnitName as String, Byval UnitType as String) as Boolean

UnitName (String)

The name or UUID of the unit.

UnitType (String)

Type of Unit

  • Computer
  • User

Boolean. The function returns True if successful, otherwise false.

Set oCMS = CreateObject("CapaInstaller.SDK")
wscript.echo oCMS.SetInstanceManagementPoint("1")
Wscript.echo oCMS.DeleteUnit("Klient","Computer")