We're using a powershell command to delete computer accounts from the domain. This works fine but even though it works, on refresh, the page shows essentially an 'Object Not found' message.
This makes sense as the object has been successfully deleted. Is there any way to override this behavior and show the user that "HEY THAT ACCOUNT WAS DELETED - GOOD JOB!" type message?
Here's the script we're using:
Import-Module Adaxes
# Get computer domain name
$domainName = $Context.GetObjectDomain("%distinguishedName%")
Remove-AdmComputer -Identity "%cn%" -server $domainName -AdaxesService localhost -Confirm:$False