Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server 2008 查询SQL中的Active Directory上次登录_Sql Server 2008_Active Directory - Fatal编程技术网

Sql server 2008 查询SQL中的Active Directory上次登录

Sql server 2008 查询SQL中的Active Directory上次登录,sql-server-2008,active-directory,Sql Server 2008,Active Directory,我被要求从项目中的active directory检索所有用户的上次登录。我可以在一行代码中查询他们的姓名、createaDate等,但无法检索它返回NULL的lastLogon Exec [dbo].[sspQueryAD] 'SELECT objectGUID,distinguishedName,objectCategory,givenName,sn,aDsPath,name,sAMAccountName,cn,objectSid,whenChanged,whenCreated FROM

我被要求从项目中的active directory检索所有用户的上次登录。我可以在一行代码中查询他们的姓名、createaDate等,但无法检索它返回NULL的lastLogon

Exec [dbo].[sspQueryAD] 'SELECT objectGUID,distinguishedName,objectCategory,givenName,sn,aDsPath,name,sAMAccountName,cn,objectSid,whenChanged,whenCreated 
FROM ''GC://DC=MyDC,DC=com'' 
WHERE objectclass=''user'' and objectclass <> ''computer'' or objectClass = ''organizationalUnit'' and objectclass <> ''computer'' or objectClass = ''Domain'' and objectclass <> ''computer'' or objectClass = ''Group'' and objectclass <> ''computer''', 0
sspQueryAD创建到AD的连接

我一直在寻找答案,但我还没有找到任何使用SQL的,有人能帮我吗?
谢谢

您需要发布存储过程代码,您的查询没有告诉我们太多。我不是广告大师,但我觉得您访问广告的帐户不允许看到该值。这将是需要调查的事情。