![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| | #2 (permalink) |
| | 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" > ----------------------------------------------------------------------------------------------------- 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 Specs![]() |
| | #3 (permalink) |
| | 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 Specs![]() |
| | #4 (permalink) |
| | 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 Specs![]() |
![]() |
| 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 | |||