Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Simple XSD....

Status
Not open for further replies.

djtech2k

MIS
Jul 24, 2003
1,097
US
I am in need of an XSD and I feel like I am spinning wheels. I have never done one and I am trying but its not working. I am using Excel as my viewer of XML in this case just for ease of use and I know I have the software.

The XML data that I want to view is coming from an export from a tool called admodify. It is a dump of mailbox rights from Microsoft Exchange.

Anyway, I need to view it for analysis in Excel, but Excel does not build the XSD properly. Here is a sample of an export:

Code:
<MailboxRights><user UserDN="LDAP://CN=Administrator,CN=Users,DC=contoso,DC=demo"><Inherited><Entry Trustee="NT AUTHORITY\Authenticated Users" Mask="ACE_MB_FULL_ACCESS|Allowed ACE_MB_DELETE_MB_STORAGE|Allowed ACE_MB_READ_PERMISSIONS|Allowed ACE_MB_CHANGE_PERMISSION|Allowed ACE_MB_TAKE_OWNERSHIP|Allowed " /><Entry Trustee="CONTOSO\TEST-MACHINE" Mask="ACE_MB_FULL_ACCESS|Allowed ACE_MB_DELETE_MB_STORAGE|Allowed ACE_MB_READ_PERMISSIONS|Allowed ACE_MB_CHANGE_PERMISSION|Allowed ACE_MB_TAKE_OWNERSHIP|Allowed " /><Entry Trustee="CONTOSO\Exchange Domain Servers" Mask="ACE_MB_FULL_ACCESS|Denied " /><Entry Trustee="CONTOSO\Domain Admins" Mask="ACE_MB_FULL_ACCESS|Denied " /><Entry Trustee="CONTOSO\Enterprise Admins" Mask="ACE_MB_FULL_ACCESS|Denied " /><Entry Trustee="CONTOSO\Administrator" Mask="ACE_MB_FULL_ACCESS|Denied " /><Entry Trustee="Everyone" Mask="ACE_MB_READ_PERMISSIONS|Allowed " /><Entry Trustee="NT AUTHORITY\ANONYMOUS LOGON" Mask="ACE_MB_READ_PERMISSIONS|Allowed " /><Entry Trustee="CONTOSO\Exchange Domain Servers" Mask="ACE_MB_FULL_ACCESS|Allowed " /><Entry Trustee="CONTOSO\Exchange Domain Servers" Mask="ACE_MB_DELETE_MB_STORAGE|Allowed ACE_MB_READ_PERMISSIONS|Allowed ACE_MB_CHANGE_PERMISSION|Allowed ACE_MB_TAKE_OWNERSHIP|Allowed " /><Entry Trustee="CONTOSO\Administrator" Mask="ACE_MB_FULL_ACCESS|Allowed ACE_MB_DELETE_MB_STORAGE|Allowed ACE_MB_READ_PERMISSIONS|Allowed ACE_MB_CHANGE_PERMISSION|Allowed ACE_MB_TAKE_OWNERSHIP|Allowed " /><Entry Trustee="CONTOSO\Enterprise Admins" Mask="ACE_MB_FULL_ACCESS|Allowed ACE_MB_DELETE_MB_STORAGE|Allowed ACE_MB_READ_PERMISSIONS|Allowed ACE_MB_CHANGE_PERMISSION|Allowed ACE_MB_TAKE_OWNERSHIP|Allowed " /><Entry Trustee="CONTOSO\Domain Admins" Mask="ACE_MB_FULL_ACCESS|Allowed ACE_MB_DELETE_MB_STORAGE|Allowed ACE_MB_READ_PERMISSIONS|Allowed ACE_MB_CHANGE_PERMISSION|Allowed ACE_MB_TAKE_OWNERSHIP|Allowed " /></Inherited><NotInherited><Entry Trustee="NT AUTHORITY\SELF" Mask="ACE_MB_FULL_ACCESS|Allowed ACE_MB_READ_PERMISSIONS|Allowed " /></NotInherited></user><user UserDN="LDAP://CN=Test_User1,OU=TestOU,DC=contoso,DC=demo"><Inherited /><NotInherited><Entry Trustee="CONTOSO\ASPNET" Mask="ACE_MB_DELETE_MB_STORAGE|Allowed ACE_MB_CHANGE_PERMISSION|Allowed " /><Entry Trustee="CONTOSO\Cert Publishers" Mask="ACE_MB_FULL_ACCESS|Allowed ACE_MB_DELETE_MB_STORAGE|Allowed " /><Entry Trustee="NT AUTHORITY\SELF" Mask="ACE_MB_FULL_ACCESS|Allowed ACE_MB_READ_PERMISSIONS|Allowed " /></NotInherited></user><user UserDN="LDAP://CN=Test_User20,OU=TestOU,DC=contoso,DC=demo"><Inherited /><NotInherited><Entry Trustee="CONTOSO\Group Policy Creator Owners" Mask="ACE_MB_DELETE_MB_STORAGE|Allowed ACE_MB_READ_PERMISSIONS|Allowed ACE_MB_CHANGE_PERMISSION|Allowed " /><Entry Trustee="NT AUTHORITY\SELF" Mask="ACE_MB_FULL_ACCESS|Allowed ACE_MB_READ_PERMISSIONS|Allowed " /></NotInherited></user></MailboxRights>

Any help withi this is greatly appreciated.
 
One quick schema construction can be this.
[tt]
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema version="1.0" xmlns:xs="[ignore][/ignore]"
elementFormDefault="qualified">

<xs:element name="Entry">
<xs:complexType>
<xs:attribute name="Trustee" type="xs:string" />
<xs:attribute name="Mask" type="xs:string" />
</xs:complexType>
</xs:element>

<xs:complexType name="inheritanceType">
<xs:sequence>
<xs:element ref="Entry" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>

<xs:element name="user">
<xs:complexType>
<xs:sequence>
<xs:element name="Inherited" type="inheritanceType" />
<xs:element name="NotInherited" type="inheritanceType" />
</xs:sequence>
<xs:attribute name="UserDN" type="xs:string" />
</xs:complexType>
</xs:element>

<xs:element name="MailboxRights">
<xs:complexType>
<xs:sequence>
<xs:element ref="user" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>

</xs:schema>
[/tt]
 
Thanks tsuji, but thats kinda what I have now. The problsm is that when I view that in excel, it does not display how I need it to. Essentially the xml that I want to view is an export of mailbox permissions. In excel, I need a column for the user, trustee, access mask, and some way to know if it is inherited or not inherited. The problem with what I have is that instead of having an extra column for inherited (or not) it adds a second mask and 2nd trustee, which does not work with more than 1 or 2 mailboxes listed. I need to have either a column for every user/entry OR have it in 2 section...1 section for inherited and 1 section for not inherited. Keep in mind that I will be having hundreds of users in one xml file. The one I posted is like 3 mailboxes.

When I look at what I have, I cannot tell which permissions are inherited or not.

Does that make sense?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top