ADSI, using ASP for NT management

Source: Internet
Author: User
Tags iis domain server
Last time I spoke about how to use ADSI to manage web servers. This time I discussed how ADSI manages NT.
To use ADSI to manage IIS, OP4 is required.
NTLM is required for nt adsi management.
NTLM provides the following objects: Domain, Group, and User.
You can add groups and users through the domain object.
Warning:
In the following example, the NT access permission database is changed; the permissions of the NT user are randomly added and changed.
Please read carefully before use. Please run these programs only on the tested machine, only to your understanding of NTLM
So far. Do not endanger the security of the real host.
Only persons with Administrator or Operator permissions can run IIS on the machine.
Change the user database of NT. Therefore, you are not authorized to log on with the Anonymous permission.
Of course, SSL can also ensure security.
Example:
Create a user:
You can add users on an independent server or a primary domain server.
<%
On Error Resume Next
StrDomain = "MACHINENAME"
StrUser = "jdoe"
Set oDomain = GetObject ("WinNT: //" & strDomain)
Set oUser = oDomain. Create ("user", strUser)
If (err. number = 0) Then
OUser. SetInfo
OUser. SetPassword "mypassword"
OUser. SetInfo
Set oUser = Nothing
End If
Set oDomain = Nothing
%>
Add a new group:
<%
StrDomain = "MACHINENAME"
StrGroup = "Unidentified"
Set oDomain = GetObject ("WinNT: //" & strDomain)
Set oGroup = oDomain. Create ("group", strGroup)
OGroup. SetInfo
Set oDomain = Nothing
Set oGroup = Nothing
%>
Add a user to a group.
Related Article

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.