Remove devices from Domain

  • 30 September 2021
  • 3 replies
  • 45 views

Userlevel 2

Hi Team,

 

Is there any way, we can ‘Remove devices from Domain’ automatically instead of doing manually like shown below.

 


3 replies

Userlevel 2

Hi Rakesh,

 

If you want to Delete multiple devices from Domain by using a script. Then you can do it with the help of Qapp. 

Firstly, you need to create a Qapp and in the Canvas itself you need to add “Script”.

In that “Script” you can use our in-build function known as DeleteDevices. To import that function in your script and using it, you need to do as below:-

 

from netbrain.sysapi.datamodel import DeleteDevices
    DeleteDevices(list_of_device_name)

 

Noted: The input given to this function should be in the list format. e.g [device1, device2, device3]

Once, the devices are deleted from Domain. They can only be re-added by performing the Discovery Task again.

Userlevel 2
Badge

You can use the Delete Devices API to delete devices directly from a domain.
(https://github.com/NetBrainAPI/NetBrain-REST-API-R10)

For me, this would a bit dangerous though, I prefer to implement a step for a manual check in between.
Create a list of dismantled/removed devices (hostnames) from your asset management or CMDB.
Create a dedicated Device Group and use the Add Devices To Group API to fill the group.
Check the contents of the group before right-clicking to Remove from Domain. Or map the devices and do some reachability tests before removing.

Userlevel 2

Thanks Deepak and Carsten for your insights.

 

Carsten, I agree that it would be a best practice to ‘manually intervene’ before we do bulk removal of devices from domain.

Reply


Community |  Ideas

Facebook |  Instagram |  Youtube |  Twitter |  LinkedIn
Privacy & Security Statement  |  Terms & Conditions |  Impressum  |  UK Modern Slavery Statement