Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Script Error: 0x80005000, Code: 80005000, Source: (null)

Reply
 
Old 10-17-2008   #1 (permalink)
Ruok


 
 

Script Error: 0x80005000, Code: 80005000, Source: (null)

Hi,

I'm running this script on Windows 2008 domain from Exchange 2003
server (all DC's are 2008 core - no GUI). I copied a sript that worked
in other 2003 domain, but now it does not. Is there a difference with
2008 domain? I get the below error message.

---------------------------
Windows Script Host
---------------------------
Script: C:\Documents and Settings\eurodata\Desktop\Scripts\Write
Domain Admins to a file.vbs
Line: 12
Char: 5
Error: 0x80005000
Code: 80005000
Source: (null)

---------------------------
OK
---------------------------

Line 12 is:

Set objUser = GetObject("LDAP://" & strUser)

And the whole script:

------------------------------------------------------------------------------
Dim arrNames()
intSize = 0

Set objFSO = CreateObject("Scripting.FileSystemObject")
strfilepath = inputbox( "Please Enter Path and File Name. The output
is in xls Format.", "Input" )

Set objTextFile = objFSO.CreateTextFile(strfilepath & ".xls", True)

Set objGroup = GetObject("LDAP://cn=Domain
Admins,CN=Users,dc=bedford,dc=local")

For Each strUser in objGroup.Member
Set objUser = GetObject("LDAP://" & strUser)
ReDim Preserve arrNames(intSize)
arrNames(intSize) = objUser.CN
intSize = intSize + 1
Next

For i = (UBound(arrNames) - 1) to 0 Step -1
For j= 0 to i
If UCase(arrNames(j)) > UCase(arrNames(j+1)) Then
strHolder = arrNames(j+1)
arrNames(j+1) = arrNames(j)
arrNames(j) = strHolder
End If
Next
Next

For Each strName in arrNames
objTextFile.WriteLine strName
Next

WScript.Echo "This Script is now complete"
-----------------------------------------------------------------------------------------------------

Thank you for your help.



My System SpecsSystem Spec
Old 10-17-2008   #2 (permalink)
Richard Mueller [MVP]


 
 

Re: Script Error: 0x80005000, Code: 80005000, Source: (null)

Ruok wrote:
Quote:

> I'm running this script on Windows 2008 domain from Exchange 2003
> server (all DC's are 2008 core - no GUI). I copied a sript that worked
> in other 2003 domain, but now it does not. Is there a difference with
> 2008 domain? I get the below error message.
>
> ---------------------------
> Windows Script Host
> ---------------------------
> Script: C:\Documents and Settings\eurodata\Desktop\Scripts\Write
> Domain Admins to a file.vbs
> Line: 12
> Char: 5
> Error: 0x80005000
> Code: 80005000
> Source: (null)
>
> ---------------------------
> OK
> ---------------------------
>
> Line 12 is:
>
> Set objUser = GetObject("LDAP://" & strUser)
>
> And the whole script:
>
> ------------------------------------------------------------------------------
> Dim arrNames()
> intSize = 0
>
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> strfilepath = inputbox( "Please Enter Path and File Name. The output
> is in xls Format.", "Input" )
>
> Set objTextFile = objFSO.CreateTextFile(strfilepath & ".xls", True)
>
> Set objGroup = GetObject("LDAP://cn=Domain
> Admins,CN=Users,dc=bedford,dc=local")
>
> For Each strUser in objGroup.Member
> Set objUser = GetObject("LDAP://" & strUser)
> ReDim Preserve arrNames(intSize)
> arrNames(intSize) = objUser.CN
> intSize = intSize + 1
> Next
>
> For i = (UBound(arrNames) - 1) to 0 Step -1
> For j= 0 to i
> If UCase(arrNames(j)) > UCase(arrNames(j+1)) Then
> strHolder = arrNames(j+1)
> arrNames(j+1) = arrNames(j)
> arrNames(j) = strHolder
> End If
> Next
> Next
>
> For Each strName in arrNames
> objTextFile.WriteLine strName
> Next
>
> WScript.Echo "This Script is now complete"
> -----------------------------------------------------------------------------------------------------
The basic code works fine except in one rare situation. If any member of the
group has a forward slash "/" anywhere in the name you get the error you
describe. ADSI doesn't handle the character correctly. In VBScript the fix
is to escape it with the backslash escape character. For example:
=======
For Each strMemberDN in objGroup.Member
strMemberDN = Replace(strMemberDN, "/", "\/")
Set objMember = GetObject("LDAP://" & strMemberDN)
Wscript.Echo objMember.cn
Next
========
For discussion of characters to escape see this link:

http://www.rlmueller.net/CharactersEscaped.htm

There are several characters that must be escaped if you hard code a
Distinguished Name, but ADSI escapes them all for you (when you use ADSI
methods or attributes) except for the forward slash.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


My System SpecsSystem Spec
Old 10-22-2008   #3 (permalink)
Ruok


 
 

Re: Script Error: 0x80005000, Code: 80005000, Source: (null)

I have failed to find any forbidden characters in names of Domain
Admins (they follow the same convention as Administrators). I managed
to get domain admins for the root domain with that script, so there's
nothing wrong with the nature of Domain Admins group. Also, I can get
Domain Admins by using other simple scripts. I used your script to get
CN paths, and the only suspicious character is "&", but this one does
not have to be escaped. How can I change my script (above) so it
escapes forbidden characters? It's a very nice scripts, because it
gives me only the details I want (just names), and it sorts them.
Sorting is not that much important , and I could also do some
filtering of the results in Excel, but it would be very good if you
could make it work.

Thanks
My System SpecsSystem Spec
Old 10-22-2008   #4 (permalink)
Ruok


 
 

Re: Script Error: 0x80005000, Code: 80005000, Source: (null)

I have failed to find any forbidden characters in names of Domain
Admins (they follow the same convention as Administrators). I managed
to get domain admins for the root domain with that script, so there's
nothing wrong with the nature of Domain Admins group. Also, I can get
Domain Admins by using other simple scripts. I used your script to get
CN paths, and the only suspicious character is "&", but this one does
not have to be escaped. How can I change my script (above) so it
escapes forbidden characters? It's a very nice scripts, because it
gives me only the details I want (just names), and it sorts them.
Sorting is not that much important , and I could also do some
filtering of the results in Excel, but it would be very good if you
could make it work.

Thanks
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
80005000 Error trap VB Script
Error code 137 Source NTFS Vista General
Remark source code .NET General
Re: "Error: 'null' is null or not an object" when trying to view video Vista performance & maintenance
Recommended Way To Source A Script PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46