![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Windows NT/2000/2003 Server/2008 Server Find support for Windows NT/2000/2003 Server/2008 Server editions. |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: Sep 2008
Posts: 1
OS: Win XP/Fedora Core/Win2003/Win Vista
|
VBScript to get INFO from Active Directory
I am trying to get account info from AD using a vb script. This is my VBScript:
" Set objUser = GetObject _ ("LDAP://CN=blue,OU=units,DC=sunap,DC=aknt") objUser.GetInfo strProfilePath = objUser.Get("mail") WScript.echo "Email: " & strProfilePath " I get the "directory property cannot be found in the cache" error. Im running windows 2003 std. I am sure that the users deatails are filled in correctly. What I basically want to do is run the script when the user logs in and let it display the currents users email address according to the AD attributes |
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
|
|
#2 (permalink) |
|
Registered User
Join Date: Aug 2008
Location: Glasgow
Posts: 39
OS: Multiple
|
Re: VBScript to get INFO from Active Directory
If you haven't done so you should add the following statement at the start.
On Error Resume Next If you still have problems why not try this On Error Resume Next Set objUser = GetObject _ ("LDAP://CN=blue,OU=units,DC=sunap,DC=aknt") objUser.GetInfo strMail = objUser.Get("mail") WScript.Echo "Email: " & objUser.mail Last edited by GraemeI; 09-08-2008 at 08:24 AM. |
|
|
|
![]() |
| Thread Tools | |
|
|