Get user email address from active directory
Need to get users email address from active directoy. I try to use
System.DirectoryServices.AccountManagement. But I have problem to add the reference. I found someone else also post the same problem http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=133862.
There is response. I am usin SSIS Development Studio 2008 with .net 3.5 sp1. This is a SharePoint 2010 server so .net 4.0 is also installed. Please advice. Many thanks.
October 20th, 2011 11:52am
Hi eg10013,
System.DirectoryServices.AccountManagement is supported on Windows XP, Windows Vista, Windows Server 2003, and Windows Server 2008. What server you are using? Please refer to the following link about it:
http://richardspowershellblog.wordpress.com/2008/05/25/system-directoryservices-accountmanagement/
And here is a article about how to process Active Directory information in SSIS:
http://social.technet.microsoft.com/wiki/contents/articles/processing-active-directory-information-in-ssis.aspx
If you have any qeustion, please feel free to let me know.
Thanks,
Eileen
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
tnmff@microsoft.com.
Free Windows Admin Tool Kit Click here and download it now
October 21st, 2011 4:13am
Thank you for your response. I tried to use the following code to get user's email address so I need to reference
System.DirectoryServices.AccountManagement . I am working on a Windows 2008 (sp1) server.
PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "dcname");
UserPrincipal u = new UserPrincipal(ctx);
u = UserPrincipal.FindByIdentity(ctx, UserName);
October 21st, 2011 4:26pm