Exchange_PublicFolder Class

Exchange_PublicFolder Class

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

The Exchange_PublicFolder WMI class provides properties and methods for working with Microsoft® Exchange public folders.




The ExchangePublicFolderProvider supplies instances of the Exchange_PublicFolder class.


The Exchange_PublicFolder class extends the CIM_LogicalElement class.




Property Description
Url Property
[key, read] string Url;

The Url property indicates the folder URL, constructed using the folder globally unique identifier (GUID).

AddressBookName Property
 write] string AddressBookName;

The AddressBookName property specifies the address book name of the folder.

AdministrativeNote Property
 write] string AdministrativeNote;

The AdministrativeNote property specifies the administrative note associated with the folder.

AdminSecurityDescriptor Property
 write] uint8 AdminSecurityDescriptor

The AdminSecurityDescriptor property specifies the security descriptor that is used when a user logs on to the store with administrative privileges.

ADProxyPath Property
[read] string ADProxyPath;

The ADProxyPath property indicates the GUID of the Microsoft Active Directory® mail proxy for the folder.

AssociatedMessageCount Property
[read] uint32 AssociatedMessageCount;

The AssociatedMessageCount property is a MAPI property that contains the total number of associated messages in the public folder.

AttachmentCount Property
[read] uint32 AttachmentCount;

The AttachmentCount property indicates the total number of attachments on all normal messages in a folder.

CategorizationCount Property
[read] uint32 CategorizationCount;

The CategorizationCount property indicates the total number of categorizations on the public folder.

Comment Property
[read, write] string Comment;

The Comment property specifies the folder comment.

ContactCount Property
[read] uint32 ContactCount;

The ContactCount property indicates the number of contacts in a public folder.

ContainsRules Property
[read] boolean ContainsRules;

The ContainsRules property indicates whether the public folder contains rules.

CreationTime Property
[read] datetime CreationTime;

The CreationTime property indicates when the folder was created.

DeletedItemLifetime Property
 units("days")] uint32 DeletedItemLifetime;

The DeletedItemLifetime property specifies how long, in days, that deleted messages can be recovered.

FolderTree Property
[read] string FolderTree;

The FolderTree property indicates the WMI path to the top-level hierarchy object to which the folder belongs.

FriendlyUrl Property
[read] string FriendlyUrl;

The FriendlyUrl property indicates the path-based URL to the folder.

HasChildren Property
[read] boolean HasChildren;

The HasChildren property indicates whether the folder has subfolders.

HasLocalReplica Property
[read] boolean HasLocalReplica;

The HasLocalReplica property indicates whether the folder has a local replica.

IsMailEnabled Property
 write] boolean IsMailEnabled;

The IsMailEnabled property specifies whether the folder is mail-enabled.

IsNormalFolder Property
[read] boolean IsNormalFolder;

The IsNormalFolder property indicates whether the public folder is a normal folder.

IsPerUserReadDisabled Property
 write] boolean IsPerUserReadDisabled;

The IsPerUserReadDisabled property specifies whether the folder tracks per-user read information for messages.

IsSearchFolder Property
[read] boolean IsSearchFolder;

The IsSearchFolder property indicates whether the public folder is a search folder.

IsSecureInSite Property
 write] boolean IsSecureInSite;

The IsSecureInSite property specifies whether administrative access is limited to the home site of the folder.

LastAccessTime Property
[read] datetime LastAccessTime;

The LastAccessTime property indicates the last date that the replica of a public folder was accessed.

LastModificationTime Property
[read] datetime LastModificationTime;

The LastModificationTime property indicates when the folder was last modified.

MaximumItemSize Property
 units("KB")] uint32 MaximumItemSize;

The MaximumItemSize property specifies the maximum size, in kilobytes (KB), that is allowed for an individual post to the folder.

MessageCount Property
[read] uint32 MessageCount;

The MessageCount property indicates the number of messages in a public folder.

MessageWithAttachmentsCount Property
[read] uint32 MessageWithAttachmentsCount;

The MessageWithAttachmentsCount property indicates the total number of normal messages with attachments in the public folder.

Name Property
 required] string Name = NULL;

The Name property indicates the name of the folder.

NormalMessageSize Property
 units("bytes")] uint32 NormalMessageSize;

The NormalMessageSize property indicates the total size, in bytes, of all of the normal messages in the public folder.

OwnerCount Property
[read] uint32 OwnerCount;

