Formular una preguntaFormular una pregunta
 

RespondidaCheck if valid user

  • sábado, 04 de julio de 2009 7:07SamCosta Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    Hi Everyone,

    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("USERNAME") 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.

    Thank You

Respuestas

  • sábado, 04 de julio de 2009 16:13Sébastien Sougnez Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     Respondida
    Hello,

    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...
    http://www.areaprog.com
    • Marcado como respuestaSamCosta domingo, 30 de agosto de 2009 17:50
    • Propuesto como respuestaSébastien Sougnez sábado, 04 de julio de 2009 18:59
    •  

Todas las respuestas