in ad-joining/register-computer/ad/domain.py [0:0]
def remove_computer_upn(self, ou, computer_name):
try:
self.__connection.modify(
"CN=%s,%s" % (computer_name, ou),
{
"userPrincipalName": [(ldap3.MODIFY_DELETE, [])]
})
except ldap3.core.exceptions.LDAPAttributeOrValueExistsResult as e:
raise AlreadyExistsException(e)