The OwnerCount property indicates the number of owners of the public folder.

ParentFriendlyUrl Property
 required] string ParentFriendlyUrl;

The ParentFriendlyUrl property indicates the folder path-based URL to the parent of the folder.

Path Property
[read] string Path;

The Path property indicates the folder path minus the URL http://server/vroot header portion.

ProhibitPostLimit Property
 units("KB")] uint32 ProhibitPostLimit;

The ProhibitPostLimit property specifies the folder size limit, in KB, when posting is prevented.

PublishInAddressBook Property
 write] boolean PublishInAddressBook;

The PublishInAddressBook property specifies whether the folder will show up in the global address list if it is mail-enabled.

RecipientCountOnAssociatedMessages Property
[read] uint32 RecipientCountOnAssociatedMessages;

The RecipientCountOnAssociatedMessages property indicates the total number of recipients on the associated messages in the public folder.

RecipientCountOnNormalMessages Property
[read] uint32 RecipientCountOnNormalMessages;

The RecipientCountOnNormalMessages property indicates the total number of recipients on the normal messages in the public folder.

ReplicaAgeLimit Property
 units("days")] uint32 ReplicaAgeLimit;

The ReplicaAgeLimit property specifies the age limit for messages across all replicas.

ReplicaList Property
[read] string ReplicaList[];

The ReplicaList property indicates the list of distinguished names of the MDBs to which the folder is replicated.

ReplicationMessagePriority Property
 Values{"Not Urgent", "Normal",
 ValueMap{"0", "1", "2"}] uint32 ReplicationMessagePriority;

The ReplicationMessagePriority property specifies the priority level for replicating folder messages.

ReplicationSchedule Property
 write] Exchange_ScheduleInterval ReplicationSchedule

The array elements of the ReplicationSchedule property specify the replication schedule of the folder. Each element of the array is an instance of the Exchange_ScheduleInterval Class.

ReplicationStyle Property
 Values{"Custom", "Never", "Always",
   "Every hour", "Every two hours",
   "Every four hours", "Use public store schedule"},
 ValueMap{"0", "1", "2", "3",
   "4", "5", "6"}] uint32 ReplicationStyle;

The ReplicationStyle property specifies how often the folder contents are replicated.

RestrictionCount Property
[read] uint32 RestrictionCount;

The RestrictionCount property indicates the total number of restrictions on the public folder.

SecurityDescriptor Property
 write] uint8 SecurityDescriptor

The SecurityDescriptor property specifies the administrative security descriptor for the folder.

StorageLimitStyle Property
 Values{"Use public store style",
   "Use Specified Quota", "No Quota"},
 ValueMap{"0", "1", "2"}] uint32 StorageLimitStyle;

The StorageLimitStyle property specifies whether the folder should use public store storage limits, have no quota, or use quota values set on the folder.

TargetAddress Property
[read] string TargetAddress;

The TargetAddress property is a MAPI property that contains the e-mail address of the public folder.

TotalMessageSize Property
 units("bytes")] uint32 TotalMessageSize;

The TotalMessageSize property indicates the total size, in bytes, of all of the normal messages in the public folder. The TotalMessageSize property is an 8-byte version of the NormalMessageSize property.

UsePublicStoreAgeLimits Property
 write] boolean UsePublicStoreAgeLimits;

The UsePublicStoreAgeLimits property specifies whether the folder should use the age limits of the message database (MDB) in which it is stored.

UsePublicStoreDeletedItemLifetime Property
 write] boolean UsePublicStoreDeletedItemLifetime;

The UsePublicStoreDeletedItemLifetime property specifies whether the folder should use the deleted item lifetime of the local public MDB.

WarningLimit Property
 units("KB")] uint32 WarningLimit;

The WarningLimit property specifies the folder size limit, in KB, when warning messages are sent.


Method Description
AddReplica Method
[implemented] void AddReplica(
  [IN] string Path);

The AddReplica method adds the MDB (Path=DN) to the replica list for the folder.

Copy Method
[implemented] void Copy(
  [IN] string FriendlyUrl);

The Copy method copies the folder to another location in the hierarchy.

Move Method
[implemented] void Move(
  [IN] string FriendlyUrl);

The Move method moves the folder within the hierarchy.

