Notes from Daily Encounters with Technology RSS 2.0
 
# Sunday, August 09, 2009

Microsoft Exchange supports Send As and Send On Behalf Of permissions to be granted to users for individual e-mail addresses. Sending e-mail from Outlook for these users is very simple – they just enter the desired address in the From field of a new message (toggled with the Show From command on the Options ribbon) and if they have the required permission it will be sent accordingly – either as if it was actually sent from that address or as sent by the user on behalf of the address in the From field.

If you want to achieve this from code there is a little more work involved. First of all the user must be authenticated on the server using one of the methods below:

SmtpClient smtp = new SmtpClient("smtp.domain.com");

// use user’s existing credentials
smtp.UseDefaultCredentials = true;

// pass username and password
smtp.Credentials = new NetworkCredentials("username", "password");

The next step is to set up the correct headers in the message otherwise the server will return error code 5.7.1 describing the permission the user does not have.

To send the e-mail as only the From property has to contain the desired address:

MailMessage mail = new MailMessage();
mail.From = new MailAddress("send.as@domain.com");

To send the e-mail on behalf of another user the Sender property must additionally contain the user’s e-mail address:

MailMessage mail = new MailMessage();
mail.From = new MailAddress("send.as@domain.com");
mail.Sender = new MailAddress("user.address@domain.com");

On a related note, the required permissions can be granted using PowerShell.

To grant the Send As permission:

Add-ADPermission –Identity "user1" –User "user2" –ExtendedRights Send-As

To grant the Send On Behalf Of permission:

Set-Mailbox "user1" -GrantSendOnBehalfTo "user2"

In both cases the user1 specifies the mailbox to grant the permission for and the user2 specifies the user to grant the permission to.

Sunday, August 09, 2009 7:39:38 PM (Central European Daylight Time, UTC+02:00)  #    Comments [0] - Trackback
Development | .NET
# Saturday, August 01, 2009

Today I decided to get to the bottom of the missing driver issue on my computer running Windows 7 RC. It shows up as PCI Simple Communications controller and it really bugged me since I don't have a modem or a similar device on the motherboard.

PCI Simple Communications ControllerIt turned out that there is a away to identify such a device from the information available in Device Manager. The first step is to open the Properties window for this device and move to the Details tab. After selecting the Hardware Ids in the Property dropdown the device identifiers are displayed.

HardwareIds

The important ones are the numbers written after the VEN and DEV keywords. The first one is the Vendor ID and the second one is the Device ID. So in my case the Vendor ID is 8086 (from VEN_8086) and the Device ID is 29A4 (from DEV_29A4).

All that's left to do know is to go to PCIDatabase.com and enter the ids into the corresponding search boxes. In my case it turned out that it was a device from Intel - Intel Management Engine Interface (HECI). Unfortunately it doesn't have a driver for Windows 7 yet and the Vista one doesn't install. But hey, at least I know which driver is missing.

Saturday, August 01, 2009 7:09:49 PM (Central European Daylight Time, UTC+02:00)  #    Comments [2] - Trackback
Personal | Software
Sponsored Ads

About Me

Microsoft Certified Professional

Microsoft Certified Professional

View Damir Arh's profile on LinkedIn

Profile for ExAmigan

ExAmigan

Twitter
Snow pushed wild animals down from the hills again. Just saw a roe deer couple in a garden at the edge of the town while walking the dog. 18 hours ago
I finished the redesign of http://www.damirscorner.com - now it's time to write some new content. 11 days ago
Firebug is great. It helped me solve a CSS problem within minutes. http://getfirebug.com/ 11 days ago
Enjoyed watching Coraline. Would love to get my hands on a scottish terrier puppet from the movie. http://digs.by/1ZsY 11 days ago
@DanijelMalik I guess it depends on the project you are deleting. 13 days ago
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

All Content © 2010, Damir Arh, M. Sc. Send mail to the author(s) - Privacy Policy - Sign In
Based on DasBlog theme 'Business' created by Christoph De Baene (delarou)