title: SharePoint Custom Web Part With Active Directory
body: <p>I am currently working on a custom SharePoint web part (WSS 3.0, not MOSS) that will pull in information for all of the users in Active Directory to build an up to date employee directory.  This web part shows things like phone number, address, and other similar fields.  The issue that I am having is that, by default, the SharePoint web site on IIS is running as the user IUSR_.  This user does not have access to Active Directory, so I am unable to retrieve any user information.  </p>
  
  <p>To get around this for testing I have hard coded the credentials for a test user which I added just for this purpose.  This, obviously, is not ideal.  If anyone removes this user or if they ever change the password then the web part will break and they will have no way to fix it (they have no in-house developers to take it over once I am finished here).  To fix this problem, I would like to make the Username/Password custom properties on the web part so I can pass those to Active Directory to retrieve the information I need.  The issue I am having with this is that the password is stored in plain text so anyone can read it.  I would like it to display as ******** or something similar.  Is there a way to make a custom property on a web part a password type?</p>
  
  <p>If this isn't possible, can anyone recommend another way to accomplish what I am trying to do?  At this time I cannot change the user that the SharePoint website runs as.  Although, if I cannot find any other solutions I will try again to persuade them.</p>
  
  <p>Thanks in advance!</p>