Link to home
Start Free TrialLog in
Avatar of Henrik Johansson
Henrik JohanssonFlag for Sweden

asked on

Remove Public Folder with heading \ as name

A Public Folder was accedently created as \bad folder\name and now can't do anything with it.

Get-PublicFolder -GetChildren|?{$_.Name -Like '\*'}

PowerShell line above works to find it, but trying to delete with Remove-PublicFolder or rename with Set-PublicFolder to get rid of the bad folder result in error about incorrect format of PublicFolderIdParameter. I've tried to use Exchange Online tenant as OrganizationName without effect.
If trying to use Outlook as client to do anything with it gives the behavior as not being owner of folder (grayed out delete/rename option, missing tabs in properties).

Get-PublicFolder -GetChildren | Remove-PublicFolder
Get-PublicFolder -GetChildren|?{$_.name -like '\*'} | % {Set-PublicFolder $_.identity -Name 'crap'}

Cannot process argument transformation on parameter 'Identity'. Cannot convert value "?\bad folder\name" to type "Microsoft.Exchange.Configuration.Tasks.PublicFolderIdParameter". Error: "The value provided for parameter "?\bad folder\name" isn't in the correct format. The correct format is "<OrganizationName>\\<Fold
erPath>"."
    + CategoryInfo          : InvalidData: (:) [Set-PublicFolder], ParameterBindin...mationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Set-PublicFolder
    + PSComputerName        : outlook.office365.com
SOLUTION
Avatar of Simon Butler (Sembee)
Simon Butler (Sembee)
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Henrik Johansson

ASKER

Problem solved when troubleshooting with Office 365 support.