Microsoft KB Archive/319410

= How to restrict root folder modification in the Exchange 2000 Web client =

Article ID: 319410

Article Last Modified on 2/28/2007

-

APPLIES TO


 * Microsoft Exchange 2000 Server Standard Edition

-



This article was previously published under Q319410



SUMMARY
Exchange 2000 Server provides a Web-based client, known as Outlook Web Access, so that e-mail users can access their mail, contacts, appointments, and other Exchange 2000 features through a Web browser.

The most common client for Exchange 2000 Server is Microsoft Outlook (any version). Outlook requires that there be specific folders in the server tree, and it does not permit the user to modify these folders. However, the Exchange Server Web client does permit users to rename, delete, or move these default folders.

If users in your organization use the Exchange Server Web client and Outlook on individual mailboxes, Microsoft recommends that you restrict these users from deleting or otherwise modifying these root folders.



MORE INFORMATION
You can easily work around this potential Outlook destabilization problem by making some simple JScript additions to the Vw_navbar20.js file in the \ExchSrvr\ExchWeb\Controls folder. Paste the following functions in the bottom of the Vw_navbar20.js file.

Note This code sample is localized for both English and Spanish. function ProhibitRootFldrMod_Hlpr( NamesArray, szURLToModify ) {    var nIdx = -1; var folderToModifyDecoded

// Decode the folder's name that we are going to modify folderToModifyDecoded = szURLToModify.replace( / /g, &quot;%20&quot; );

while( NamesArray[ ++nIdx ] ) {        var szTemp = new String( g_szUserBase + NamesArray[ nIdx ] + &quot;/&quot; ); var szTestURL = szTemp.replace( / /g, &quot;%20&quot; ); delete szTemp; if( szTestURL == folderToModifyDecoded ) {            delete folderToModifyDecoded; return true; }    }

return false; }

function ProhibitRootFldrMod {   var objFolder   = objTree.selectedNode; var szName     = objFolder.displayname; var szURL      = objFolder.url; var szEnglishFolders = new Array; var nIdx = -1; szEnglishFolders[ ++nIdx ] = &quot;Calendar&quot;; // Calendar szEnglishFolders[ ++nIdx ] = &quot;Contacts&quot;; // Contacts szEnglishFolders[ ++nIdx ] = &quot;Deleted Items&quot;;// Deleted Items szEnglishFolders[ ++nIdx ] = &quot;Drafts&quot;; // Drafts szEnglishFolders[ ++nIdx ] = &quot;Inbox&quot;;  // Inbox szEnglishFolders[ ++nIdx ] = &quot;Journal&quot;; // Journal szEnglishFolders[ ++nIdx ] = &quot;Notes&quot;;  // Notes szEnglishFolders[ ++nIdx ] = &quot;Outbox&quot;; // Outbox szEnglishFolders[ ++nIdx ] = &quot;Sent Items&quot;;// Sent Items szEnglishFolders[ ++nIdx ] = &quot;Tasks&quot;;  // Tasks // Termination of Array with NULL value szEnglishFolders[ ++nIdx ] = null;

nIdx = -1; // Spanish Folder Names too! var szSpanishFolders = new Array; szSpanishFolders[ ++nIdx ] = &quot;Calendario&quot;;// Calendar szSpanishFolders[ ++nIdx ] = &quot;Contactos&quot;;// Contacts szSpanishFolders[ ++nIdx ] = &quot;Elementos eliminados&quot;;// Deleted Items szSpanishFolders[ ++nIdx ] = &quot;Elementos enviados&quot;;// Sent Items szSpanishFolders[ ++nIdx ] = &quot;Bandeja de entrada&quot;;// Inbox szSpanishFolders[ ++nIdx ] = &quot;Diario&quot;;// Journal szSpanishFolders[ ++nIdx ] = &quot;Notas&quot;;// Notes szSpanishFolders[ ++nIdx ] = &quot;Bandeja de salida&quot;;// Outbox szSpanishFolders[ ++nIdx ] = &quot;Tareas&quot;;// Tasks szSpanishFolders[ ++nIdx ] = &quot;Borradores&quot;;// Drafts // Termination of Array with NULL value szSpanishFolders[ ++nIdx ] = null;

var szMsg = null; var ret = ProhibitRootFldrMod_Hlpr( szEnglishFolders, szURL ); if( true == ret ) {       szMsg = &quot; has been restricted from modification&quot;; }   else {       ret = ProhibitRootFldrMod_Hlpr( szSpanishFolders, szURL ); if( true == ret ) {           szMsg = &quot; se ha restringido de la modificacion.&quot;; }   }           if( ret == true ) window.alert( szName + szMsg ); delete szSpanishFolderNames; delete szEnglishFolders; return ret; } This code handles the actual process of determining whether you are dealing with a root folder.

The only other changes that you must make are in the MenuSelect function that is located near the top of the file, above the new code that you just inserted. To make these changes to the MenuSelect function, insert the two lines of code in three different positions in the function, as follows: function MenuSelect(item) {   switch (item) {       case &quot;Delete&quot;: var node   =   objTree.selectedNode; var szName =   node.displayname; var szURL  =   node.url; /* NEW CODE HERE */ if( true == ProhibitRootFldrMod) /* NEW CODE HERE */    return; if(confirm(L_ConfirmDelete_Text)) {               objTree.deleteFolder(szURL); }       break; case &quot;Rename&quot;: /* NEW CODE HERE */ if( true == ProhibitRootFldrMod) /* NEW CODE HERE */    return; DoRenameCommand; break; case &quot;Copy&quot;: DoMoveCopyCommand(&quot;Copy&quot;); break; case &quot;Move&quot;: /* NEW CODE HERE */ if( true == ProhibitRootFldrMod) /* NEW CODE HERE */    return; DoMoveCopyCommand(&quot;Move&quot;); break; case &quot;New Folder&quot;: DoNewFolderCommand; break; case &quot;Open&quot;: var node = objTree.selectedNode; if(node) {               Navigate(node.url + &quot;?Cmd=contents&quot;); }       break; case &quot;OpenNewWindow&quot;: var node       = objTree.selectedNode; var szURL      = node.url + &quot;?Cmd=contents&quot;; var windowName = new String(Math.round(Math.random * 100000)); var hWin = window.open(szURL,windowName,&quot;toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1&quot;) break; }               return (false); } Note that any languages that you implement in the Exchange Server Web client must be handled in the ProhibitRootFldrMod function. Also note that because you are handling this task on the client side, it is still possible for a script-savvy user to create (hack) a request to modify the folders.

The code changes demonstrated in this sample code prevent users from renaming, moving, or deleting the root folders of the mailboxes that they have access to through the Web client.

Because of the natural evolution of the Exchange Server Web client, this code may require future changes to function correctly with new software releases. In any event, make sure that you back up your original script file before you edit it.

Additional query words: XWEB

Keywords: kbhowto kbinfo kbnofix KB319410

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.