Welcome to HostingForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

IIS ADSI object

 
   Web Hosting Problem Solving Community! (Home) -> IIS RSS
Next:  absolute path to ImageUrl property .....  
Author Message
Enthus

External


Since: Jan 11, 2008
Posts: 7



(Msg. 1) Posted: Mon Jan 28, 2008 6:17 am
Post subject: IIS ADSI object
Archived from groups: microsoft>public>inetserver>iis (more info?)

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

 >> Stay informed about: IIS ADSI object 
Back to top
Login to vote
Enthus

External


Since: Jan 11, 2008
Posts: 7



(Msg. 2) Posted: Mon Jan 28, 2008 8:28 am
Post subject: RE: IIS ADSI object [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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
>

 >> Stay informed about: IIS ADSI object 
Back to top
Login to vote
kgafvert

External


Since: Aug 23, 2003
Posts: 3146



(Msg. 3) Posted: Mon Jan 28, 2008 4:04 pm
Post subject: Re: IIS ADSI object [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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" <Enthus.DeleteThis@discussions.microsoft.com> 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
>>
 >> Stay informed about: IIS ADSI object 
Back to top
Login to vote
Enthus

External


Since: Jan 11, 2008
Posts: 7



(Msg. 4) Posted: Mon Jan 28, 2008 4:04 pm
Post subject: Re: IIS ADSI object [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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" <Enthus RemoveThis @discussions.microsoft.com> 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
> >>
>
>
 >> Stay informed about: IIS ADSI object 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting Problem Solving Community! (Home) -> IIS All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]