Exchange 2003 Public folder Administrative rights
I have Exchange 2003 in Native-mode. How can i change Administrative permissions to public folders using VBScript or something command-line utility? I've tried edit "admindescriptor" WebDAV attribute, but failed at it. I've got 400 error. Here's
an example of my test script:
strResFile = ".\" & WScript.ScriptName & ".txt"
Set FSO = CreateObject("Scripting.FileSystemObject")
Set ResFile = FSO.OpenTextFile(strResFile, 2, True)
set req = CreateObject("microsoft.xmlhttp")
folderurl = "http://EXCHANGE-SERVER/ExAdmin/Admin/example.com/public folders/test/"
NewXMLReq = "<?xml version='1.0'?>"
NewXMLReq = NewXMLReq & "<d:propertyupdate xmlns:d='DAV:' xmlns:S='http://schemas.microsoft.com/security/' xmlns:exsec='urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/' exsec:dt='microsoft.security_descriptor' S:from_mapi_tlh='1'>"
NewXMLReq = NewXMLReq & "<d:set>"
NewXMLReq = NewXMLReq & "<d:prop>"
NewXMLReq = NewXMLReq & "<exsec:admindescriptor>"
NewXMLReq = NewXMLReq & "<S:security_descriptor>"
NewXMLReq = NewXMLReq & "<S:dacl S:defaulted='0' S:protected='1' S:autoinherited='0'>"
NewXMLReq = NewXMLReq & "<S:effective_aces>"
NewXMLReq = NewXMLReq & "<S:access_allowed_object_ace S:inherited='0'>"
NewXMLReq = NewXMLReq & "<S:access_mask>100</S:access_mask>"
NewXMLReq = NewXMLReq & "<S:sid>"
NewXMLReq = NewXMLReq & "<S:string_sid>S-1-5-21-2856554560-2810845470-2975245544-101316</S:string_sid>"
NewXMLReq = NewXMLReq & "<S:type>user</S:type>"
NewXMLReq = NewXMLReq & "<S:nt4_compatible_name>EXAMPLE\user</S:nt4_compatible_name>"
NewXMLReq = NewXMLReq & "<S:ad_object_guid>{c79a2523-873b-49fc-b9f8-9c364f703f1e}</S:ad_object_guid>"
NewXMLReq = NewXMLReq & "<S:display_name>Example User</S:display_name>"
NewXMLReq = NewXMLReq & "</S:sid>"
NewXMLReq = NewXMLReq & "<S:object_type>{d74a8769-22b9-11d3-aa62-00c04f8eedd8}</S:object_type>"
NewXMLReq = NewXMLReq & "</S:access_allowed_object_ace>"
NewXMLReq = NewXMLReq & "</S:effective_aces>"
NewXMLReq = NewXMLReq & "<S:subcontainer_inheritable_aces>"
NewXMLReq = NewXMLReq & "<S:access_allowed_object_ace S:inherited='0' S:no_propagate_inherit='0'>"
NewXMLReq = NewXMLReq & "<S:access_mask>100</S:access_mask>"
NewXMLReq = NewXMLReq & "<S:sid>"
NewXMLReq = NewXMLReq & "<S:string_sid>S-1-5-21-2856554560-2810845470-2975245544-101316</S:string_sid>"
NewXMLReq = NewXMLReq & "<S:type>user</S:type>"
NewXMLReq = NewXMLReq & "<S:nt4_compatible_name>EXAMPLE\user</S:nt4_compatible_name>"
NewXMLReq = NewXMLReq & "<S:ad_object_guid>{c79a2523-873b-49fc-b9f8-9c364f703f1e}</S:ad_object_guid>"
NewXMLReq = NewXMLReq & "<S:display_name>Example User</S:display_name>"
NewXMLReq = NewXMLReq & "</S:sid>"
NewXMLReq = NewXMLReq & "<S:object_type>{d74a8769-22b9-11d3-aa62-00c04f8eedd8}</S:object_type>"
NewXMLReq = NewXMLReq & "</S:access_allowed_object_ace>"
NewXMLReq = NewXMLReq & "</S:subcontainer_inheritable_aces>"
NewXMLReq = NewXMLReq & "</S:dacl>"
NewXMLReq = NewXMLReq & "</S:security_descriptor>"
NewXMLReq = NewXMLReq & "</exsec:admindescriptor>"
NewXMLReq = NewXMLReq & "</d:prop>"
NewXMLReq = NewXMLReq & "</d:set>"
NewXMLReq = NewXMLReq & "</d:propertyupdate>"
WScript.Echo NewXMLReq
ResFile.WriteLine NewXMLReq
req.open "PROPPATCH", folderurl, false
req.setRequestHeader "Content-Type", "text/xml"
req.setRequestHeader "Depth", "0"
req.send NewXMLReq
set oResponseStatus = req.Status
set oResponseDoc = req.responseXML
WScript.Echo oResponseStatus
WScript.Echo oResponseDoc
December 20th, 2010 10:47pm