SQL Version: 2016 SP2-CU13
Hello.
I am having difficulty with SQL Listeners computer objects remaining in Active Directory after the Listener (and Availability Group) have been deleted from SQL via TSQL.
The command I am running:
ALTER AVAILABILITY GROUP [@agname]REMOVE LISTENER N'@listener';
DROP AVAILABILITY GROUP [@agname]
The command is successful and the Availability Group and Listener no longer appear in any of the system tables in SQL but it does remain in AD in a disabled state.
Is there a way to have it removed from Active Directory instead of remaining in a disabled state? I could have it remove with a PowerShell command (Remove-ADComputer -Identity $listener), but I don't want to manipulate AD this way. I would rather SQL took care of it if possible.
It does remove the DNS entry.
Thank you.