facebook  linkedin  Twitter  skype  Rss googlePlus


Classic ASP

ADSI: Get Group Membership for Account

Oct 12 2004
5992
The following code will use ADSI to obtain all the groups assigned for a specific user account: Dim strDomain = “mydomain“ Dim strUser = “someuser“   Function GetMemberGroups()  Dim oUser = GetObject(strDomain & "/" & strUser)  Dim strTemp  For Each oGroup In oUser.Groups   strTemp = strTemp & oGroup.Name & " "  Next  GetMemberGroups = strTemp End Function

ADSI: Change an Account Password

Sep 24 2004
6044
The following ADSI code will change a password for specified account: ' accepts the old password and new password for changing. Sub ChangePassword(strOldPassword, strNewPassword)     On Error Resume Next     Set oUser = GetObject(strDomain & "/" & strUSer)     oUser.Password = strNewPassword     oUser.SetInfo     Set oUser = Nothing     If Err <> 1 Then         ...

ADSI: Unlock an User Account

Sep 24 2004
6206
The following code can be used for unlocking a domain account. CONST UF_LOCKOUT = &H0010   Sub UnlockAccount     Set oUser = GetObject(strDomain & "/" & strUser)     Flags = oUser.Get("UserFlags")     oUser.Put "UserFlags", Flags Xor UF_LOCKOUT     oUser.SetInfo     Set oUser = Nothing End Sub

ADSI: Change an Account Description

Sep 24 2004
5572
The following code will change the description of an account using ADSI: 'accepts a string for the description.   Sub ChangeAccountDescription(strDescription)     On Error Resume Next     Set oUser = GetObject(strDomain & "/" & strUser)     oUser.Description = strDescription     oUser.SetInfo     Set oUser = Nothing     If Err <> 0 Then         strServerE...

ADSI: Change Account Full Name

Sep 24 2004
6071
The following code will use ADSI to change the Full Name property of a domain account: Sub ChangeAccountFullName(strFullName)     On Error Resume Next     Set oUser = GetObject(strDomain & "/" & strUser)     oUser.FullName = strFullName     oUser.SetInfo     Set oUser = Nothing     If Err <> 0 Then         strServerError = "Full name change failed!"   ...
Displaying 1 of 3 - Next Page

 

Thank you for visiting our site, before you leave, please visit some of the areas or information you may have missed.

Popular Articles