Recipe6.5.Creating a Public Folder Database


Recipe 6.5. Creating a Public Folder Database

Problem

You want to create an additional public folder database to host your applications.

Solution

Using a graphical user interface

To create an additional public folder hierarchy, do the following:

  1. Launch the Exchange System Manager (Exchange System Manager.msc).

  2. In the left pane, expand the appropriate Administrative Groups container, and then expand the Folders container.

  3. Right-click the Folders container and choose New Public Folder Tree.

  4. In the Properties dialog box, name the tree and click OK.

To create an additional public folder database, do the following:

  1. Launch the Exchange System Manager (Exchange System Manager.msc).

  2. In the left pane, expand the appropriate Administrative Groups container, and then expand the Servers container.

  3. Expand the server that contains the target storage group.

  4. Right-click the target storage group, then choose New Public Folder Store. (Note that ESM will complain if you haven't already created an additional tree for the new store, but it will open the Properties dialog anyway.)

  5. Name the public folder store, then use the Browse button to associate it with a public folder tree.

  6. Optionally, use the Database tab to select a location for the EDB and STM files.

  7. Optionally, use the Limits and Full-Text Indexing tabs to adjust properties on the database.

  8. Optionally, use the Replication tab to set the replication schedule and limits for this public folder.

  9. Click OK. ESM will display a confirmation dialog to ask if you want the store mounted or not. Click Yes to mount the store or No to leave it unmounted.

Using VBScript
' This code creates an additional public folder tree and a database within it, ' then mounts the new database ' ------ SCRIPT CONFIGURATION ------  strServerName = "<serverName>"    ' e.g., "BATMAN"      strPFDBName = "<newDBName>" ' e.g., "SpiffyNewPFDatabase01"  strPFTreeName = "<newTreeName>" ' New PF Tree  strAdminGroup = "<yourAdminGroupName>" ' e.g., "First Administrative Group"  strOrgName = "<yourOrgName>"        ' e.g., "First Organization"  strDomain = "dc=contoso,dc=local"  ' ------ END CONFIGURATION --------- Set theServer = CreateObject("CDOEXM.ExchangeServer") Set theNewTree = CreateObject("CDOEXM.FolderTree") Set theDSE =  GetObject("LDAP://RootDSE") Set thePFDB = CreateObject("CDOEXM.PublicStoreDB") ' create the public tree. You could dynamically get the AG and org ' name but for simplicity we're defining them statically strTreeURL = "LDAP://CN=" & strPFTreeName & ",CN=Folder Hierarchies" & _    ",CN=" & strAdminGroup & ",CN=Administrative Groups,CN=" & strOrgName & _    ",CN=Microsoft Exchange,CN=Services,CN=Configuration," & _    theDSE.Get("defaultnamingcontext") theNewTree.name = strPFTreeName  theNewTree.DataSource.SaveTo strTreeURL thePFDB.Name = strPFDBName thePFDB.FolderTree = strTreeURL ' Get the first SG theServer.DataSource.Open strServerName arrSG = theServer.StorageGroups   theFirstSG = sg   Exit for Next ' Create the URL to the new PF, then create and mount it strPFURL = "LDAP://" & theServer.DirectoryServer & "/CN=" & strPFDBName & "," & _            theFirstSG thePFDB.DataSource.SaveTo strPFURL thePFDB.Mount

Discussion

Exchange 2000 and 2003 support multiple public folder hierarchies (also known as top-level hierarchies (TLHs) or public folder trees). When you initially install Exchange 2000 or Exchange Server 2003 Server's, you automatically get a TLH that's accessible to MAPI clients; this is where user-accessible public folders are stored. There's a catch, though: there can be only one TLH accessible to MAPI clients. Clients that use NNTP or the WebDAV extensions to HTTP can use non-MAPI TLHs, but you must first create at least one non-MAPI TLH before you can add more than one public folder store to a SG. If you don't have a public store at all, when you create one, it's automatically associated with the default MAPI TLH.

Using VBScript

The code creates a public folder tree in the Exchange organization's Folder Hierarchies object by instantiating a new CDOEXM.FolderTree object and settings its URL to the specified name, along with the rest of the standard folder hierarchies' tree name. Once the tree is created, the script locates the first SG and uses its URL as the base to create a new public folder database in the new tree.

See Also

Recipe 9.5 for forcing replication of a public folder hierarchy, Recipe 9.6 for getting properties of a public folder tree, Recipe 9.7 for creating and removing public folders, and MS KB 255077 (HOW TO: Create a New Public Folder Tree and Store in Exchange)



Exchange Server Cookbook
Exchange Server Cookbook: For Exchange Server 2003 and Exchange 2000 Server
ISBN: 0596007175
EAN: 2147483647
Year: 2006
Pages: 235

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net