'====================================================================================
'Thank you for using the practical function program developed by ASP001 Studio
'HTTP://WWW.ASP001.NET
'==========================================================================='ASP001 Studio provides you with customized program development and enterprise Internet expansion services
'QQ: 1974229
'E-Mail: [email protected]
'For more programs download please go to HTTP://WWW.ASP001.NET
'====================================================================================
'Function introduction: Manage NT accounts through ASP
'This function uses ADSI and requires Administrators group user permissions
'Program Development: ASP001 Studio ChuQi
'====================================================================================
'Fill in with the user
'Function usage: AddUser(Computer,UserName,PassWord,FullName,Info)
'Parameters: computer name, account name, account password, account full name, account description
'Example: AddUser"127.0.0.1","Test","Test","Test","Test Administrator Account", "This account is filled in through ASP"
'Modify the basic information of the specified user
'Function usage: EditUser(Computer,UserName,OldPassWord,PassWord,FullName,Info)
'Parameters: computer name, account name, account password, account full name, account description
'Example: EditUser"127.0.0.1","Test","Test2","Test Administrator Account Modification", "This account has been modified through ASP"
'Delete the specified user
'Function usage: DelUser(Computer,UserName)
'Parameters: computer name, user name'
'Example: DelUser"127.0.0.1","Test"
====================================================================================
FunctionAddUser(Computer,UserName,PassWord,FullName,Info)
'Execute the Create Account command
SetComputerObj=GetObject("WinNT://"&Computer)
SetNewUser=ComputerObj.Create("User",UserName)
NewUser.SetInfo
'Make account settings
NewUser.SetPassword(PassWord)'Account Password
NewUser.FullName=FullName' full name of the account
NewUser.Description=Info'Account Description
NewUser.UserFlags=&H10000'&H20000 (user must change password next time you log in)&H0040 (user may not change password)&H10000 (password is permanently correct)&H0002 (account is temporarily disabled)
NewUser.SetInfo
response.write"Account"&UserName&"Created successfully!"
SetComputerObj=nothing
EndFunction
FunctionEditUser(Computer,UserName,OldPassWord,PassWord,FullName,Info)
'Read user information
SetChangeUserObj=GetObject("WinNT://"&Computer&"/"&UserName&",User")
'Modify account password
ifPassWord<>""then
ChangeUserObj.SetPasswordPassWord
response.write "Account password modified successfully!<br>"
endif
'Modify the full name of the account
ifFullName<>""then
UserFullName=ChangeUserObj.get("FullName")