Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 6th, 2006, 07:56 AM
Cpajoe2001 Cpajoe2001 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 33 Cpajoe2001 User rank is Corporal (100 - 500 Reputation Level)Cpajoe2001 User rank is Corporal (100 - 500 Reputation Level)Cpajoe2001 User rank is Corporal (100 - 500 Reputation Level)Cpajoe2001 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 7 h 50 m 43 sec
Reputation Power: 4
ADSI help

I am trying to search active directory to return a list of email address. I have a text file with a list of names. When I run my script I get an error and one able to help me?

Code:
Const ForReading = 1
Const ForAppending = 8
Const ADS_SCOPE_ONELEVEL = 1

set objFSO = CreateObject("Scripting.FileSystemObject")
set objFile = objFSO.OpenTextFile("list.txt", ForReading)
set objNFile = objFSO.OpenTextFile("results.txt", ForAppending)

Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=ADsDSOObject;"

Set objCommand = CreateObject("ADODB.Command")
objCommand.ActiveConnection = objConnection
objCommand.Properties("searchscope") = ADS_SCOPE_ONELEVEL

Wscript.Echo "Reading File"
    Do While objFile.AtEndOfStream = False
        strLine = objFile.ReadLine
        objCommand.CommandText = "Select email FROM 'LDAP://domain name' WHERE description = 'strLine'"
        Set objRecordSet = objCommand.Execute
        objNFile.WriteLine(strLine & " " & objRecordSet.Fields("email"))
    Loop
objFile.Close
objNFile.Close


when I run it i get the error
Line: 22
Char: 9
Error: Unspecified error
Code: 80004005
Source: Provider

Reply With Quote
  #2  
Old November 6th, 2006, 08:50 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,932 Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)  Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 12 h 17 m 53 sec
Reputation Power: 2002
what is line 22?

Reply With Quote
  #3  
Old November 6th, 2006, 09:33 AM
Cpajoe2001 Cpajoe2001 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 33 Cpajoe2001 User rank is Corporal (100 - 500 Reputation Level)Cpajoe2001 User rank is Corporal (100 - 500 Reputation Level)Cpajoe2001 User rank is Corporal (100 - 500 Reputation Level)Cpajoe2001 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 7 h 50 m 43 sec
Reputation Power: 4
Set objRecordSet = objCommand.Execute

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > ADSI help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT