且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我怎么可以查询该活动目录帐户与SQL Server用户关联的?

更新时间:2022-11-23 13:45:53

您可以检查您已在系统中定义为登录Windows组;

You can check that Windows groups you have defined on your system as login;

SELECT *
FROM sys.server_principals
WHERE type_desc = 'WINDOWS_GROUP'

这适用于 SQL Server 2005和较新的而已。

但你不会得到实际的AD组的名字 - 只有SID该组......

But you won't get the actual AD group name - only the "SID" for that group ....

整个安全系统是SQL Server 2000上完全不同的 - 我不认为有一个1:1等值查询老恐龙:-)***的,我能想到的是:

The whole security system was very different on SQL Server 2000 - I don't think there's a 1:1 equivalent query for that old dinosaur :-) The best I can think of would be:

SELECT *
FROM master.dbo.sysxlogins
WHERE password IS NULL 
  AND name IS NOT null

但不幸的是,没有办法,我会知道的用户Windows之间的分离和Windows安全性的集团这里....

But unfortunately, there's no way I would be aware of to separate between Windows users and Windows security groups here....