Failing to run ADSI scripts remotely against IIS?

Failing to run ADSI scripts remotely against IIS?

  • Comments 3

If you are trying to run an ADSI/WMI Script remotely from a client machine which gets information the from IIS web server around websites etc. you may see this:

Invalid syntax” or error code 800401E4

Or

Microsoft VBScript runtime error: The remote server machine does not exist or is unavailable: 'GetObject'

In my script I was using the following

GetObject( "IIS://" & ServerName & "/W3SVC" )

So basically the above error was complaining about the use of GetObject.

Resolution

1. Ensure Firewall is not blocking access to your server from remote access on the client.

2. ADSI provider should be installed on the client as well as the IIS machine for the above script to work. For running ADSI script against IIS we need to ensure the ADSI provider is installed as below.

Windows Server 2003/XP:

Add/Remove windows Components –> Application Server –> Internet Information services (IIS) –> Common Files.

Windows Vista/Windows 7:

Control Panel –> Programs and Features –> Turn Windows Features on or off –>  Internet Information Services –> Web Management tools –> IIS 6 Management Compatibility –> IIS Metabase and IIS 6 configuration compatibility

Windows Server 2008:

Server Manager –> Roles –> web Server (IIS) –> Add Role Services  –> Management Tools –> IIS 6 Management Compatibility –> Select IIS 6 Metabase compatibility, IIS 6 WMI compatibility and IIS 6 Scripting Tools.

Hoping It may help someone who might be struggling with trying to run the script remotely.

Ciao!

Leave a Comment
  • Please add 7 and 7 and type the answer here:
  • Post
  • Anyone know what firewall ports are required to be open?

  • Thanks for this information!! I had a vbs script to recycle a remote app pool running on Win2K3 that kept getting the Invalid Syntax error. I installed the IIS common files and voila...it now works perfectly. Thank you thank you!!

  • This page give me the solution to an error that occured in a script with IIS7. thanks a lot!!! :)

Page 1 of 1 (3 items)