IIS ADSI object
am 28.01.2008 15:17:01 von Enthus
Hi
I am using the following snippet on IIS 5 servers and it is still retrieving
deleted (long time back) virtual directories as well. Can you please let me
know what is wrong with the script? By the way I am running this on remote
computers as well and same results for them too.
strComputer="localhost"
Set objWeb = GetObject("IIS://" &strComputer& "/W3SVC")' Get handle to IIS
server
If Err.Number <> 0 Then
Wscript.echo "Error in Main"
Else
For Each objWebServer IN objWeb
If objWebserver.Class = "IIsWebServer" Then
webSiteName=objWebserver.Name
listVDirs(webSiteName)
End If 'End of Web Server Check
Next ' End of For loop
End If 'End of ADSI Object
Set objWeb = Nothing
Sub listVDirs(webSN)
On Error Resume Next
Set objVDir = GetObject("IIS://" &strComputer& "/W3SVC/" & webSN &
"/ROOT")
If Err.Number <> 0 Then
Wscript.echo "Error in Sub"
Else
For Each vDir In objVDir
vDirName = vDir.Name
Wscript.echo vDirName
Next 'End of For loop
End If 'End of Virtual Enumeration
Set objVDir = Nothing
End Sub
RE: IIS ADSI object
am 28.01.2008 17:28:01 von Enthus
I guess there is nothing wrong with script. I just used Metabase explorer on
the local host and remote computer these deleted virtual directories still
exist in it. Is there a better way to delete unused / retired virtual
directories from IIS 5 so that they get deleted from metabase as well?
"Enthus" wrote:
> Hi
> I am using the following snippet on IIS 5 servers and it is still retrieving
> deleted (long time back) virtual directories as well. Can you please let me
> know what is wrong with the script? By the way I am running this on remote
> computers as well and same results for them too.
>
> strComputer="localhost"
>
> Set objWeb = GetObject("IIS://" &strComputer& "/W3SVC")' Get handle to IIS
> server
> If Err.Number <> 0 Then
> Wscript.echo "Error in Main"
> Else
> For Each objWebServer IN objWeb
> If objWebserver.Class = "IIsWebServer" Then
> webSiteName=objWebserver.Name
> listVDirs(webSiteName)
> End If 'End of Web Server Check
> Next ' End of For loop
> End If 'End of ADSI Object
> Set objWeb = Nothing
>
>
> Sub listVDirs(webSN)
> On Error Resume Next
> Set objVDir = GetObject("IIS://" &strComputer& "/W3SVC/" & webSN &
> "/ROOT")
> If Err.Number <> 0 Then
> Wscript.echo "Error in Sub"
> Else
> For Each vDir In objVDir
> vDirName = vDir.Name
> Wscript.echo vDirName
> Next 'End of For loop
> End If 'End of Virtual Enumeration
> Set objVDir = Nothing
> End Sub
>
Re: IIS ADSI object
am 28.01.2008 20:41:59 von Kristofer Gafvert
Better than what? How do you delete these objects today? I suppose that
using IIS Manager should work fine, doesn't it?
--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info
"Enthus" skrev i meddelandet
news:972DE99D-FCE0-4436-B6D4-47CEA7770110@microsoft.com...
>I guess there is nothing wrong with script. I just used Metabase explorer
>on
> the local host and remote computer these deleted virtual directories still
> exist in it. Is there a better way to delete unused / retired virtual
> directories from IIS 5 so that they get deleted from metabase as well?
>
>
>
>
>
> "Enthus" wrote:
>
>> Hi
>> I am using the following snippet on IIS 5 servers and it is still
>> retrieving
>> deleted (long time back) virtual directories as well. Can you please let
>> me
>> know what is wrong with the script? By the way I am running this on
>> remote
>> computers as well and same results for them too.
>>
>> strComputer="localhost"
>>
>> Set objWeb = GetObject("IIS://" &strComputer& "/W3SVC")' Get handle to
>> IIS
>> server
>> If Err.Number <> 0 Then
>> Wscript.echo "Error in Main"
>> Else
>> For Each objWebServer IN objWeb
>> If objWebserver.Class = "IIsWebServer" Then
>> webSiteName=objWebserver.Name
>> listVDirs(webSiteName)
>> End If 'End of Web Server Check
>> Next ' End of For loop
>> End If 'End of ADSI Object
>> Set objWeb = Nothing
>>
>>
>> Sub listVDirs(webSN)
>> On Error Resume Next
>> Set objVDir = GetObject("IIS://" &strComputer& "/W3SVC/" & webSN &
>> "/ROOT")
>> If Err.Number <> 0 Then
>> Wscript.echo "Error in Sub"
>> Else
>> For Each vDir In objVDir
>> vDirName = vDir.Name
>> Wscript.echo vDirName
>> Next 'End of For loop
>> End If 'End of Virtual Enumeration
>> Set objVDir = Nothing
>> End Sub
>>
Re: IIS ADSI object
am 28.01.2008 21:46:04 von Enthus
I am using IIS manager. But virtual directories deleted one week ago are
still in the metabase.bin. Clearly these apps are not visible when I use IIS
manager but are not deleted from Metabase.bin.
"Kristofer Gafvert" wrote:
> Better than what? How do you delete these objects today? I suppose that
> using IIS Manager should work fine, doesn't it?
>
> --
> Regards,
> Kristofer Gafvert
> http://www.gafvert.info/iis/ - IIS Related Info
>
>
> "Enthus" skrev i meddelandet
> news:972DE99D-FCE0-4436-B6D4-47CEA7770110@microsoft.com...
> >I guess there is nothing wrong with script. I just used Metabase explorer
> >on
> > the local host and remote computer these deleted virtual directories still
> > exist in it. Is there a better way to delete unused / retired virtual
> > directories from IIS 5 so that they get deleted from metabase as well?
> >
> >
> >
> >
> >
> > "Enthus" wrote:
> >
> >> Hi
> >> I am using the following snippet on IIS 5 servers and it is still
> >> retrieving
> >> deleted (long time back) virtual directories as well. Can you please let
> >> me
> >> know what is wrong with the script? By the way I am running this on
> >> remote
> >> computers as well and same results for them too.
> >>
> >> strComputer="localhost"
> >>
> >> Set objWeb = GetObject("IIS://" &strComputer& "/W3SVC")' Get handle to
> >> IIS
> >> server
> >> If Err.Number <> 0 Then
> >> Wscript.echo "Error in Main"
> >> Else
> >> For Each objWebServer IN objWeb
> >> If objWebserver.Class = "IIsWebServer" Then
> >> webSiteName=objWebserver.Name
> >> listVDirs(webSiteName)
> >> End If 'End of Web Server Check
> >> Next ' End of For loop
> >> End If 'End of ADSI Object
> >> Set objWeb = Nothing
> >>
> >>
> >> Sub listVDirs(webSN)
> >> On Error Resume Next
> >> Set objVDir = GetObject("IIS://" &strComputer& "/W3SVC/" & webSN &
> >> "/ROOT")
> >> If Err.Number <> 0 Then
> >> Wscript.echo "Error in Sub"
> >> Else
> >> For Each vDir In objVDir
> >> vDirName = vDir.Name
> >> Wscript.echo vDirName
> >> Next 'End of For loop
> >> End If 'End of Virtual Enumeration
> >> Set objVDir = Nothing
> >> End Sub
> >>
>
>