Skip to main content

Posts

Displaying a collapsible conversation view of messages within in a folder using ASP.Net

I’ve been playing around with displaying message conversations in a group by format similar to what you can do with Outlook customized views. The ASP.net and ADO.net stuff is certainly a lot more accommodating when you are trying to do this vs ADO and ASP classic. Although they still have a little way to go with displaying hierarchal data. (that said the asp.net 2.0 looks like it’s a great leap forward). For my code though I only had ASP.net 1.1 so I had to make do with what there is. As a base for this code I used the stuff I posted here and added in some other fields to retrieve to allow me to start to group by conversation. The main fields I’ve used to do the group by are the PR_Conversation_topic x0070001E and PR_Subject_prefix x003D001E. Basically I used the prefix fields to work out if a mail in the queryied folder was the first mail in a conversation (eg any response will have a prefix the first message won’t). And the PR_Conversation_topic was used to relate the emails togethe...

Script to Copy Public folder contacts to a mailbox's Contacts folder using CDO 1.2

Somebody asked today about this script I posted a while ago about copying contacts between mailbox's using the vCard method in CDOEX. While this script works okay for simple contacts if you have rich contacts where you have lots of additionally information that CDOEX doesn't include in the vcard stream then it can be a lot of work going through and copying each one of these Mapi properties manually (which I've already done for a few props in this script). The other option if you want to do this in a script is to use MAPI via CDO 1.2. The big advantage of using MAPI is that you will retain all the MAPI properties as they are on the object and also you can run the script remotely where the CDOEX script must be run locally on the Exchange server. The actually question was about copying contacts from a public folder to a mailbox so I've come up with a script that will do this using MAPI via CDO 1.2. To use this script you need to know the entryID for the public folder wher...

C# Catchall Onarrival Event sink

One of the Event sinks that comes in handy from time to time especially if people own a lot of domains is the catch all event sink from http://support.microsoft.com/?kbid=324021 .Now the .NET frameworks a bit more prevalent and the fact I wanted to use this on my Internal servers for something I thought I’d give converting this sink to C# ago. There are two ways you can go about writing SMTP event sinks in managed code the first is to build some wrappers as outlined in on msdn . This gives you access to all the protocol and transport events. The second way to build a SMTP event sink in managed code is to use the CDO onarrival event whose interfaces are defined in the cdoex.dll file (or cdosys.dll if you don’t have Exchange). The downside of using the CDO interface is that it adds significant overhead and is synchronous but the upside is that it that it handles most of the parsing and MIME issues. There’s a good doc here that discusses the issues . But using C# is a step up from VBS ...

Changing the default permissions on a calendar to Reviewer

Updated 3/8/2005 to update local freebusy folder permissions to editor Changing the default permissions on user’s calendars to reviewer is something that comes up now and again in different companies for different reasons. Automating this with script is relatively straight forward if you use the ACL.dll which you can get a copy of from the sample on CDOLive http://www.cdolive.com/aclviewer.htm . Actually the day after I wrote the below script I found another utility that someone had created call setperm that gives you a nice GUI to this. As well as that it gives you the ability to change permissions on other folders other then the calendar. The original web site that hosted this utility seems to be gone now (which is a shame it because it had some good stuff) but you can still download the utility from http://www.slipstick.com/files/setperm.zip . There's also a third party application from Symprex that can do this go here for details. If your still interested in the script versio...

Reverse msExchMailboxSecurityDescriptor Permissions Audit script

There are a few places where you can assign mailbox rights with Exchange 2x one of these is from Active Directory User and Computer via the Mailbox rights tab which manipulates the msExchMailboxSecurityDescriptor active directory attribute. You can display who has access to a mailbox using a script which reads this attribute and there is a good sample of doing this here . But if you want to go the other way by displaying what mailboxes a particular User account has access to this can be a little more challenging. Essentially you need to enumerate the msExchMailboxSecurityDescriptor of every account in your domain and then relate this data. Fortunately this is where ADO Data shaping comes in real handy I’ve used data shaping before here . Data shaping allows you to build hierarchal data structures which in this case allows you to build a structure where the ACE objects (Trustees) on each mailbox relates to the User Account in Active Directory. So to put this together in a script you h...

ASP.NET and Exchange tips and samples

I’ve been writing some ASP.NET pages for my Exchange boxes at the moment and although there is a lot of good information out there about ASP.Net finding good information about using ASP.Net with Exchange can be a little challenging so I though I share some info and links that I found useful. For this post I’m looking at using NTLM authentication on a remote web server to access Exchange 200x box on another server (if your using Form Based Authentication have a look at this ) Authentication This was one of the hardest things for me to get my head around from classic asp. With “ASP.NET it provides an out-of-process execution model, which protects the server process from user code” this provides a good primer on the ASP.NET process model The import part of this is what account the ASP.NET process runs under by default in IIS5 it runs under a local SAM account “ASPNET”. On an IIS6 box (win 2003) the ASP.NET process runs under the default Network Service (system account) account. This bec...

Querying the MicrosoftExchangeV2 namespace remotely in WMI without admin rights

A few people asked about this today so I thought I'd share this with everyone Be default the Exchange WMI namespace root/MicrosoftExchangeV2 is only query-able remotely by Administrators because of the default security that is applied to it. If you need to query this namespace and any of the classes within it remotely using a user other then a administrator what you need to do is change the permissions on the root/MicrosoftExchangeV2 object so that this particular user has the Remote enable right.This is a per server thing so needs to be done on every server that you want these users to have this access. Giving a user Remote enable right gives them the right to connect to the namespace and issue a query but to actually return data from any of the class's like Exchange_Mailbox the user will still require View only Exchange Admin rights. Before you make any changes you should consider the security implications around doing this (eg your server is now less secure then it was befor...
All sample scripts and source code is provided by for illustrative purposes only. All examples are untested in different environments and therefore, I cannot guarantee or imply reliability, serviceability, or function of these programs.

All code contained herein is provided to you "AS IS" without any warranties of any kind. The implied warranties of non-infringement, merchantability and fitness for a particular purpose are expressly disclaimed.