PropagateSettings Method
[implemented] void PropagateSettings(
   Bitmap{"0", "1", "2", "3",
     "4", "5", "6", "7", "8", "9",
     "10", "11"},
     "AgeLimits", "DeletedItemLifetime",
     "FolderRights", "IsPerUserReadDisabled",
     "IsMailEnabled", "ReplicaList",
     "ReplicationSchedule", "PublishInAddressBook",
     "StorageLimits"}] uint32 Settings, 
   OPTIONAL] boolean StopOnError = TRUE);

The PropagateSettings method propagates the folder settings to all of its children.

RemoveReplica Method
[implemented] void RemoveReplica(
  [IN] string Path);

The RemoveReplica method removes the MDB (in Path=DN format) from the replica list for the folder.

Rename Method
[implemented] void Rename(
  [IN] string Name);

The Rename method renames the folder.

SendChanges Method
[implemented] void SendChanges(
  [IN] uint32 Days, 
  [IN] string Paths[]);

The SendChanges method sends all folder modifications to the folder replicas specified in the Paths parameter.

Synchronize Method
[implemented] void Synchronize();

The Synchronize method forces the folder to request any outstanding change notifications it may have.


This class has no associations.

VBScript Example

The following example shows how to retrieve a list of Exchange_PublicFolder instances, and how to retrieve all the associated properties.

' Purpose:   Display each Exchange_PublicFolder found for Exchange server,
'            and show all properties on the Exchange_PublicFolder
'            objects
' Change:    cComputerName [string] the computer to access
' Output:    Displays the name of each Exchange_PublicFolder and properties

On Error Resume Next
Dim cComputerName
Const cWMINameSpace = "root/MicrosoftExchangeV2"
Const cWMIInstance = "Exchange_PublicFolder"
cComputerName = "MyComputerNETBIOSName"

Dim strWinMgmts		' Connection string for WMI
Dim objWMIExchange	' Exchange Namespace WMI object
Dim listExchange_PublicFolders	' ExchangeLogons collection
Dim objExchange_PublicFolder		' A single ExchangeLogon WMI object

' Create the object string, indicating WMI (winmgmts), using the
' current user credentials (impersonationLevel=impersonate),
' on the computer specified in the constant cComputerName, and
' using the CIM namespace for the ExchangeClusterResource provider.
strWinMgmts = "winmgmts:{impersonationLevel=impersonate}!//"& _
Set objWMIExchange =  GetObject(strWinMgmts)
' Verify we were able to correctly set the object.
If Err.Number <> 0 Then
  WScript.Echo "ERROR: Unable to connect to the WMI namespace."
  ' The Resources that currently exist appear as a list of
  ' ExchangeLogon instances in the Exchange namespace.
  Set listExchange_PublicFolders = objWMIExchange.InstancesOf(cWMIInstance)
  ' Were any Exchange_PublicFolder Instances returned?
  If (listExchange_PublicFolders.count > 0) Then
    ' If yes, do the following:
    ' Iterate through the list of Exchange_PublicFolder objects.
    For Each objExchange_PublicFolder in listExchange_PublicFolders
       ' Display the value of the AddressBookName property.
       WScript.echo "AddressBookName          = "& _
        " ["&TypeName(objExchange_PublicFolder.AddressBookName)&"] "& _
       ' Display the value of the AdministrativeNote property.
       WScript.echo "AdministrativeNote       = "& _
        " ["&TypeName(objExchange_PublicFolder.AdministrativeNote)&"] "& _
       ' Display the value of the AdminSecurityDescriptor property.
       WScript.echo "AdminSecurityDescriptor  = "& _
        " ["&TypeName(objExchange_PublicFolder.AdminSecurityDescriptor)&"] "& _
       ' Display the value of the ADProxyPath property.
       WScript.echo "ADProxyPath              = "& _
        " ["&TypeName(objExchange_PublicFolder.ADProxyPath)&"] "& _
       ' Display the value of the AssociatedMessageCount property.
       WScript.echo "AssociatedMessageCount   = "& _
        " ["&TypeName(objExchange_PublicFolder.AssociatedMessageCount)&"] "& _
       ' Display the value of the AttachmentCount property.
       WScript.echo "AttachmentCount          = "& _
        " ["&TypeName(objExchange_PublicFolder.AttachmentCount)&"] "& _
       ' Display the value of the CategorizationCount property.
       WScript.echo "CategorizationCount      = "& _
        " ["&TypeName(objExchange_PublicFolder.CategorizationCount)&"] "& _
       ' Display the value of the Comment property.
       WScript.echo "Comment                  = "& _
        " ["&TypeName(objExchange_PublicFolder.Comment)&"] "& _
       ' Display the value of the ContactCount property.
       WScript.echo "ContactCount             = "& _
        " ["&TypeName(objExchange_PublicFolder.ContactCount)&"] "& _
       ' Display the value of the ContainsRules property.
       WScript.echo "ContainsRules            = "& _
        " ["&TypeName(objExchange_PublicFolder.ContainsRules)&"] "& _
       ' Display the value of the CreationTime property.
       WScript.echo "CreationTime             = "& _
        " ["&TypeName(objExchange_PublicFolder.CreationTime)&"] "& _
       ' Display the value of the DeletedItemLifetime property.
       WScript.echo "DeletedItemLifetime      = "& _
        " ["&TypeName(objExchange_PublicFolder.DeletedItemLifetime)&"] "& _
       ' Display the value of the FolderTree property.
       WScript.echo "FolderTree               = "& _
        " ["&TypeName(objExchange_PublicFolder.FolderTree)&"] "& _
       ' Display the value of the FriendlyUrl property.
       WScript.echo "FriendlyUrl              = "& _
        " ["&TypeName(objExchange_PublicFolder.FriendlyUrl)&"] "& _
       ' Display the value of the HasChildren property.
       WScript.echo "HasChildren              = "& _
        " ["&TypeName(objExchange_PublicFolder.HasChildren)&"] "& _
       ' Display the value of the HasLocalReplica property.
       WScript.echo "HasLocalReplica          = "& _
        " ["&TypeName(objExchange_PublicFolder.HasLocalReplica)&"] "& _
       ' Display the value of the IsMailEnabled property.
       WScript.echo "IsMailEnabled            = "& _
        " ["&TypeName(objExchange_PublicFolder.IsMailEnabled)&"] "& _
       ' Display the value of the IsNormalFolder property.
       WScript.echo "IsNormalFolder           = "& _
        " ["&TypeName(objExchange_PublicFolder.IsNormalFolder)&"] "& _
       ' Display the value of the IsPerUserReadDisabled property.
       WScript.echo "IsPerUserReadDisabled    = "& _
        " ["&TypeName(objExchange_PublicFolder.IsPerUserReadDisabled)&"] "& _
       ' Display the value of the IsSearchFolder property.
       WScript.echo "IsSearchFolder           = "& _
        " ["&TypeName(objExchange_PublicFolder.IsSearchFolder)&"] "& _
       ' Display the value of the IsSecureInSite property.
       WScript.echo "IsSecureInSite           = "& _
        " ["&TypeName(objExchange_PublicFolder.IsSecureInSite)&"] "& _
       ' Display the value of the LastAccessTime property.
       WScript.echo "LastAccessTime           = "& _
        " ["&TypeName(objExchange_PublicFolder.LastAccessTime)&"] "& _
       ' Display the value of the LastModificationTime property.
       WScript.echo "LastModificationTime     = "& _
        " ["&TypeName(objExchange_PublicFolder.LastModificationTime)&"] "& _
       ' Display the value of the MaximumItemSize property.
       WScript.echo "MaximumItemSize          = "& _
        " ["&TypeName(objExchange_PublicFolder.MaximumItemSize)&"] "& _
       ' Display the value of the MessageCount property.
       WScript.echo "MessageCount             = "& _
        " ["&TypeName(objExchange_PublicFolder.MessageCount)&"] "& _
       ' Display the value of the MessageWithAttachmentsCount property.
       WScript.echo "MessageWithAttachmentsCount= "& _
        " ["&TypeName(objExchange_PublicFolder.MessageWithAttachmentsCount)&"] "& _
       ' Display the value of the Name property.
       WScript.echo "Name                     = "& _
        " ["&TypeName(objExchange_PublicFolder.Name)&"] "& _
       ' Display the value of the NormalMessageSize property.
       WScript.echo "NormalMessageSize        = "& _
        " ["&TypeName(objExchange_PublicFolder.NormalMessageSize)&"] "& _
       ' Display the value of the OwnerCount property.
       WScript.echo "OwnerCount               = "& _
        " ["&TypeName(objExchange_PublicFolder.OwnerCount)&"] "& _
       ' Display the value of the ParentFriendlyUrl property.
       WScript.echo "ParentFriendlyUrl        = "& _
        " ["&TypeName(objExchange_PublicFolder.ParentFriendlyUrl)&"] "& _
       ' Display the value of the Path property.
       WScript.echo "Path                     = "& _
        " ["&TypeName(objExchange_PublicFolder.Path)&"] "& _
       ' Display the value of the ProhibitPostLimit property.
       WScript.echo "ProhibitPostLimit        = "& _
        " ["&TypeName(objExchange_PublicFolder.ProhibitPostLimit)&"] "& _
       ' Display the value of the PublishInAddressBook property.
       WScript.echo "PublishInAddressBook     = "& _
        " ["&TypeName(objExchange_PublicFolder.PublishInAddressBook)&"] "& _
       ' Display the value of the RecipientCountOnAssociatedMessages property.
       WScript.echo "RecipientCountOnAssociatedMessages= "& _
        " ["&TypeName(objExchange_PublicFolder.RecipientCountOnAssociatedMessages)&"] "& _
       ' Display the value of the RecipientCountOnNormalMessages property.
       WScript.echo "RecipientCountOnNormalMessages= "& _
        " ["&TypeName(objExchange_PublicFolder.RecipientCountOnNormalMessages)&"] "& _
       ' Display the value of the ReplicaAgeLimit property.
       WScript.echo "ReplicaAgeLimit          = "& _
        " ["&TypeName(objExchange_PublicFolder.ReplicaAgeLimit)&"] "& _
       ' Display the value of the ReplicaList property.
       WScript.echo "ReplicaList              = "& _
        " ["&TypeName(objExchange_PublicFolder.ReplicaList)&"] "& _
       ' Display the value of the ReplicationMessagePriority property.
       WScript.echo "ReplicationMessagePriority= "& _
        " ["&TypeName(objExchange_PublicFolder.ReplicationMessagePriority)&"] "& _
       ' Display the value of the ReplicationSchedule property.
       WScript.echo "ReplicationSchedule      = "& _
        " ["&TypeName(objExchange_PublicFolder.ReplicationSchedule)&"] "& _
       ' Display the value of the ReplicationStyle property.
       WScript.echo "ReplicationStyle         = "& _
        " ["&TypeName(objExchange_PublicFolder.ReplicationStyle)&"] "& _
       ' Display the value of the RestrictionCount property.
       WScript.echo "RestrictionCount         = "& _
        " ["&TypeName(objExchange_PublicFolder.RestrictionCount)&"] "& _
       ' Display the value of the SecurityDescriptor property.
       WScript.echo "SecurityDescriptor       = "& _
        " ["&TypeName(objExchange_PublicFolder.SecurityDescriptor)&"] "& _
       ' Display the value of the StorageLimitStyle property.
       WScript.echo "StorageLimitStyle        = "& _
        " ["&TypeName(objExchange_PublicFolder.StorageLimitStyle)&"] "& _
       ' Display the value of the TargetAddress property.
       WScript.echo "TargetAddress            = "& _
        " ["&TypeName(objExchange_PublicFolder.TargetAddress)&"] "& _
       ' Display the value of the TotalMessageSize property.
       WScript.echo "TotalMessageSize         = "& _
        " ["&TypeName(objExchange_PublicFolder.TotalMessageSize)&"] "& _
       ' Display the value of the Url property.
       WScript.echo "Url                      = "& _
        " ["&TypeName(objExchange_PublicFolder.Url)&"] "& _
       ' Display the value of the UsePublicStoreAgeLimits property.
       WScript.echo "UsePublicStoreAgeLimits  = "& _
        " ["&TypeName(objExchange_PublicFolder.UsePublicStoreAgeLimits)&"] "& _
       ' Display the value of the UsePublicStoreDeletedItemLifetime property.
       WScript.echo "UsePublicStoreDeletedItemLifetime= "& _
        " ["&TypeName(objExchange_PublicFolder.UsePublicStoreDeletedItemLifetime)&"] "& _
       ' Display the value of the WarningLimit property.
       WScript.echo "WarningLimit             = "& _
        " ["&TypeName(objExchange_PublicFolder.WarningLimit)&"] "& _
    ' If no Exchange_PublicFolder instances were returned,
    ' display that.
    WScript.Echo "WARNING: No Exchange_PublicFolder instances were returned."
  End If
End If

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

This topic last updated: June 2005

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.