开发者

Creating new active directory account from an asp.net webpage

I'm 14 and I am really stuck. I wish to have an ASP.NET webpage that will enable users to create a new account in an organizational container. I have seen many pages on this but I just keep getting stuck.

Also, if this is possible, once the user has signed up would it be possible to run a script to enable the user for Office Communications Server 2007, or will I have to set the script as a cron job every 2 minutes?

Thanks in advance 开发者_如何学Cfor your help.


Here is how I do it in a classic asp page:

Set objContainer = GetObject("LDAP://OU=OUtoPut,DC=YOUR,DC=ORG")
Set objUser = objContainer.Create("User", "CN=" & strCN)

objUser.sAMAccountName = strCN
objUser.givenName = strFName
objUser.sn = strLName
objUser.FullName = strCN
objUser.displayName = strCN
objUser.UserPrincipalName = strCN & "@your.org"
objUser.SetInfo
objUser.SetPassword strPass
objUser.pwdLastSet = 0
objUser.SetInfo
objUser.AccountDisabled = False
objUser.SetInfo

probably a little overdone toward the end with the setinfos, but it works.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