19.3 Get-DRAPublicFolder

Synopsis

It can be used to Search public folders or retrieve information about a public folder in DRA.

Syntax

Get-DRAPublicFolder [-PublicFolderAndFilter <Hashtable>] [-PublicFolderOrFilter <Hashtable>] [-VisiblePropertiesOnly <SwitchParameter>] [-GetChildren <SwitchParameter>] [-Recurse <SwitchParameter>] [-Identifier <String>] -Domain <String> [-ContainerDN <String>] [-EnforceServerLimit <SwitchParameter>] [-IncludeChildContainers <SwitchParameter>] [-ObjectsPerResponse <Int32>] [-ResumeString <String>] [-Attributes <String[]>] [-DRARestServer <String>] [-DRARestPort <Int32>] [-IgnoreCertificateErrors <SwitchParameter>] [-Force <SwitchParameter>] [-Timeout <Int32>] [<CommonParameters>]

Description

The Get-DRAPublicFolder cmdlet executes a search for all public folders in the DRA Server. The server returns all public folders for domains that have Public Folder configured. You can specify criteria to search for public folders. The Or Filter uses a Hashtable of property values to match. For example, the following filter will find users whose Name begins with "Sm" or whose ParentPath is "PublicFolderRoot": -PublicFolderOrFilter @{Name="Sm*";ParentPath="PublicFolderRoot"} Wildcard options for filter values are: *Matches an unlimited number of charactersMultiple match strings can be specified for an attribute by separating them with the | character.

For example, the following will match public folders whose Name attribute begins with H or P: -PublicFolderOrFilter @{Name="H*|P*" } To search for the literal | character you need to escape it with a backslash.

For example, the following filter will find all public folders that have a | in their Path: -PublicFolderOrFilter @{ ParentPath="*\|*" }You can specify the ContainerDN parameter to control where DRA searches. Specify that the search should include public folders in child containers by specifying the Recurse parameter. See parameter explanations in the detailed Help for more information. You can also specify parameters that control the content in the response, such as the number of items to return and where to resume the search results if multiple requests are needed to retrieve all of the search results. For more examples, see the help.

Parameters

Attribute / Description

Parameters / Values

Required

Position

Default Value

Accept Pipeline input?

Accept wildcard characters?

PublicFolderAndFilter [<Hashtable>]

Public Folder properties to use for searching public folders. The properties will be combined for the search. Public folders matching all listed properties will be returned.

false

named

 

true (ByPropertyName)

false

PublicFolderOrFilter [<Hashtable>]

Public Folder properties to use for searching Public Folder objects. Public folders matching any of the listed properties will be returned.

false

named

 

true (ByPropertyName)

false

VisiblePropertiesOnly [<SwitchParameter>]

A flag to indicate whether DRA should return only properties the caller has powers to view. By default DRA will return an error if the caller requests a property that they do not have powers to view, by specifying this flag DRA is instructed to not return an error and instead just not return a value for such properties.

false

named

 

false

false

GetChildren [<SwitchParameter>]

It specifies whether to retrieve only the immediate children of the specified public folder. You can't use the GetChildren parameter with the Recurse parameter.

false

named

 

false

false

Recurse [<SwitchParameter>]

It specifies whether to retrieve all children of the specified public folder. You can't use the GetChildren parameter with the Recurse parameter.

true

named

 

false

false

Identifier <String>

The name or distinguished name of an existing Active Directory object. When the name is specified, an additional call to the DRA Server is needed to obtain the distinguished name for the object.

true

named

 

true (ByPropertyName)

false

Domain <String>

The domain of the object in fqdn format. For example: mydomain.corp

true

named

 

true (ByPropertyName)

false

ContainerDN [<String>]

The full path to the container to search in distinguished name format.

For example: -ContainerDN "OU=Accounting,DC=MyDomain,DC=corp"

false

named

 

false

false

EnforceServerLimit [<SwitchParameter>]

A switch parameter to indicate that the search results should be limited by the search result limit on the DRA Server. The typical server limit is 1000 items. The default is true.

false

named

 

false

false

IncludeChildContainers [<SwitchParameter>]

A switch parameter to request that the search include child containers. The default is false: only the container named in the ContainerDN parameter is searched.

false

named

 

false

false

