Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Help with error in script please

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,61542
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Help with error in script please
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Help with error in script please - 6/17/2008 11:36:35 PM   
  ninjamaster

 

Posts: 107
Score: 0
Joined: 1/23/2007
Status: offline
I have been asked to write a script (see http://www.visualbasicscript.com/m.aspx?m=61020&mpage=1&key= from my first ramblings) to query active directory and extract email information.

After much scouring the net I found a script that pulls the SMTP info from an array and writes to a file. I have amended that script to suit (ask which office to check, incude the alias field and create output file) 


Problem I have is when I run the script against certain OU within AD it fails with the fantastically helpful "Provider: One or more errors occurred during processing of command" error message.
(Line 53 "Set objRecordSet2 = objCommand.Execute")

If I run the line that the error message links to (Pulling alias from AD) without the rest of the script it pulls the info fine.

This is my code. I'll post the script that only pulls the alias info. Like I said run both scripts against the same OU and the major script fails but the Alias-only one runs through. :#


      
 
 
Post #: 1
 
 RE: Help with error in script please - 6/17/2008 11:38:45 PM   
  ninjamaster

 

Posts: 107
Score: 0
Joined: 1/23/2007
Status: offline
Heres the Alias only part. Ran against the same OU this one works.


      

(in reply to ninjamaster)
 
 
Post #: 2
 
 RE: Help with error in script please - 6/17/2008 11:47:22 PM   
  ninjamaster

 

Posts: 107
Score: 0
Joined: 1/23/2007
Status: offline
I've added On Error Next Resume to get "past the problem" but still curious as to why it's doing it.

(in reply to ninjamaster)
 
 
Post #: 3
 
 RE: Help with error in script please - 6/18/2008 12:18:01 AM   
  dm_4ever


Posts: 2665
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
I haven't looked at all your code yet, but I came across a similar error when querying AD with a user that had an apostrophe in the name ' so I just used the replace function to replace a single apostrophe with two of them ''  (Note: not the same as quotations ")

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to ninjamaster)
 
 
Post #: 4
 
 RE: Help with error in script please - 6/18/2008 12:40:54 AM   
  ninjamaster

 

Posts: 107
Score: 0
Joined: 1/23/2007
Status: offline
quote:

ORIGINAL: dm_4ever

I haven't looked at all your code yet, but I came across a similar error when querying AD with a user that had an apostrophe in the name ' so I just used the replace function to replace a single apostrophe with two of them ''  (Note: not the same as quotations ")



oooh. Interesting as I know that one of the OU's has a ' in the name. Let me check the rest of them adn see if the model fits.

:)

(in reply to dm_4ever)
 
 
Post #: 5
 
 RE: Help with error in script please - 6/18/2008 12:50:33 AM   
  ninjamaster

 

Posts: 107
Score: 0
Joined: 1/23/2007
Status: offline
Nail. Hit. Head.

Thanks

:)

(in reply to dm_4ever)
 
 
Post #: 6
 
 RE: Help with error in script please - 6/18/2008 1:58:18 AM   
  ninjamaster

 

Posts: 107
Score: 0
Joined: 1/23/2007
Status: offline
What I don't understand is why I don't get the error in the "simple" script but when incorporating the simple script into the bigger one I get the error message? :#

(in reply to dm_4ever)
 
 
Post #: 7
 
 RE: Help with error in script please - 6/18/2008 2:27:23 AM   
  dm_4ever


Posts: 2665
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
The "simple" one seems to only be querying for data and writing it to a file...have you tried modifying that simple one by adding an office or user that contains an apostrophe?

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to ninjamaster)
 
 
Post #: 8
 
 RE: Help with error in script please - 6/18/2008 2:43:50 AM   
  ninjamaster

 

Posts: 107
Score: 0
Joined: 1/23/2007
Status: offline
yip and it runs fine. Lists users with apostrophe in the name.

So to check I ran the bigger script against an OU and ran fine. Created a user with O'Test as surname within the OU and script throw up the error. But ran the smaller script against the OU before and after the user creation and worked fine both times.

I'm well confused

(in reply to dm_4ever)
 
 
Post #: 9
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Help with error in script please Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts