I need to create a remote share and then assign variable amount of
ACEs to a DACL. Unlike to the below example, where the author used two
ACEs, I need to dynamically add ACE according the entries the user
specifies. This means that the user can enter three ACEs and on
another occasion the method housing the assignment will need to handle
4 or more ACEs. Unfortunately it seems that one cannot assign an array
to the secDescriptor["DACL"] =.
Would appreciate your assistance.
//==2. Create Win32_SecurityDescriptor
ManagementObject secDescriptor = new ManagementClass(new
ManagementPath("Win32_SecurityDescriptor"), null);
secDescriptor["ControlFlags"] = 4; //SE_DACL_PRESENT
//secDescriptor["DACL"] = new object[] { AdminACE };
secDescriptor["DACL"] = new object[] { HelpDeskACE,AdminACE
Thanks