protected override void InternalProcessRecord() { try { using (PublicFolderDataProvider publicFolderDataProvider = new PublicFolderDataProvider(this.ConfigurationSession, "Disable-MailPublicFolder", Guid.Empty)) { if (!string.IsNullOrWhiteSpace(base.DataObject.EntryId)) { StoreObjectId storeObjectId = StoreObjectId.FromHexEntryId(base.DataObject.EntryId); PublicFolder publicFolder = (PublicFolder)publicFolderDataProvider.Read <PublicFolder>(new PublicFolderId(storeObjectId)); publicFolder.MailEnabled = false; publicFolder.ProxyGuid = Guid.Empty.ToByteArray(); publicFolderDataProvider.Save(publicFolder); } } } catch (AccessDeniedException exception) { base.WriteError(exception, ExchangeErrorCategory.Authorization, this.Identity); } catch (ObjectNotFoundException ex) { this.WriteWarning(Strings.FailedToLocatePublicFolder(this.Identity.ToString(), ex.ToString())); } base.InternalProcessRecord(); }