ObjectsPerResponse [<Nullable`1>]

The number of objects to return in a response. The default is 250.

false

named

 

false

false

ResumeString [<String>]

When multiple responses are needed to return all of the search results to the client, this parameter indicates the last item returned from the server. The value of this parameter would be set using the ResumeString property from the previous set of results. The ResumeString may look like this: "CN=MYUser160,CN=Users,DC=MyDomain,DC=corp".

The EnforceServerLimit, ObjectsPerResponse, and ResumeString parameters are applicable only when the Identifier parameter is not specified.

false

named

 

false

false

Attributes [<String[]>]

An array of attributes to retrieve values for. If this parameter is missing, a default list of properties is returned.

false

named

 

true (ByPropertyName)

false

DRARestServer [<String>]

The name of the computer running the DRA Rest Service. The requested DRA operation will execute on this server. If the parameter is not specified, the value defaults to 'localhost'.

false

named

 

true (ByPropertyName)

false

DRARestPort [<Int32>]

The port where the DRA REST Service listens for requests. If the parameter is not specified, the value defaults to 8755.

false

named

8755

true (ByPropertyName)

false

IgnoreCertificateErrors [<SwitchParameter>]

Allows the request to bypass any SSL certificate errors, such as the InvalidOperation error that occurs when the REST Service is bound to a self-signed certificate.

false

named

 

false

false

Force [<SwitchParameter>]

Suppresses any request for user input and supplies a 'yes' response. For example: -Force with a delete request will perform the delete without presenting the confirmation request to the user.

false

named

 

false

false

Timeout [<Int32>]

The number of seconds to wait before the request to the DRA REST server times out. To specify an infinite timeout, you can set this parameter to -1.

false

named

100 seconds

false

false

<CommonParameters>

Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see About CommonParameters.

 

 

 

 

 

NOTE:For more information, type "Get-Help Get-DRAPublicFolder -detailed". For technical information, type "Get-Help Get-DRAPublicFolder -full".

Example 19-3 1

PS C:\>Get-DRAPublicFolder -ContainerDn "PF=PF1,PF=PublicFolderRoot,DC=corp"

This example will enable mail of public folders named MyPublicFolder.

Example 19-4 2

PS C:\>Get-DRAPublicFolder -PublicFolderOrFilter @{Name="PF*"} -ContainerDn "PF=PF1,PF=PublicFolderRoot,DC=corp" -IncludeChildContainers -ObjectsPerResponse 50

In this example, DRA will search in the PF1 public folder and all child containers of that public folder for all public folders having a name attribute beginning with "PF". The server should return a maximum of 50 items in the response.

Example 19-5 3

PS C:\>Get-DRAPublicFolder -PublicFolderOrFilter @{ParentPath="PF-1###";Name="publicFolder1*"} -ContainerDn "PF=PublicFolderRoot,DC=corp" -Attributes "mailEnabled","hasSubFolders","domainName"

In this example, DRA will search for public folders having either a parent path beginning with "PF-1"' and ending with three numeric digits, OR a Name beginning with "publicFolder1". DRA will search only in the "PublicFolderRoot" public folder since the ContainerDN is specified and IncludeChildContainers is not. For each group matching the filter criteria, the server will return three attributes. The response will return a maximum of 250 items since the ObjectsPerResponse parameter is not specified.

Example 19-6 4

PS C:\>Get-DRAPublicFolder -Domain MyDomain.corp -Identifier "PF=MyPublicFolder,PF=PublicFolderRoot,DC=MyDomain,DC=corp"

This example requests the properties of the public folder named MyPublicFolder under PublicFolderRoot in MyDomain.corp. The identifier contains the distinguished name for the public folder. When the Attributes parameter is not present, a default list of properties will be returned.

Example 19-7 5

PS C:\>Get-DRAPublicFolder -Domain MyDomain.corp -Identifier "PublicFolderRoot\MyPublicFolder"-Attributes "issueWarningQuota","retainDeletedItemsFor", "maxItemSize"

This example requests the properties of the public folder named MyPublicFolder under PublicFolderRoot in MyDomain.corp. The identifier contains the path for the public folder. When the path is used, the path will be converted to distinguished name.

Example 19-8 6

PS C:\>Get-DRAPublicFolder -Domain MyDomain.corp -Identifier "PF=MyPublicFolder,PF=PublicFolderRoot,DC=MyDomain,DC=corp"-Attributes "name","folderSize", "perUserReadStateEnabled"

This example requests the properties of the public folder named MyPublicFolder under PublicFolderRoot in MyDomain.corp. The Attributes parameter specifies what properties to return.