excel VBA query AD last log in user -
i have created excel 2010 ss querys ad user ldap , populates 3 columns pc name, description , online/offline.
i add last user logged in.
set objrootdse = getobject("ldap://rootdse") set objconnection = createobject("adodb.connection") objconnection.open "provider=adsdsoobject;" set objcommand = createobject("adodb.command") objcommand.commandtext = "<ldap://fqdn;(objectcategory=computer);name,description;subtree"
do have again?
objcommand.commandtext = "<ldap://fqdn;(objectcategory=user);samaccount;subtree"
and how linked specific pc or there way query pc name last user logged in? must i'm pretty new , getting far least educational. in advance tips
few things:
- ad not store pc user last logged in to. you'd have build custom track this. it's not trivial build either.
- for search current computer object, you'd want filter down little
(&(objectcategory=computer)(objectclass=computer)(samaccountname=<pc name>$))
. - in search user, want
samaccountname
attribute (you have samaccount).
Comments
Post a Comment