Share via


Remove-PublicFolder

 

Applies to: Exchange Server 2007 SP1, Exchange Server 2007 SP2, Exchange Server 2007 SP3

Use the Remove-PublicFolder cmdlet to remove an existing public folder.

Warning

The Remove-PublicFolder cmdlet will remove the public folder data from all servers in your organization. If you want to remove data from only one server, use the Set-PublicFolder –replicas command. For more information, see Set-PublicFolder.

Syntax

Remove-PublicFolder -Identity <PublicFolderIdParameter> [-Confirm [<SwitchParameter>]] [-DomainController <Fqdn>] [-Recurse <SwitchParameter>] [-Server <ServerIdParameter>] [-WhatIf [<SwitchParameter>]]

Detailed Description

To run the Remove-PublicFolder cmdlet, the account you use must be delegated the following:

  • Exchange Public Folder Administrator role and local Administrators group for the target server

For more information about permissions, delegating roles, and the rights that are required to administer Exchange Server 2007, see Permission Considerations.

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.Exchange.Configuration.Tasks.PublicFolderIdParameter

Use the Identity parameter to specify the GUID or public folder name that represents a specific public folder. You can also include the path using the format TopLevelPublicFolder\PublicFolder.

You can omit the parameter label Identity so that only the public folder name or GUID is supplied.

Confirm

Optional

System.Management.Automation.SwitchParameter

The Confirm parameter causes the command to pause processing and requires you to acknowledge what the command will do before processing continues. You don't have to specify a value with the Confirm parameter.

DomainController

Optional

Microsoft.Exchange.Data.Fqdn

The DomainController parameter specifies the domain controller to use to write this configuration change to Active Directory. Use the fully qualified domain name (FQDN) of the domain controller that you want to use.

Recurse

Optional

System.Management.Automation.SwitchParameter

When it is specified, the Recurse parameter specifies that all subfolders of the specified folder should be removed. If the Recurse parameter is not specified and the public folder has subfolders, the command does not run and returns an error message.

Server

Optional

Microsoft.Exchange.Configuration.Tasks.ServerIdParameter

The Server parameter specifies the identity of the server from which to remove the public folder.

WhatIf

Optional

System.Management.Automation.SwitchParameter

The WhatIf parameter instructs the command to simulate the actions that it would take on the object. By using the WhatIf parameter, you can view what changes would occur without having to apply any of those changes. You don't have to specify a value with the WhatIf parameter.

Input Types

Return Types

Errors

Error Description

 

Exceptions

Exceptions Description

 

Example

This example deletes the public folder named My Public Folder from the \Test\Directory tree.

Remove-PublicFolder -Identity "\Test\Directory\My Public Folder"

All parameters for the Remove-PublicFolder command accept pipelined input.