Error 800A01A8 is medium-difficult error to solve. The secret of success is knowing where to expect a VBScript method.
Another cause is inconsistent use of script variables.
The script does not execute as you hoped, instead you get a WSH error message. One possibility is that you are using a WSH object does not exist or has not been declared.
The Cause of Error 800A01A8
Your VBScript contains an illegal method, probably a typing mistake or an
extra letter. Check the logic of your METHOD statement. Note Source:
Microsoft VBScript runtime error.
The Solutions to Object Required
Look for clues particularly the Line: number and check the Char: references. In the example it is Line 4. Char : 1. In this case it is not
Char 1 to blame, more that there is something wrong and none of the line can execute. Once you have located the line, pay close attention to the spelling of your objects and methods. Research a
similar method in another script.
Alternatively, try adding Option Explicit to the beginning of your VBScript. My idea is to discover if you have mistyped the name of a variable.
Incidentally, in the WSH message, Source: reports a runtime error not a compilation error, this means you are not looking for a pure syntax problem such as a missing bracket. The most likely cause
is a typo which induces faulty logic.
In the case of runtime errors, you can use this temporary work around. Add this statement just before the line which errors: On Error Resume Next.
The problem here is a mix up with the singular 'net' and the plural 'nets'. As we declared nets we should be consistent and in line 3 say: Set nets (not Set net).
A typo turns into a logical error because nets has not been created, therefore we cannot use it to add a printer. Incidentally, this is a classic case for always using either singular or plural
variables.
' VBScript 800A01A8 Error code - Object required
Dim nets
Set net = CreateObject("WScript.Network")
nets.AddWindowsPrinterConnection "\\lucy4\dotty",
"Dot Matrix"
Calculating IP Address ranges is a black art, which many network managers
solve by creating custom Excel spreadsheets. IPAT cracks this problem of
allocating IP addresses in networks in two ways:
For Mr Organized there is a nifty subnet calculator, you enter the network
address and the subnet mask, then IPAT works out the usable addresses and their
ranges. For Mr Lazy IPAT discovers and then displays the IP addresses of existing
computers.
This is an example where a vital command or object is completely missing.
As is so often the case, the line number is of great help with code 800xxxxx errors. Here on Line 19 is the error: Set objUser = (strPath). In this instance, '[string: "LDAP://cn=elizabeth,"]'
tells only part of the story. There is a problem with cn=elizabeth, but its a missing command GetObject.
What is missing is GetObject
It should be :Set objUser = GetObject(strPath)
' Bind.vbs Code Error 800A01A8 - Object required
' Stage 1) Binds to Active Directory
' Version 1.2
' Guy Thomas 18th July 2010
' Commands to bind to AD and extract domain name
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("DefaultNamingContext")
WScript.Echo "Active Directory Path: " & strDNSDomain
' Edit the next line to reflect your OU
strOU ="cn=elizabeth,OU=Worcester,"
strUser ="cn=elizabeth"
' Building the LDAP path
strPath ="LDAP://"& strOU & strDNSDomain
Set objUser = (strPath) Wscript.Echo "DN "& objUser.get("distinguishedName")
WSCript.Quit
' End of Example error 800A01A8 Script
I solved this problem using the parallel script technique, finding a similar script that
worked and then comparing the statements.
Guy
Recommends: WMI Monitor and It's Free!
Windows Management Instrumentation (WMI) is one of the hidden
treasures of Microsoft operating systems. Fortunately, Solarwinds
have created the
WMI Monitor so that you can examine these gems of
performance information for free. Take the guess work out of which
WMI counters to use for applications like Microsoft Active Directory,
SQL or Exchange Server.
Thus utility makes it easy to check the health of a router or firewall. Check the real-time performance and availability statistics for any device
on your network.