- 时间:2021-09-14 10:18 编辑: 来源: 阅读:
- 扫一扫,手机访问
摘要:SQLServer 使用ADSI执行分布式查询ActiveDorectory对象
Step 1:Creating a Linked Server.
EXEC sp_addlinkedserver 'ADSI', 'Active Directory Services 2.5', 'ADSDSOObject', 'adsdatasource'
Step 2:Creating a SQL Server Authenticated Login
EXEC sp_addlinkedsrvlogin @rmtsrvname = N'ADSI', @locallogin = NULL , @useself = N'False', @rmtuser = N'domain\Account', @rmtpassword = N'Password'
对于 SQL Server 授权登录,可以使用sp_addlinkedsrvlogin 系统存储过程配置用于连接到目录服务的适当的登录/密码.
参考这里: http://blogs.msdn.com/euanga/archive/2007/03/22/faq-how-do-i-query-active-directory-from-sql-server.aspx
如果SQLServer使用Windows 授权登录,只需自映射就足以通过使用 SQL Server 安全委托来访问AD。简单点说就是直接运行第三步语句即可.
Step 3:Querying the Directory Service.
[url=http://www.sqlservercentral.com/Forums/Topic231658-54-1.aspx#bm231954]http://www.sqlservercentral.com/Forums/Topic231658-54-1.aspx#bm231954[/url]
我推荐的方法:在微软搜索到的.[b]如何通过 NTDSUtil为服务器修改限制 maxPageSize [/b]
|
1.
|
Click[b]Start[/b], and then click[b]Run[/b].
|
|
2.
|
In the[b]Open[/b] text box, type[b]ntdsutil[/b], and then press ENTER. To view help at any time, type[b]?[/b] at the command prompt.
|
[b]Modifying policy settings[/b]
|
1.
|
At the Ntdsutil.exe command prompt, type[b]LDAP policies[/b], and then press ENTER.
|
|
2.
|
At the LDAP policy command prompt, type[b]Set [i]setting[/i] to [i]variable[/i][/b], and then press ENTER. For example, type[b]Set MaxPoolThreads to 8[/b].
This setting changes if you add another processor to your server.
|
|
3.
|
You can use the[b]Show Values[/b] command to verify your changes.
To save the changes, use[b]Commit Changes[/b].
|
|
4.
|
When you finish, type[b]q[/b], and then press ENTER.
|
|
5.
|
To quit Ntdsutil.exe, at the command prompt, type[b]q[/b], and then press ENTER.
|
资料来源:
[url=http://support.microsoft.com/kb/315071/en-us]http://support.microsoft.com/kb/315071/en-us[/url]
[url=http://support.microsoft.com/?scid=kb%3Bzh-cn%3B299410&x=16&y=10]http://support.microsoft.com/?scid=kb%3Bzh-cn%3B299410&x=16&y=10[/url]
如何使用SQL查询活动目录对象语法: [url=http://www.microsoft.com/china/technet/community/columns/scripts/sg0505.mspx#EMBAC]http://www.microsoft.com/china/technet/community/columns/scripts/sg0505.mspx#EMBAC[/url]