简体   繁体   English

创建Sharepoint 2007用户

[英]Create Sharepoint 2007 user

I am trying to create Sharepoint 2007 users through c#. 我正在尝试通过c#创建Sharepoint 2007用户。 I begin by adding them into our AD server, which is tied to our SP server. 首先,将它们添加到与SP服务器绑定的AD服务器中。 The users appear in the AD, as well as within the SP user directory. 用户出现在AD以及SP用户目录中。 However, if you try to log into the Sharepoint site with this account, it will not allow you to. 但是,如果您尝试使用此帐户登录到Sharepoint网站,它将不允许您登录。

In order to use the account on Sharepoint, you must first manually log onto the Windows domain via the standard windows login. 为了在Sharepoint上使用该帐户,您必须首先通过标准的Windows登录名手动登录Windows域。 Once you have logged onto the domain, the SP version of the account becomes 'active'. 登录到域后,该帐户的SP版本将变为“活动”状态。 Is there anyway to stop this behavior and simply allow users to log onto the SP site without having to manually log them onto a machine first? 无论如何,有没有停止这种行为的方式,只是允许用户登录SP站点而不必先手动将其登录到计算机上?

I think what you need to do is call EnsureUser which takes a regular AD user and turns them into one which is registered in SP. 我认为您需要做的是调用“ EnsureUser”,该用户使用一个常规的AD用户并将其转换为在SP中注册的用户。 (ie so you can get a SPUser object for the user) Take a look here for how to do this: http://blog.myitechnology.com/2009/06/right-way-to-spwebensureuser.html (即,这样您就可以为用户获取SPUser对象)在此处查看如何执行此操作: http : //blog.myitechnology.com/2009/06/right-way-to-spwebensureuser.html

I found the answer. 我找到了答案。 You can create a user in Sharepoint and they are created properly, but if you set the user password to "Expire on first login" within Active Directory, then you will be unable to log onto the Sharepoint site until you reassign a new password to that account. 您可以在Sharepoint中创建一个用户,并且可以正确创建它们,但是如果您在Active Directory中将用户密码设置为“首次登录时过期”,那么您将无法登录到Sharepoint网站,除非您重新为其分配了新密码帐户。 By not setting the "expire password" property, you can create users and log onto the Sharepoint site immediately. 通过不设置“过期密码”属性,可以创建用户并立即登录到Sharepoint网站。

Thanks for the other solutions, I wish i was using SP2010! 感谢其他解决方案,我希望我正在使用SP2010!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM