Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

GetObject( "IIS://" & serverName & "/W3SVC" ) not work to get remote win2003 IIS service

$
0
0

Hi Guys,

I try to check IIS account IUSER and IWAM on remote servers. But I found the code not work for getting remote Win2003 but works fine to get remote win2008. Can any one give some adivce? Thanks!

Sample code here:

Set objWebService = GetObject( "IIS://" & serverName & "/W3SVC" )

 For Each objWebServer In objWebService
    'Initialized the flag 
    HasIUSER = True
    HasIWAM = True
    
    ' Check for IUSR Account
    ShowMessage "IUSR user: " & objWebserver.AnonymousUsername
    If IsNull(objWebserver.AnonymousUsername) Then
     ShowMessage "IUSR is disabled on the site " & objWebServer.adspath
     HasIUSER = False
    End If 

    ' Check for IWAM Account
    ShowMessage "IWAM user: " & objWebserver.AppWamClsid
    If IsNull(objWebserver.AppWamClsid) Or (Len(objWebserver.AppWamClsid) = 0) Then
     ShowMessage "IWAM user is disabled on the site " & objWebServer.adspath
     HasIWAM = False
    End If
   
 Next



Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>