Sac
Guest
|
Posted:
Thu Nov 17, 2005 5:58 pm Post subject:
Listing public folders |
|
|
I want to list the public folders to find the disk usage of each one and get
the sum.
I am using following code for the same,
query = String.Format("Select Path, TotalMessageSize,
StorageLimitStyle, ProhibitPostLimit, ReplicaList from Exchange_PublicFolder
where
FolderTree='Exchange_FolderTree.Name=\"{0}\",AdministrativeGroup=\"{1}\"'",
folderTree.Name, folderTree.AdministrativeGroup);
ManagementScope oMs = new
ManagementScope(String.Format("\\\\{0}\\root\\MicrosoftExchangeV2",
serverName));
ObjectQuery objQuery = new ObjectQuery(query);
ManagementObjectSearcher searcher = new
ManagementObjectSearcher(oMs,objQuery);
objectCollection = searcher.Get();
This code returns public folders list but only for root public folders. It
does not list child public folders.
This problem is observed only after installing Exchange 2003 service pack 2.
Before it was listing child public folders as well.
Any one have any idea?
I tried another way which works but I want to use Query which is not
possible in this ways,
ManagementScope oMs = new
ManagementScope(String.Format("\\\\{0}\\root\\MicrosoftExchangeV2",
serverName));
ManagementPath managemetPath = new
ManagementPath(String.Format("\\root\\MicrosoftExchangeV2:{0}", path));
ObjectGetOptions objectGetOptions = new ObjectGetOptions();
ManagementClass managementClass = new ManagementClass(oMs,
managemetPath, objectGetOptions);
objectCollection = managementClass.GetInstances();
Can anyone help me knowing what is going wrong with first method? What is
changed in Exchange 2003 SP2? Is there any other way to enumerate public
folder data efficiently?
|
|