Forum Post: RE: LastLogon from active directory

  • Thread starter Thread starter tbergman
  • Start date Start date
Status
Not open for further replies.
T

tbergman

Guest
USING System.DirectoryServices.*. USING System.DirectoryServices.AccountManagement.*. DEFINE VARIABLE objContext AS PrincipalContext. DEFINE VARIABLE objUser AS UserPrincipal. DEFINE VARIABLE objDirEntry AS DirectoryEntry. DEFINE VARIABLE PropertyValue AS CHARACTER NO-UNDO . DEFINE VARIABLE PropertyName AS CHARACTER NO-UNDO . PropertyName = "LastLogon" . objContext = NEW PrincipalContext(ContextType:Domain, " DomainName" ). objUser = UserPrincipal:FindByIdentity(objContext, " UserName " ). PropertyValue = DYNAMIC-PROPERTY (objUser,PropertyName) NO-ERROR . MESSAGE PropertyValue VIEW-AS ALERT-BOX .

Continue reading...
 
Status
Not open for further replies.
Back
Top