Asp classic 如何使用ASP将信息推送到active directory
有人能告诉我如何从经典ASP将数据推送到Active Directory的正确方向吗 有几种方法可以通过经典的ASP来实现这一点Asp classic 如何使用ASP将信息推送到active directory,asp-classic,active-directory,Asp Classic,Active Directory,有人能告诉我如何从经典ASP将数据推送到Active Directory的正确方向吗 有几种方法可以通过经典的ASP来实现这一点 使用 使用 这是我的一个样品 这是这篇文章的一个样本 'Replace department for all users in OU=sales. Set con = Server.CreateObject("ADODB.Connection") con.Provider = "ADsDSOObject" Set command = CreateObject
- 使用
- 使用
'Replace department for all users in OU=sales.
Set con = Server.CreateObject("ADODB.Connection")
con.Provider = "ADsDSOObject"
Set command = CreateObject("ADODB.Command")
Set command.ActiveConnection = con
command.CommandText = "SELECT AdsPath, cn FROM 'LDAP://OU=Sales,DC=Fabrikam,DC=com' WHERE objectClass = 'user'"
command.Properties("searchscope") = ADS_SCOPE_ONELEVEL
Set rs = command.Execute
While Not rs.EOF
Set usr = GetObject(rs.Fields("AdsPath").Value)
usr.Put "department", "1001"
usr.SetInfo
rs.MoveNext
Wend
<%@ Language=VBScript %>
<%
' Get the inputs.
containerName = Request.Form("inpContainer")
' Validate compName before using.
If Not ("" = containerName) Then
' Bind to the object.
adsPath = "LDAP://" & containerName
Set comp = GetObject(adsPath)
' Write the ADsPath of each of the child objects.
Response.Write("<p>Enumeration:</p>")
For Each obj in comp
Response.Write(obj.ADsPath + "<BR>")
Next
End If
%>