The impersonation principal name is invalid on Exchange 2013

Hi,

I have some code for accessing a mailbox of several users using an impersonation account with the role ApplicationImpersonation. This code works against my Exchange 2010 server. But when I run the same code against my 2013 Exchange server I get the error "The impersonation Principal is invalid" Account is configured on both servers with

New-ManagementRoleAssignment Name:impersonationAssignmentName Role:ApplicationImpersonation User:serviceAccount

Any ideas?

Regards

Danny

August 27th, 2015 3:26am

I use this code:

exchangeService.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.PrincipalName, "danny");

this gives me the error "The Impersonation Principal name is invalid". When I change the code to

exchangeService.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "danny#exchangedev.local");

It works. I used this code against Exchange 2010 and there the first line with ConnectingIdType.PrincipalName works and it doesn't work on Exchange 2013. Any ideas?

Regards

Danny

Free Windows Admin Tool Kit Click here and download it now
September 1st, 2015 3:24am

PrincipalName should really be the UPN of the account if you use that your code should always work on any version of Exchange. It looks like your trying to use down-level username https://msdn.microsoft.com/en-us/library/windows/desktop/aa380525(v=vs.85).aspx . You might want to take a look in the EWSLogs on the CAS server and at the EventLog messages, I would say its failing to map the down-level user correctly, I would suggest you switch to using the UPN to avoid that issue.

Chees
Glen

September 1st, 2015 11:02pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics