I am trying to remove an obsolete SID (the account was apparently deleted).

I've tried to run the following on the server (win2003) and a client (win7):

icacls c:\path /remove *S-1-5-21-1883347182-1220252494-433279356-1095 /T

But I always get the output

Successfully processed 0 files; Failed processing 0 files

without it doing anything. How can I get it to work?

Update:

I've used AccessEnum to get the SID because icacls only says "No mapping between account names and security IDs was done." but doesn't show the sid.

The output from AccessEnum is:

"Path"  "Read"  "Write" "Deny"  
"c:\path"   "Administrators, S-1-5-21-1883347182-1220252494-433279356-1095, ..."    "Administrators, S-1-5-21-1883347182-1220252494-433279356-1095, ..."    ""  
link|improve this question

Could you post a relevant snip of the output of icacls "C:\path"? Are you positive that SID is correct? – jscott Jul 30 '10 at 13:05
Yes, AFAIK the SID is correct - see my update. – chris Aug 2 '10 at 12:23
Does this SID have an entry in the ACL of the parent folder, C:\ in your question? If not, you may be able to use the /reset switch of icalcs -- e.g. icacls C:\path /reset /T – jscott Aug 5 '10 at 21:22
I also have this problem, and I see exactly the same behaviour from icacls... still looking for an answer. – Thanatos Oct 7 '10 at 23:55
feedback

3 Answers

up vote 0 down vote accepted

My suggestion to another similar question

"perhaps you're looking for SUBINACL. Download it here

subinacl.exe /help /cleandeletedsidsfrom provides the following:

/cleandeletedsidsfrom=domain[=dacl|sacl|owner|primarygroup|all]

delete all ACEs containing deleted (no valid) Sids from DomainName You can specify which part of the security descriptor will be scanned (default=all) If the owner is deleted, new owner will be the Administrators group. If the primary group is deleted, new primary group will be the Users group. Appears you can use this with /file or /share or /subdirectories as needed

link|improve this answer
feedback

You can easily do that with SetACL:

SetACL -on C:\Path -ot file -actn trustee -trst 
       "n1:S-1-5-21-1883347182-1220252494-433279356-1095;s1:y;ta:remtrst;w:dacl"
link|improve this answer
feedback

Why not just use the GUI? Bring up the folder properties and remove the unwanted SID from the security settings. That's always worked for me.

link|improve this answer
Yes, but we have thousands of folders! I would prefer to use the AccessEnum output in a script :) – chris Aug 3 '10 at 4:52
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.