Can someone explain to me why the following code will only return the user name in the domain?
Function ListUsers()
Dim MyDomain As Object
Dim user As IADsUser
Set MyDomain = GetObject("WinNT://" & Environ("USERDOMAIN"))
MyDomain.Filter = Array("user")
For Each user In MyDomain
MsgBox "User Name:" & user.Name
MsgBox "User Desc:" & user.Title
MsgBox "User TelNo:" & user.Department
Next
End Function
The code will provide the user name, but will give me:
Run-time error '-2147463155 = The directory property cannot be found in the cache.
I am stumped. Using Access 2003 on a Windows network with Active Directory.
Any help would be awesome!!
Lee
Function ListUsers()
Dim MyDomain As Object
Dim user As IADsUser
Set MyDomain = GetObject("WinNT://" & Environ("USERDOMAIN"))
MyDomain.Filter = Array("user")
For Each user In MyDomain
MsgBox "User Name:" & user.Name
MsgBox "User Desc:" & user.Title
MsgBox "User TelNo:" & user.Department
Next
End Function
The code will provide the user name, but will give me:
Run-time error '-2147463155 = The directory property cannot be found in the cache.
I am stumped. Using Access 2003 on a Windows network with Active Directory.
Any help would be awesome!!
Lee