Recipe 9.6. Getting Properties of the Public Folder TreeProblemYou want to see properties of the public folder trees (or TLHs) on your servers. SolutionUsing a graphical user interface
Using VBScript' This code displays selected properties of TLHs on a server ' ------ SCRIPT CONFIGURATION ------ strComputerName = "<serverName>" ' e.g., "cyclone" ' ------ END CONFIGURATION --------- strE2K3WMIQuery = "winmgmts://" & strComputerName &_ "/root/MicrosoftExchangeV2" Set wmiService = GetObject(strE2K3WMIQuery) Set treeList = wmiService.InstancesOf("Exchange_FolderTree") If (treeList.Count > 0) Then For Each tree In treeList wscript.echo " Tree '" & tree.name & "'" wscript.echo " Created: " & tree.CreationTime wscript.echo " Admin note: " & tree.AdministrativeNote wscript.echo " Associated stores: " & _ UBound(tree.AssociatedPublicStores) & " total" For i = 0 To UBound(tree.AssociatedPublicStores) wscript.echo " " & i & "==> " & _ tree.AssociatedPublicStores(i) next next WScript.Echo "Done processing folders." End if DiscussionThere aren't that many properties associated with public folder TLHs, but the ones that do exist are pretty interesting. For example, you can see a list of all the public folder stores associated with a particular TLH, and you can easily get the creation and modification timesvery useful when you're trying to determine which folders are old and unused as part of a migration. The WMI Exchange_FolderTree class definition on MSDN lists all the properties you can access. One useful attribute that WMI doesn't give you access to is the ACL on the TLH object; if you want to see or adjust its properties, you'll need to use the Security tab of the tree properties dialog in ESM. See AlsoMSDN: Exchange_FolderTree class |