#110427 - 2004-03-19 06:05 PM
Re: Using WMI to set ownership
|
Richie19Rich77
Seasoned Scripter
   
Registered: 2002-08-16
Posts: 624
Loc: London, England
|
Thanks Jim, got dizzy reading all the posts
|
Top
|
|
|
|
#185018 - 2008-02-01 02:18 PM
Re: Using WMI to set ownership
[Re: Sealeopard]
|
Arend_
MM club member
   
Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
|
Draggin up this old post again, just to point these things out:
1. No KiX still doesn't support this type of call (Ruud?!?!) 2. AdsSecurity does NOT allow to SET control flags. 3. The new and improved AdsSecurityUtility doesn't allow SET control flags either. 
Unfortunately to set Control flags you're going to need external .exe files or vbs.
Here is a small example to set inhertiance Flags on in vbs
Sub AllowInheritance(str_path)
Set objSecurity = GetObject("winmgmts:{(Security,Restore)}\\.\root\cimv2:Win32_LogicalFileSecuritySetting='" & str_path & "'")
'Get the Security Descriptor object (objSD)
objSecurity.GetSecurityDescriptor objSD
objSD.ControlFlags = 33796
'Write back the Security Descriptor
'j=objSecurity.SetSecurityDescriptor(objSD)
End sub
AllowInheritance("D:\test")
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 201 anonymous users online.
|
|
|