' This script was originally published in the Exchange Cookbook, ' (http://www.exchangebookcook.com). Written by Paul Robichaux, ' Missy Koslosky, and Devin Ganger. Redistributed with permission ' of the publisher, O'Reilly & Associates. ' This code creates local replicas for all folders in the MAPI TLH ' ------ SCRIPT CONFIGURATION ------ strComputerName = "" 'e.g., "CONT-EXBE01" strPubMDBPath = "" ' ------ END CONFIGURATION --------- strE2K3WMIQuery = "winmgmts://" & strComputerName &_ "/root/MicrosoftExchangeV2" ' Get all the public folders in the MAPI TLH. ' For each folder, check to see if it has a local replica. ' If not, create one using the defined path name Set folderList = GetObject(strE2K3WMIQuery).InstancesOf(_ "Exchange_PublicFolder") WScript.Echo "Creating local replicas on server " & strComputerName For each Exchange_PublicFolder in folderList if (true = Exchange_PublicFolder.HasLocalReplica) Then WScript.Echo " - " & Exchange_PublicFolder.Name & _ ": already local" else Exchange_PublicFolder.AddReplica(strPubMDBPath) WScript.Echo " + " & Exchange_PublicFolder.Name end if Next WScript.Echo "Done creating replicas in " & strPubMDBPath & "."