Could not get object from IIS7 on Windows 7 from __set websvc = GetObject("IIS://localhost/MsFtpsvc")

This code was working on Vista system.

1.  Got first error with no error description when try to get object of "IIsFtpServer"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' find out default website whatever OS                                                '
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function FindWebName()
 Dim ServerSite
 Dim ServerObj

 Set ServerSite = GetObject("IIS://localhost/MsFTPSvc")
 Set ServerObj = ServerSite.GetObject("IIsFtpServer", "1")  
 FindWebName = ServerObj.ServerComment 
End Function

2.  Seond got empty object using this script:
 set websvc = GetObject("IIS://localhost/MsFtpsvc")

Answer
Answer
Hi,

This is because your script is meant to control an IIS 6 installation, not an IIS 7 and as such is using IIS 6 management scripting.

You can either find a way to do this with new code or turn on the IIS 6 management features in Windows 7.

To do the later, go into Control Panel -> Programs and Features -> Turn Windows features on or off

In this dialog, Expand Internet Information Services (I assume you have it turned on), Web Management Tools and turn on IIS 6 Management Compatibility...

That should get you working but let me know if it doesn't.

You may have to turn on IIS Management Scripts and Tools too but i'm not too sure.

Hope this helps,
Jon

http://www.insidetheregistry.com

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated February 9, 2023 Views 1,449 Applies to: