Hi I'm trying to set the descriptor, but no success with: DirectoryEntry.Properties["msExchMailboxSecurityDescriptor"].Add (descriptor.bytes) DirectoryEntry.Properties["msExchMailboxSecurityDescriptor"].Value = descriptor.bytes; etc.. (Get an error message that the property already exist.) Anyone successfull in setting this property via the directoryEntry class ? How to do this with the Active DS type library is described in http://support.microsoft.com/default.aspx?scid=kb;en-us;304935 ... Audun
Have you tried retrieving the security descriptor and setting the parts you need. For instance for the Access Control List: ActiveDs.SecurityDescriptor objSD = (ActiveDs.SecurityDescriptor)DirectoryEntry.Properties["msExchMailboxSecurityDesciptor"].Value; ActiveDs.AccessControlEntry objDACL = objSD.DiscretionaryAcl; .... objSD.DiscretionaryAcl = newObjDACL; DirectoryEntry.CommitChanges(); Remember to add the ActiveDs Type Library to your project. - Bjørn Terje Svennes "Audun" wrote: > Hi > > I'm trying to set the descriptor, but no success with: > DirectoryEntry.Properties["msExchMailboxSecurityDescriptor"].Add > (descriptor.bytes) > DirectoryEntry.Properties["msExchMailboxSecurityDescriptor"].Value = > descriptor.bytes; > etc.. > (Get an error message that the property already exist.) > > Anyone successfull in setting this property via the directoryEntry class ? > How to do this with the Active DS type library is described in > http://support.microsoft.com/default.aspx?scid=kb;en-us;304935 ... > > Audun > > >
Oops. Forgot the: DirectoryEntry.Properties["msExchMailboxSecurityDesciptor"].Value = objSD; before calling CommitChanges. "Bjørn Terje Svennes" wrote: > Have you tried retrieving the security descriptor and setting the parts you > need. For instance for the Access Control List: > > ActiveDs.SecurityDescriptor objSD = > (ActiveDs.SecurityDescriptor)DirectoryEntry.Properties["msExchMailboxSecurityDesciptor"].Value; > ActiveDs.AccessControlEntry objDACL = objSD.DiscretionaryAcl; > > ... > > objSD.DiscretionaryAcl = newObjDACL; > DirectoryEntry.CommitChanges(); > > Remember to add the ActiveDs Type Library to your project. > > > - Bjørn Terje Svennes > > "Audun" wrote: > > > Hi > > > > I'm trying to set the descriptor, but no success with: > > DirectoryEntry.Properties["msExchMailboxSecurityDescriptor"].Add > > (descriptor.bytes) > > DirectoryEntry.Properties["msExchMailboxSecurityDescriptor"].Value = > > descriptor.bytes; > > etc.. > > (Get an error message that the property already exist.) > > > > Anyone successfull in setting this property via the directoryEntry class ? > > How to do this with the Active DS type library is described in > > http://support.microsoft.com/default.aspx?scid=kb;en-us;304935 ... > > > > Audun > > > > > >
This seems to worke fine: user.DirectoryEntry.Invoke("Put", new Object[] {"msExchMailboxSecurityDescriptor", descriptor.GetBytes()}); Uansett tusen takk ! Audun "Bjørn Terje Svennes" wrote: > Have you tried retrieving the security descriptor and setting the parts you > need. For instance for the Access Control List: > > ActiveDs.SecurityDescriptor objSD = > (ActiveDs.SecurityDescriptor)DirectoryEntry.Properties["msExchMailboxSecurityDesciptor"].Value; > ActiveDs.AccessControlEntry objDACL = objSD.DiscretionaryAcl; > > ... > > objSD.DiscretionaryAcl = newObjDACL; > DirectoryEntry.CommitChanges(); > > Remember to add the ActiveDs Type Library to your project. > > > - Bjørn Terje Svennes > > "Audun" wrote: > > > Hi > > > > I'm trying to set the descriptor, but no success with: > > DirectoryEntry.Properties["msExchMailboxSecurityDescriptor"].Add > > (descriptor.bytes) > > DirectoryEntry.Properties["msExchMailboxSecurityDescriptor"].Value = > > descriptor.bytes; > > etc.. > > (Get an error message that the property already exist.) > > > > Anyone successfull in setting this property via the directoryEntry class ? > > How to do this with the Active DS type library is described in > > http://support.microsoft.com/default.aspx?scid=kb;en-us;304935 ... > > > > Audun > > > > > >