Howto delete computer with Python script with remove_referring

Hi,
i want to delete a computer in a Python script.
I know that the udm command could be (from solution)
udm computers/windows remove --dn=“cn=pc1,cn=computers,ou=ouname,dc=multi,dc=ucs” --remove_referring

In Python I get the object with udm package (UDM.admin.version(2).obj_by_dn())
But then I can do only a obj.delete() while I would do also with “–remove_referring”
How can this be achieved? (Or is this implicit done already)?
The delete operation also has optional parameter “remove_childs=True” where I am not sure if this is the same as remove_referring

Could you please give advice to the right way to delete computer object and all associated parts?

------------- Deutsch ------------
In einem Python script soll ein Computer-Objekt gelöscht werden mit der Option “remove_referring”
Der Parameter kann ja beim UDM Befehl mit angegeben werden. Wie kann man es im Script erreichen?
Derzeit hole ich das Objekt mit UDM.admin.version(2).obj_by_dn() und lösche es mit
obj.delete(). Die Delete Methode hat wohl auch den Parameter “remove_childs=True”. Ich bin mir nicht sicher, ob damit dasselbe gemeint sein könnte wie bei referring.
Wie kann man mit Python das Computerobjekt vollständig löschen?

Thanks & regards, Michael

Hey,

I was looking at the UCS documentation and by pure luck I came across this:

https://docs.software-univention.de/ext-windows/latest/en/index.html#deinstallation-of-a-samba-ad-domain-controller

There’s a python script used to remove primary but I suppose you could use this to tamper with any other or look at the code and make your own.

Mastodon