Set ADConnection = CreateObject("ADODB.Connection")
Set ADCommand.ActiveConnection = ADConnection
ADCommand.CommandText = "Select Name,userPrincipalName,givenName,sn,sAMAccountName,ADsPath,mail,pwdLastSet from 'LDAP://<distinguished name>' Where objectCategory='user' AND userPrincipalName='<UPN>'"
ADCommand.Properties("Page Size") = 1000
ADCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
Set ADrs = ADCommand.Execute