Thursday, March 22, 2012

Neat little trick I learned tonight

And it seems fairly stupid too-

For some reason, I couldn't replace the owner on a file using powershell directly. Doubting myself, I went and found a script someone else had written (powershell team blog), and that failed as well! The error given is "Set-Acl : The security identifier is not allowed to be the owner of this object.". Well that sucks. So I did some more digging, and came across a solution- apparently windows server 2008 will let you do this, if you use the UNC path for your filenames. Why that makes a difference, who knows.

Any why was any of that important? because like a dummy, I blew away a hyper-v virtual machine without realizing I wasn't done with it, and had to recover it using Piriform Recurva. Great product, but it didn't restore the ACL's correctly, and I couldn't reassign the ACL directly. So I had to copy them from a file that still had the correct ACL. Worked like a charm, and now I'm happy once again. Well, as happy as I get anyway.

Where did I get the idea? from Fixing IT. Thanks, I appreciate it.

No comments:

Post a Comment