"dan foxley" <dfoxley.RemoveThis@nospampacificdatavision.com> wrote in message
news:%23H4bm37TEHA.1284@TK2MSFTNGP10.phx.gbl...
> I was thinking a .vbs to find out how many people on an IIS server and the
> like, I guess I could just setup a Permon to show it, but though some
> scripts might be around.
here you have a sample, made with VB6.
For vbs, just remove the 'as ...' so strong data types become variant.
Sub main()
Dim oLocator As SWbemLocator
Set oLocator = New SWbemLocator
Dim oService As SWbemObject
Dim oServices As SWbemServices
' connect local
Set oServices = oLocator.ConnectServer
Dim props As SWbemPropertySet
Dim prop As SWbemProperty
'dim subprop
Dim stringArray() As Variant
Dim longArray() As Variant
Dim intArray() As Variant
Dim cx As Long
For Each oService In
oServices.InstancesOf("Win32_PerfRawData_W3SVC_WebService")
Set oprops = oService.Properties_
For Each prop In oprops
Debug.Print prop.Name, ":";
If IsNull(prop.Value) Then
Debug.Print "null"
Else
If prop.IsArray Then
'loop through array here
Select Case prop.CIMType
Case wbemCimtypeString
' cast to more efficient data type
stringArray = prop.Value
For cx = 0 To UBound(stringArray)
Debug.Print stringArray(cx); ",";
Next
Debug.Print 'newline
Case wbemCimtypeUint16
intArray = prop.Value
For cx = 0 To UBound(intArray)
Debug.Print intArray(cx); ",";
Next
Debug.Print 'newline
Case wbemCimtypeSint32
longArray = prop.Value
For cx = 0 To UBound(longArray)
Debug.Print longArray(cx); ",";
Next
Debug.Print 'newline
Case Else
Debug.Print TypeName(prop.Value(0))
Stop
End Select
Else
Select Case prop.CIMType
Case wbemCimtypeString
Debug.Print prop.Value
Case wbemCimtypeSint32
Debug.Print prop.Value
Case wbemCimtypeUint32
Debug.Print prop.Value
Case wbemCimtypeObject
'set subprop
End Select
End If
End If
Next
Next
End Sub
> dan
>
> "Egbert Nierop (MVP for IIS)" <egbert_nierop.RemoveThis@nospam.invalid> wrote in
> message news:evPWuk3TEHA.1984@TK2MSFTNGP12.phx.gbl...
> > "dan foxley" <dfoxley.RemoveThis@nospampacificdatavision.com> wrote in message
> > news:ONVJFaxTEHA.644@tk2msftngp13.phx.gbl...
> > > Any scripts out there to get current IIS 6.0 server stats?
> > >
> > > Dan Foxley
> >
> > which stats?
> > Logs or performance/memory?
> > for Logs you can get the IIS LOg parser...
> >
>
<a style='text-decoration: underline;' href="http://www.microsoft.com/downloads/details.aspx?FamilyID=56fc92ee-a71a-4c73-b628-ade629c89499&displaylang=en" target="_blank">http://www.microsoft.com/downloads/details.aspx?FamilyID=56fc92ee-a71a...73-b628</a>
> >
> > I believe that Aaron Bertrand (a SQL MVP) has a lot of 'status' scripts
> for
> > IIS. But I just can't find them.
> >
>
><!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: Who is logged on with .vbs?