I created this code snippet, which helps us to mail-disable in the Exchange Server 2003 SP2 (Native mode) – public folders. For this i tried this, i used C#.Net & CDOEXM. In this below code, i try to mail-disable the public folder named “publicfolder1”. I used Visual Studio.Net 2008, C#.Net and CDOEXM – Collaboration Data Objects for Exchange Management – 2003 to do this:
static void Main(string args)
CDO.Folder objFolder = new CDO.Folder();
fullurl = "http://domain/public/publicfolder1";
objRecip = (CDOEXM.IMailRecipient)objFolder;
catch (Exception e1)
+ To execute this code, you may try with VS.Net 2005 or VS.Net 2008, C#.Net.
+ Make sure you need to use the following references: CDOEXM – Microsoft CDO for Exchange Management 2000 & CDOEX - Microsoft CDO for Exchange 2000.
+ This code helps us to mail-disable the public folder “public folder1”.
+ Also we need to make sure to pass valid credentials username(Administrator) & password(Password) to execute this, along with valid fullURL – the public folder needs to be mail-disabled & domain – exchange domain.
Hope this helps. Happy programming!!