大网数据广告活动
域与目录服务

Reorganization

· 52CE 我爱测

The sales organization has moved to a new organization \ 8212; \ 0034;Sales and Support. \ 0034; Julie Bankert has been promoted to vice president and will lead the new organization.

The sales organization has moved to a new organization — "Sales and Support." Julie Bankert has been promoted to vice president and will lead the new organization. Joe Worden, the enterprise administrator, must move Sales OU to a new OU, Sales and Support.

Set dom = GetObject("LDAP://DC=Fabrikam,DC=COM")
Set salesSupport = dom.Create("organizationalUnit", "CN=Sales and Support")
Set sales = salesSupport.MoveHere("LDAP://OU=Sales,DC=Fabrikam,DC=COM", vbNullString)

With this code example, all objects in the sales organizational unit, including the sub-organizational units, are moved to the new organizational unit.

Now, Joe can move Julie into the Sales and Support organizational unit.

Set usr = salesSupport.MoveHere("LDAP://CN=Julie Bankert,OU=Sales,OU=Sales and Support,DC=Fabrikam,DC=COM")
usr.Put "title", "Vice President"
usr.SetInfo

Be aware that the manager-direct report link between Julie Bankert and Chris Gray is automatically updated by Active Directory.

To create an Active Directory report

  1. Open Visual Basic version 6.0, and when prompted for the project type, select Data Project.

  2. On Data Project, double-click Data Environment1.

  3. On the Data Environment window, right-click the connection object (Connection1) and select Properties.

  4. Select OLE DB Provider for Microsoft Directory Services, and click Next.

  5. Select Use Windows NT Integrated security, and click OK. This creates a connection object.

  6. Right-click the Data Environment window again to select Add Command. Right-click the Command1 object and select Properties. The following Command1 Properties dialog box will appear.

    command1 properties dialog box

  7. Click the SQL Statement option button and type the following:

    SELECT Name,telephoneNumber FROM 'LDAP://DC=Fabrikam,DC=com' WHERE objectCategory='Person' AND objectClass='user'

    The Command object is created. Add the Command object to the report.

  8. Double-click Data Report1 from the Project window.

  9. Drag the Command1 object from the DataEnvironment1 window to the Detail section in the Data Report window.

  10. On DataReport1 Properties, for DataSource, select DataEnvironment1 from the pull-down menu, and select Command1 in the DataMember field.

  11. On the project window, right-click Data Project, and select DataProject Properties.

  12. On the DataProject - Project Properties dialog window, under Startup Object, select DataReport1 from the pull-down menu. Click OK to save.

  13. Compile. The following DataReport1 dialog box will appear.

    datareport1 dialog box

Related topics

Joining Heterogeneous Data

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。