Accessing the Properties of Custom Resource Mailbox Resources in Active Directory
(This post refers to Exchange 2010, but the resource mailbox capabilities were introduced in Exchange 2007)
Exchange allows you to create different types of conference room mailboxes โ resource mailboxes โ and assign custom properties to them, for example. Whiteboard, A / V. These properties seem to be logical, for example. the conference room has a board or not. You can assign them to a mailbox in the Exchange 2010 Management Console (or in the Shell).
I am trying to figure out how to programmatically access these properties. The EWS API does not appear to be intended to do this, as all underlying data ends up being stored in Active Directory.
For example, one of the properties unique to a conference room mailbox is resource capacity, and you can get this from Active Directory as follows:
child.Properties["msExchResourceCapacity"]
Where child represents a DirectoryEntry object because you are iterating over the contents of Active Directory ou.
After looking at the Active Directory schema at http://msdn.microsoft.com/en-us/library/ms675085(VS.85).aspx nothing jumped at me.
thank
source to share
Custom resource properties ( msExchResourcePropertySchema
Whiteboard , A / V in your question) are stored in the Active Directory configuration section in a multivalued -tribute CN=Resource Schema,CN=Global Settings,CN=Exchange 2010,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=ex2010,DC=lab
. (So โโyou won't find this information when you connect to DC=ex2010,DC=lab
- you need to connect to the Configuration Partition namespace - CN=Configuration,DC=ex2010,DC=lab
.)
You need to use the Set-ResourceConfig cmdlet to add custom custom resource properties (for example:) Set-ResourceConfig -DomainController dc01.ex2010.lab -ResourcePropertySchema ("Room/16Seats","Equipment/Projector","Room/8Seats","Equipment/Whiteboard")
. Then you need to use the Set-MailBox cmdlet (i.e. Set-MailBox roomtest -ResourceCustom "8Seats"
) to set custom resource properties for that specific resource mailbox.
I would advise against setting these Exchange-specific attributes manually (that is, via System.DirectoryServices) as this can lead to unpredictable results. The supported way is to use cmdlets. Therefore, I would recommend that you call the cmdlets from your .NET code. To get started, a tutorial on CodeProject .
source to share