r/PowerShell • u/ARSuperTech • Feb 26 '26
Question Trouble removing active Directory unknown SIDs
Hey Guys,
So, here goes. Active Directory cleanup time. I ran into some unknown SIDs that had permissions at the domain root and some other OUs of AD. I’ve double and triple checked and see that they are orphaned permissions.
When I try to remove from ADUC>security>advanced, I get a message warning me that the change I’m about to make will result in 122 new permissions being added to the access control list.
The first time I canceled out of that it updated the domain route permissions in a weird way, and there were several entries missing, except for the typical administrative groups, like administrators and domain admins. to restore the permissions from a back up that I took of the SDDL.
I tried doing it from ADSI edit but the same thing happened. I’ve also tried to script it and using CMD DSACLS to remove with no luck.
I need to remove these because the orphan SIDs have administrative delegated permissions on the root. Does anyone have any suggestions? Thanks in advance.
View all comments
Show parent comment
3
u/Pisnaz Feb 27 '26
Not sure who is down voting you but inheritance is my guess also. Pull acls as mentioned via powershell, or if you like the GUI, look at security once you enable the view in ADUC or similar. Personally powershell works better, dumped to csv maybe in a messy setup, but I am comfortable with it.
You should backup, and start cleaning up those acls. It seems daunting but is not that bad for most setups, the warnings, which are valid, seem intimidating but as they are inherited pulling one sid/user from the top takes it from everything below so starts to make sense when you review it.
If you want a cheat to do a dry run, build folders and test with ntfs permissions. It can help you evaluate safely and get a feel for what will happen with minimal hassle. It is similar, though ad permissions are way more complex depending on your setup.