How to use EWS or Powershell to rename all folders that have a forward slash in them

We have many users that have created folders in Outlook that have forward slashes in the name (i.e. / ). They did this in Outlook/Exchange 2003. We upgraded to Outlook 2010 and this is no longer aloud so there are issues with the folders when performing
functions such as trying to share or using IMAP, etc.
I'm looking for a way to specify a particular user's mailbox in a script and have it traverse every folder/subfolder and check if there is a forward slash in the name. If there is a forward slash I would like to rename the folder to something like the bar
character (i.e |) or another character that is valid.
I had most users go through Outlook manually and clean them up. However there are a handful of users that have hundreds if not thousands of subfolders that have the forward slash in them.
I've done extensive research on this (references to my research below) and came close in putting a script together but I just can't figure it out. Anyone have an example for this? Even if I need to specify a folder within the Inbox and have the script only
process subfolders from this location would be acceptable since most of them are subfolders of a particular folder.
Thank you.
http://social.technet.microsoft.com/Forums/exchange/en-US/b24d0558-ed6a-4854-9a86-e9815741b5d0/rename-folder-example-in-ews?forum=exchangesvrdevelopment
http://exchange-powershell.com/database-management/bulk-public-folder-rename-and-cleanup-script/
http://unlockpowershell.wordpress.com/2010/10/14/powershell-rename-a-mailbox-folder-using-exchange-web-services-api/

