ASP create users, directories, and sites (turn)

Source: Internet
Author: User
This lecture will use ADSI, the Active Directory service interface. You can find some relevant information in 15seconds.com.
1. Create user
The following code creates the user User1 on the standalone server white, the initial password User1, and uses ADSI.
Dim Username,userpass
Dim Odomain,ouser
Username = "User1"
Userpass = "User1"
Set odomain = GetObject ("Winnt://white")
Set ouser = odomain.create ("user", UserName)
If (err.number = 0) Then
Ouser.setinfo
Ouser.setpassword Userpass
Ouser.setinfo
Else
WScript.Echo "Create User" & UserName & "Error!" "
End If
Set ouser = Nothing
Set Odomain = Nothing
2. Create a table of contents
To create a directory using FileSystemObject:
Dim Fsobject
Dim Tmpfolder
Set fsobject = WScript.CreateObject ("Scripting.FileSystemObject")
Tmpfolder = "D:userdateuser1"
If not fsobject.folderexists (tmpfolder) Then
Fsobject.createfolder (Tmpfolder)
If err.number<>0 Then
WScript.Echo "Create Directory" & Tmpfolder & "Failed!" "
End If
End If
Note Before you create a directory, check that the directory exists and, if it exists, you do not have to create it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.