Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

1,742 views
Skip to first unread message

Ruok

unread,
Oct 17, 2008, 4:59:18 AM10/17/08
to
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.


Ruok

unread,
Oct 17, 2008, 5:26:48 AM10/17/08
to
BTW, this script works for Administrators group. Both DN's
(destinguished names) I copied from ADSI Edit, so spelling mistakes
can be excluded. Interestingly, I had the same situation on another
domain (2003) - it worked for administrators, but not for domain
admins. Is that group somehow different?

Thanks.

Richard Mueller [MVP]

unread,
Oct 17, 2008, 8:49:59 AM10/17/08
to
Ruok wrote:

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
--


Ruok

unread,
Oct 22, 2008, 8:11:27 AM10/22/08
to
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

Ruok

unread,
Oct 22, 2008, 9:14:41 AM10/22/08
to

Matthew Evans

unread,
Apr 15, 2011, 9:57:50 AM4/15/11
to
Hi,

I am trying to delete a computer from a domain but logged on as a local administrator. I was looking at using the following script:

strDelPC = domain_controller/CN=computer_name,CN=Computers,DC=domain,DC=com

set delComputer = GetObject("LDAP://" & strDelPC )
delComputer.DeleteObject (0)

I keep getting Error: 0x80005000, Code: 80005000
Source: (null)

I have already got access using the following further up the script:

' Determine DNS domain name
Set objNS = GetObject("LDAP:")
Set objRootDSE = objNS.OpenDSObject("LDAP://" & strServer & "/RootDSE", _
strUser, strPassword, _
ADS_SERVER_BIND or ADS_SECURE_AUTHENTICATION)

Can anyone help?

> On Friday, October 17, 2008 8:49 AM Richard Mueller [MVP] wrote:

> Ruok wrote:
>
>
> 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
> --


>> On Saturday, October 18, 2008 1:05 PM Ruok wrote:

>> Hi,

>> Thank you for your help.

Al Dunbar

unread,
Apr 15, 2011, 7:40:52 PM4/15/11
to

"Matthew Evans" <it.su...@advancedsupplychain.com> wrote in message
news:201141595...@terrranews.com...


> Hi,
>
> I am trying to delete a computer from a domain but logged on as a local
> administrator. I was looking at using the following script:
>
> strDelPC =
> domain_controller/CN=computer_name,CN=Computers,DC=domain,DC=com

Try quoting your literal string like this:

strDelPC =
"domain_controller/CN=computer_name,CN=Computers,DC=domain,DC=com"

If that isn't the problem, try posting a copy of the actual script used.

Also, note that you are replying to a post that is about two and a half
years old.


/Al

0 new messages