First two articles are for public folders so it won't help here as you have mailbox folders...
http://unlockpowershell.wordpress.com/2010/10/14/powershell-rename-a-mailbox-folder-using-exchange-web-services-api/ 
This is good starting point, you might need to change the logics around it  to search / and replace with - or someting, this might be the code change needed from that article but would suggest you to test it first.
foreach ($folder in $ffResponse.Folders)
if ($folder.Displayname -like “*/*”)
Write-Output “Found / in the $mailboxName and folder name is $folder.Displayname”
$folder.Displayname.Replace("/","-")
$folder.Update()
Blog |
Get Your Exchange Powershell Tip of the Day from here

Similar Messages

  • How can I see in my address book all contaacts that have not been placed into groups?

    How can I see in my address book the contacts that have not been put into groups?

    The best way to do that is create a new "smart group" with the following:
    This way you can identify those without a group and drag them to one.
    Regards,
    Captfred

  • How to Use PowerShell to Delete FIM Users That Have a Null attribute name

    FIM Community Information Center Article
    Wiki Page:
    How to Use PowerShell to Delete FIM Users That Have a Null <attribute name>
    Go to the FIM Community Information Center
    Mike Crowley | MVP
    My Blog --
    Planet Technologies

    Have you run side-by-side metrics on this?
    I've run the Delete Object method and your script against similar data sets and yours appears to take a fair bit longer. I'd have to re-run in identical circumstances, a few times, to really say for sure, but my initial impression is that it will take hours
    longer.
    I guess the point is somewhat moot anyway, as for me the bit that generally takes longest is the actual query, rather than the deletions.
    Boy how I wish I could just enter something into the FIM Portal directly that would blast out a bunch of users matching a query. One day...
    FIMSpecialist.com | MCTS: FIM 2010 | Now Offering
    ECMA1->ECMA2 Upgrade Services

  • I am a high school teacher.  My district purchased the entire CC Suite.  Where can I find a tutorial in book form to learn how to use your products?  Do you all provide free book samples to teachers?

    I am a high school teacher.  My district purchased the entire CC Suite.  Where can I find a tutorial in book form to learn how to use your products?  Do you all provide free book samples to teachers?

    Good day!
    This is a user to user Forum, so you are not really addressing Adobe here, even though some Adobe employees thankfully have been dropping by. (edit: Actually they are more likely to frequent the regular Photoshop Forum.)
    Regards,
    Pfaffenbichler

  • I downloaded the free trial for Adobe XI Pro but now I cant find it on my computer or figure out how to use it. The only thing I see that downloaded is Adobe Download Assistant. How can I access the program?

    I downloaded the free trial for Adobe XI Pro but now I cant find it on my computer or figure out how to use it. The only thing I see that downloaded is Adobe Download Assistant. How can I access the program?

    Assistanttolindsey the Adobe Download Assistant will download the installation files for Adobe Acrobat Professional XI.  By default they are saved to your download folder.  You can begin the installation process from there.

  • PowerShell - List all users that have access to a particular SPLIstItem

    Hi there,
    In PowerShell - how to list all users that have access to a particular SPLIstItem?
    Thanks so much in advance.

    Hi frob,
    According to your description, my understanding is that you want to list all users who have access to a particular SharePoint list item via PowerShell.
    You can use the following PowerShell command:
    $web = Get-SPWeb http://sp/sites/First
    $list=$web.Lists["listV2"]
    $item=$list.Items | where {$_['ID'] -eq 1}
    $item | Select -ExpandProperty RoleAssignments |Select {$_.Member.DisplayName}, {$_.Member.LoginName}, RoleDefinitionBindings
    In the above command, you need to change the web URL to your site's URL, change “listV2” to the name of your list, and change the ‘1’ to the ID of the list item.
    The result looks like:
    Best Regards,
    Wendy
    Wendy Li
    TechNet Community Support

  • How to find PDF files that have other documents bundeled within them?

    Hello guys
    I need help with the following: we have a huge number of PDF files that have other documents imbedded (bundled, attached) in them. If such a document is open in Acrobat, bundled files show up as attachments on the left. Some of those attachements are .mdi files. This is Microsoft Document Images files. Is there a way to flag PDF's that have those .mdi files in them? I need to find them and convert to PDF. If I need to be more descriptive please ask, and thank you in advance for help.

    Preflight is a complex plugin, it's hard to explain how to use it in one forum post. You need to read the documentation carefully.
    There's no pre-built profile for what you want, so you would first create a new Custom Check that compares the MIME type string of embedded files to what you're searching for (not the file extension but the full MIME identifier, which for Office files is a very long string). You would then place that new Custom Check into a new Profile, identifying it as an error condition. Once you've saved the Profile you can run it against a number of files and specify actions to be taken for pass and fail conditions, such as changing the filename or moving to a subfolder.

  • How to find all photos that have NO faces, as opposed to UNNAMED faces?

    I find that iPhoto often misses faces entirely, especially if the face is wearing sunglasses or a hat or both.  Sometimes it is rather inexplicable that it has missed a face, as the face seems obvious.
    If you use the smart album method to find all "unnamed" faces, the photos have at least one unnamed face identified.  You can then add any missed faces to those photos.
    But what about photos in which iPhoto has failed to identify the existence of even one face?  Or for that matter, if I want to see only pictures of landscapes or objects that have no people?  Does anyone have a method for finding all photos that have no faces in them at all?
    For me, the idea is to find all unidentified faces and add them.  But as I pointed out above, there may be other uses for this.
    Any ideas, anyone?
    Thanks

    Awesome !!! Thank you very much. I did not realize you could use JavaScript to code against iTunes ...
    I don't know if you have written any of these yourself, but do you know how to maybe create a smart playlist with this information via script? If not, no big deal. At least I know have something which I can use, I will just have to run it every so often.
    Thanks again for pointing me to that site!

  • How to improve Oracle Veridata Compair pair performance with tables that have big (30-40MB)CLOB/BLOB fileds ?

    How to improve Oracle Veridata Compair pair performance with tables that have big (30-40MB)CLOB/BLOB fileds ?

    Can you use insert .. returning .. so you do not have to select the empty_clob back out.
    [I have a similar problem but I do not know the primary key to select on, I am really looking for an atomic insert and fill clob mechanism, somone said you can create a clob fill it and use that in the insert, but I have not seen an example yet.]

  • How can I attatch a word document to an email that have already been sent to me in another email?, How can I attatch a word document to an email that have already been sent to me in another email?

    How can I attatch a word document to an email that have already been sent to me in another email?,

    Forward the original E-Mail and tap "Include Attachments".

  • My table of contents does not use the entry style I select for words in the paragraph that have character styles applied to them in the chapter, so some of the letters are showing up as green, which is fine in the chapter but not in the TOC.

    My table of contents does not use the entry style I select for words in the paragraph that have character styles applied to them in the chapter, so some of the letters, specifically parameters, are showing up green, which is fine in the chapter but not in the TOC. I can manually fix this in the TOC by changing the character style to none after the toc  has been generated, but I don't want to do this.

    What application are you running? Please ask this in the forum of the product you're using.

  • Is there a way to rename multiple desktops that have been created?

    Is there a way to rename multiple desktops that have been created?

    No, They'll be Desktop 1, Desktop 2 etc or the name of any full screen apps.

  • TS1702 I hit the "update all" button in the app store and things seemed to get started, but never completed. Now all those apps have a "waiting" msg under them. How do I correct this?

    I hit the "update all" button in the app store and things seemed to get started but never completed. Now all these apps have a "waiting" msg under them. How do I fix this?   Thx-Kurt.

    turn your ipad off by holding the sleep wake button for 5 seconds and slide to turn off then turn it back on and the apps should be finished and if the apps didnt finish just redownload them

  • How to use a regural expression to get all digit from a string.

    Hi All,
    Do you know how to use regural expression to get all digits from the following string via ABAP program?
    "'Log Attributes                 0 (  0 )     (   10 % Available  )"
    Thanks,
    Andrew

    Hi,
    Try the code mentioned below:
      DATA: STR_LEN  LIKE SY-FDPOS,
            RSTR_LEN LIKE SY-FDPOS,
            OFF      LIKE SY-FDPOS.
      DATA: IDX      LIKE SY-FDPOS,        "mn B20K054003
            CL       LIKE SY-FDPOS.        "mn B20K054003
      DATA: RSTRING(40).
      DATA: STRING(40).   " value 'A,N,I,L'.
      FIELD-SYMBOLS: <NLS_CHAR>.           "mn B20K054003
    MOVE I_REGUH-ZNME1 TO STRING.
      MOVE SPACE TO RSTRING.
      STR_LEN = STRLEN( STRING ).
      DESCRIBE FIELD RSTRING LENGTH RSTR_LEN.
      IF RSTR_LEN < STR_LEN. RAISE TOO_SMALL. ENDIF.
      WHILE IDX < STR_LEN.                 "mn B20K054003
        ASSIGN STRING+IDX(*) TO <NLS_CHAR>.   "mn B20K054003
        IF SY-LANGU EQ '2'.                "mn B20K054003
          CALL FUNCTION 'NLS_THAI_CHARLEN' "mn B20K054003
               EXPORTING                   "mn B20K054003
                    THAI_STRING  = <NLS_CHAR>       "mn B20K054003
               CHANGING                    "mn B20K054003
                    THAI_CHARLEN = CL.     "mn B20K054003
        ELSE.                              "mn B20K054003
          CL = CHARLEN( <NLS_CHAR> ).      "mn B20K054003
        ENDIF.                             "mn B20K054003
        IF IDX NE 0.                       "mn B20K054003
          SHIFT RSTRING RIGHT BY CL PLACES."mn B20K054003
        ENDIF.                             "mn B20K054003
        RSTRING+0(CL) = STRING+IDX(CL).    "mn B20K054003
        IDX = IDX + CL.                    "mn B20K054003
      ENDWHILE.                            "mn B20K054003
    Regds,
    Anil
    Edited by: Matt on Jul 1, 2009 9:36 AM -added code tags

  • I do not know how to use i cloud. or i tunes anymore for that matter. can someone help me?

    I had not updated my Itunes in a while. when i got my mac i updated it to the latest version and i guess i set up i cloud but I have no idea how to use it. i have 1163 songs in my itunes library but they literally only show up some times and others they dont. it says i have all those songs in my music library on my phone but then half of them dont play and i dont understand why? most of my songs have a little cloud next to them like they need to be downloaded but i dont understand????
    I just want all my music on my phone.
    my phone also cant back up to icloud becase there is no storage but i have 3 backups under my back up and i dont know what to do? i lost my phone recently and i think it still has my old back up but i dont wanna delete that one cause im scared its gonna delete everything and i just really dont know what to do.
    does anyone know if im doing something wrong or what i can do to back up to my old back up or what?
    my contacts also always change names. or i put a number in my phone and it literally disappears 2 minutes later. ill save the number again and it does it again but then i look back in a ciuple of weeks and i have 4 of the same contact. its very frustrating

    Did you enable the "Find my..." function BEFORE you lost it?

Maybe you are looking for

  • Check Box Question

    Hi everyone. Quick question. I am curious if there is a way for my iTunes to shuffle and play songs that do not have the box checked. I like to keep certain songs/albums unchecked so I can switch up what's on my iPhone, but still have the ability to

  • How can I do the CNiReal64Vector as a global variable?

    My problem is with the CNiReal64Vector. Ive tried to define this vector as a global variable in the header file: public: NI::CNiReal64Vector plotData(50); but the debuger flushed error : Syntax error ´constant´. Of course,  I used usually square brac

  • How to convert single instance10g db to 11gR2 RAC with ASM

    Hi, I need your help to decide the plan about how to convert single instance 10g database to 11gr2 rac with asm. I can have about 6 to 8 hours of downtime to upgrade and move to rac with asm. db size is about 1.5tb and on AIX. here is my plan.... 1)

  • Powermac G5 - ocz Agility 4 ssd won't boot

    G5 Power mac - ssd storage upgrade - ssd drive won't boot when blessed. 1. Installed 2 new drives into old G5. Upper slot - 2TB sata hdd, Lower slot - 256GB ssd OCZ Agility 4. 2. Formatted both drives as Mac OS extended (Journalled). 3. 2TB drive par

  • Migration 10gr2 rac to 11gr2 rac

    Hi all, Can I use Transportable Tablespaces to migrate 10gr2 rac with ASM (solaris) to 11gr2 rac with ASM (AIX), the server is not the same. regards Edited by: mexman on 06-may-2010 15:36