I need to build a script which check if the current user has rights to delete a special AD object and if this is the case the powershell script can delete it.
Deleting an AD object isn´t the issue, the question I have is more how to check if the current user (which runs the script) has the right to do so? Use a try/catch seamed not the best way I think.
Any good idea?