Hi Team,
Is there any way, we can ‘Remove devices from Domain’ automatically instead of doing manually like shown below.
Hi Team,
Is there any way, we can ‘Remove devices from Domain’ automatically instead of doing manually like shown below.
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 tdevice1, device2, device3]
Once, the devices are deleted from Domain. They can only be re-added by performing the Discovery Task again.
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.
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.
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.