Skip to main content

Posts

Showing posts from April, 2008

Uploading an EML file to a Mailbox with Exchange Web Services

This is a handy little sample to have in your bag of tricks when you need to exchange messages between disparate messaging systems. This code sample is relatively straight forward in that it uses a file stream to read the byte stream of the EML file which is already in MIME format and then uses a createitem operation and posts the MIME content from the data stream to the Exchange Message Store. The only trick that comes in is when you create the Item in whatever folder you want you need to set the message flags property PR_Message_Flags so the message will appear as a normal Sent Mail in Outlook (otherwise it will just appear as a draft). Also you need to set the flag value so it will also appear as Read (unless you want to have it as unread.) The sample itself uploads an eml file from the c: drive to a users sent items folder I’ve put a download copy of the code here the code itself looks like [warning this code sample may cause global warming if you don't configure your pc t

Exchange Permission and Reverse Permission Powershell Gui version 1 Exchange 2000/3/7

*** There is an update version that include mailbox acls here http://gsexdev.blogspot.com/2008/10/exchange-reverse-permission-audit.html Exchange mailbox permissions getting you down, don’t know who has access to who’s mailbox, rouge admins or legacy permissions or configurations keeping you up at night, can’t get any more the 500 horses out of the V8 under the bonnet. Okay seriously this is kind of rollup script of a lot of vbs scripts that I’ve posted over the past couple of years in regards to Exchange Mailbox, Send and Receive As, Store and delegated Admin rights. It enumerates permissions from Active Directory firstly from all Mailbox rights, Send and Receive As Rights for Exchange Users and then all Mailbox Store ACL’s and finally from the Root Exchange container in the configuration partition to work out the Rights that have been delegated for Exchange System Manager Delegation wizard. It adds all the permissions to ADO.NET datatables and does some calculations to work out fir

Showing Mailbox Rights and Send-as/Receive As rights in Powershell Exchange 2000/3/7

I’ve been working on some permissions scripts in the past couple of weeks and thought I’d post a powershell port of some VBS code from this http://msdn2.microsoft.com/en-us/library/ms992469(EXCHG.65).aspx msdn article. I’ve use this code before in a variety of scripts to read permissions from the Exchange Mailbox DACL via the msexchmailboxsecuritydescriptor AD property. Of course one should never try to set mailbox rights using this property as per http://support.microsoft.com/kb/310866/ so make sure you always treat it as read only. So what I’ve done is put together a quick sample that uses the new ActiveDirectorySecurity class in .NET 2.0 to basically load the DACL from the bytearray representation of the DACL that’s stored in this property. Also I’ve included some code to retrieve the Send-AS and Receive-AS rights from the AD object's DACL. The code only looks at the Implicitly set ACE's and not the Inherited ACE’s (this could be easily changed) it queries ever mail
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.