Active Directory 数据导入 SQL 表 [英] Active Directory data into SQL table

查看:15
本文介绍了Active Directory 数据导入 SQL 表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何提取 Active Directory 信息(用户名、名字、姓氏)并用结果填充 SQL 表?

How would I extract Active Directory info (Username, first name, surname) and populate an SQL table with the results?

非常感谢

斯科特

推荐答案

我们为 LARGE AD 环境执行此操作的方式:

The way we do this for a LARGE AD environment:

  1. 夜间批处理运行 AdFind(免费软件工具)以执行 LDAP 查询并将其转储到 CSV 文件
  2. BCP(内置SQL 命令行工具)将 CSV 文件批量导入到 SQL 数据库中的导入表中
  3. 存储过程(使用 osql) 从导入表中获取数据并在主表中添加/更新记录
  1. Nightly batch process that runs AdFind (freeware tool) to execute an LDAP query and dump it out to CSV files
  2. BCP (built-in SQL command line tool) to bulk import the CSV files into import tables in the SQL database
  3. Stored procedure (executed with osql) to take the data from the import table and add/update records in the main tables

从开始到结束,我们在大约 2 小时内从 10 个域中提取了 145k 用户、80k 组、130k 计算机.这包括为用户和计算机提取准确的 LastLogon 信息,这需要您点击每个域控制器.否则,该过程大约需要 30 分钟.

We pull 145k users, 80k groups, 130k computers from 10 domains in about 2 hours from start to finish. This includes pulling accurate LastLogon information for the users and computers which requires you to hit each domain controller. Without that, the process takes about 30 minutes.

这篇关于Active Directory 数据导入 SQL 表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