I have tried a few permission scenarios: As expected, I
do not have any problem taking ownership via my script if
Everyone or local administrators have full control. If I
give Everyone read access, as expected, I get a 2.
It looks like I have now have good code, at least in terms
of it working with certain types of permissions, but this
seems to fall well short of the TakeOwnerShipEx method's
full intent.
Am I not calling the GetObject with the correct security
context?
Sorry we missed it earlier, it has been there for a long while, but the bug
has been reported in our bug database.
Your script is good, the method is bad. As a possible workaround, you may
want to explore using the Win32_Directory.ChangeSecurityPermissionsEx method
to give full access, follow it up with your script to take ownership, and
then call Win32_directory.ChangeSecurityPermissionsEx method again to set
the EveryOne read only privilege back.
--
[MS] Scott McNairy
WMI Test Engineer
This posting is provided "As Is" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
<JayW...@SysMatrix.Net> wrote in message
news:14e4d01c22847$d1172820$36ef2ecf@tkmsftngxa12...