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:

  1. ad not store pc user last logged in to. you'd have build custom track this. it's not trivial build either.
  2. for search current computer object, you'd want filter down little (&(objectcategory=computer)(objectclass=computer)(samaccountname=<pc name>$)).
  3. in search user, want samaccountname attribute (you have samaccount).

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -