Check if valid userHi Everyone,<br/><br/>I am developing a console app that iterates through a list of usernames from our HR system and updates user properties for users that exist in WSS 3.0.  I'm running into an issue where I am unable to check if the username is a valid SharePoint user first before entering the loop.  When I do this:  SPWeb.AllUsers(&quot;USERNAME&quot;) it throws an exception if the username is invalid.  Is there a method in the SDK that checks if the user exists?  I tried EnsureUser however I do want to create a user if it does exist.<br/><br/>Thank You© 2009 Microsoft Corporation. All rights reserved.Sun, 30 Aug 2009 17:50:46 Z842ae061-a0a3-401b-8980-57e967a0a8bahttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/842ae061-a0a3-401b-8980-57e967a0a8ba#842ae061-a0a3-401b-8980-57e967a0a8bahttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/842ae061-a0a3-401b-8980-57e967a0a8ba#842ae061-a0a3-401b-8980-57e967a0a8baSamCostahttp://social.msdn.microsoft.com/Profile/en-US/?user=SamCostaCheck if valid userHi Everyone,<br/><br/>I am developing a console app that iterates through a list of usernames from our HR system and updates user properties for users that exist in WSS 3.0.  I'm running into an issue where I am unable to check if the username is a valid SharePoint user first before entering the loop.  When I do this:  SPWeb.AllUsers(&quot;USERNAME&quot;) it throws an exception if the username is invalid.  Is there a method in the SDK that checks if the user exists?  I tried EnsureUser however I do want to create a user if it does exist.<br/><br/>Thank YouSat, 04 Jul 2009 07:07:36 Z2009-07-04T07:07:36Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/842ae061-a0a3-401b-8980-57e967a0a8ba#80a9c984-1d1c-437c-aa9b-3b6ac71aeb52http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/842ae061-a0a3-401b-8980-57e967a0a8ba#80a9c984-1d1c-437c-aa9b-3b6ac71aeb52Sébastien Sougnezhttp://social.msdn.microsoft.com/Profile/en-US/?user=S%u00e9bastien%20SougnezCheck if valid userHello,<br/> <br/> I already had this issue. Actually, the only solution that I found is to nest you statement (SPWeb.AllUser) with a try ... catch. If the user doesn't exist, the catch is raised, otherwise, I can excecute some code...<hr class="sig">http://www.areaprog.comSat, 04 Jul 2009 16:13:39 Z2009-07-04T16:13:39Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/842ae061-a0a3-401b-8980-57e967a0a8ba#fd468ecd-39d5-4450-bc27-b3b3c8e91c53http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/842ae061-a0a3-401b-8980-57e967a0a8ba#fd468ecd-39d5-4450-bc27-b3b3c8e91c53SamCostahttp://social.msdn.microsoft.com/Profile/en-US/?user=SamCostaCheck if valid userThanks for your response.  That is exactly what I am doing today, I guess I'll have to stick with it.Sat, 04 Jul 2009 17:49:20 Z2009-07-04T17:49:20Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/842ae061-a0a3-401b-8980-57e967a0a8ba#6b7e3d09-cc24-4fd1-aff1-95be6e2bc479http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/842ae061-a0a3-401b-8980-57e967a0a8ba#6b7e3d09-cc24-4fd1-aff1-95be6e2bc479kesav7902http://social.msdn.microsoft.com/Profile/en-US/?user=kesav7902Check if valid useri dont  think u need to loop it around..try checking the username with the domain included.<br/><br/>lets be optimistic.....Mon, 06 Jul 2009 11:27:25 Z2009-07-06T11:27:25Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/842ae061-a0a3-401b-8980-57e967a0a8ba#18966f83-8eb1-4154-a569-0f312ef606cchttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/842ae061-a0a3-401b-8980-57e967a0a8ba#18966f83-8eb1-4154-a569-0f312ef606ccSamCostahttp://social.msdn.microsoft.com/Profile/en-US/?user=SamCostaCheck if valid userHow do I check the username? I am posting this question here because I cannot find a way to check. Mon, 06 Jul 2009 14:18:25 Z2009-07-06T14:18:25Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/842ae061-a0a3-401b-8980-57e967a0a8ba#f16a7ee9-081e-48cf-ba9c-6aabaa7b3824http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/842ae061-a0a3-401b-8980-57e967a0a8ba#f16a7ee9-081e-48cf-ba9c-6aabaa7b3824AWMMhttp://social.msdn.microsoft.com/Profile/en-US/?user=AWMMCheck if valid userHi,<br/><br/>Did you ever find out if there was another way to check if the user exists besides using a try/catch?Thu, 27 Aug 2009 18:32:36 Z2009-08-27T18:32:36Z