The VBScript Network and Systems Administrator's Cafe:

web sites

Feb 26 2009   8:00AM GMT

Retrieving the account IIS is using as the anonymous user account with VBScript



Posted by: Jerry Lees
iis, System Administration, Systems Administration, systems management, VBScript Functions, VBScript, web sites, web tools, working with objects

I recently posted a script that retrieved the anonymous user password for a server in IIS. This script I posted, Using the IIS ADSI object to retrieve the anonymous user password for a server via VBScript, came in quite handy in a pinch, but not knowing the anonymous user account the password goes with can also be a pain.Luckily I had that piece of information in the script as well!

So, I’ve wrapped that part of the script into a function for your use as well. Below is a snippet from the script to display the user account.

Function Get_IUSR_Username(ServerName)
Dim IIsObject

Set IIsObject = GetObject (”IIS://” & ServerName & “/w3svc”)
on Error resume Next
Get_IUSR_Username = IIsObject.Get(”AnonymousUserName”)
On Error GoTo 0
End Function

Enjoy!

Jan 8 2009   2:18AM GMT

Essential tools: Fiddler Web Debugger, Display HTTP packets LIVE without a packet sniffer



Posted by: Jerry Lees
essential tools, System Administration, Web applications, web sites, webmaster, free software, free tools

You may have been thinking I had forgotten about this series of articles since I haven’t posted to it in a while. Nope! Just haven’t run across anything that was truely aazing enough to be an “Essential Tool”. Well, I recently found just that web I had to troubleshoot a application that was making calls to a web service.

The tool i was lead to is Fiddler, the Web Debugger!!! If you’re like me and you have to trouble shoot web applications that make web service calls– you’re going to LOVE fiddler. No more digging through logs to determine problems real time, especially since IIS caches the log data and writes it in chunks.

Fiddler displays the HTTP (and HTTPS) traffic originated from a machine it is ran on and then shows the cooresponding response from the server you connected with in the request. It’s a real life saver, especially if your not certain the packet is well formed for a SOAP web service on the other end. As an added bonus, Fiddler also allows you to see the raw HTTP (or HTTPS) headers and response headers.

Best of all it’s FREE!!! (We’ll it cost me a $250 call to Microsoft to find out about it… but the application is free and for you the information is free!) Try it out— TODAY!


Nov 3 2008   4:18PM GMT

HTTP Status Codes explained for web servers



Posted by: Jerry Lees
HTTP, web tools, web sites, Web applications, webmaster, http tools, Web Pages, HTTP Status Codes

As a web administrator I encounter quite a few instances where a weird HTTP status is returned to a browser.Even using them often it’s hard to remember the codes 100% and what they all mean. Sure, a 404 means the file doesn’t exist and a 200 is a good response… but what about the harder more obscure ones? Generally the toughest to resolve revolve around permissions and the HTTP 401.x status, here is a good article explaining the HTTP 401 sub status codes for IIS (The general idea will flow over to other web servers like apache as well).

As a  added bonus here is a great article that explains a vast variety of other HTTP Status codes.


Oct 31 2008   6:17AM GMT

Using Internet Explorer objects to scrape links from web pages.



Posted by: Jerry Lees
web tools, web sites, wget, Web Pages, InternetExplorer.Application

 Recently, I needed to write a tool that would scrape the links from a page. To accomplish this I used the Internet Explorer object “InternetExplorer.Application“.  We’ll explain it a bit more in a later entry but for now, take a look at the code below:

URL = “http://itknowledgeexchange.techtarget.com/itblogs/

With CreateObject(”InternetExplorer.Application”)
  .Navigate URL
  Do Until .ReadyState = 4
    Wscript.sleep 10
  Loop
  for each link in .document.links
    Wscript.echo link, link.InnerText
  next

‘ Uncomment the three lines below to scrape references to images
‘  for each pix in .document.images
‘  Wscript.echo pix.src
‘  Next
 
  .Quit
End With


Oct 16 2008   2:53AM GMT

Consuming and using a web service from within VBScript to create a WHOIS tool



Posted by: Jerry Lees
VBScript, SOAP, WSDL, web tools, web sites, Web Service, Web Pages

Recently I posted a list of web services at a site that were public web services, in the article entitled A Great list of FREE publicly available Web Services. In looking through them I noticed one that would be useful- a WHOIS web service!

Please keep in mind that this script uses a PUBLIC and FREE web service to preform the heart of it’s work… it might not be always available and that is out of both our control. However, the code will work, with minor changes where noted for any other web service.

First some background on a web service. When you consume (use) a web service, you call it like you would any other class or function, with a .functionname after the object is created as an instance.

The MSSOAP.SOAPClient line below creates a SOAP object, and the .MSSOAPINIT creates an instance of your web service in that object. Then, in this case the .whois  call actually makes it preform the functions on the remote system. The remote system then returns back the value from the function to you just as if a local function were called.

Pretty cool stuff! So, here is the code to call a web service from VBScript!
dim SOAPClient, Response
‘create the SOAP object
Set SOAPClient = createobject(”MSSOAP.SOAPClient”)
on error resume Next
‘create a instance of the WHIOIS web service
SOAPClient.mssoapinit(”
http://www.ecubicle.net/whois_service.asmx?WSDL“)
  ‘ check for errors… deal with them if they occur by reporting them
  if err Then
    wscript.echo SOAPClient.faultString
    wscript.echo SOAPClient.detail
  end If

‘this next line is where we actually CALL the web service
Response = SOAPClient.Whois(”whois.networksolutions.com”, 43, “networksolutions.com”)

‘fix up network solutions’ HTML responses to whois queries. why do they have to be difficult?
Response = replace(Response,”<br/>”,VbCrLf)
Response = replace(Response,”<BR/>”,VbCrLf)

‘ echo the response recieved (since it’s a string)
wscript.echo Response

‘ check for errors… deal with them if they occur by reporting them
  if err Then
    wscript.echo SOAPClient.faultString
    wscript.echo SOAPClient.detail
  End If


Oct 10 2008   7:57PM GMT

A Great list of FREE publicly available Web Services



Posted by: Jerry Lees
SOAP, WSDL, web tools, web sites, Web Service, webmaster, Web Pages

As an IIS Administrator I have spent quite a bit of time administering web sites and web services in my role where I work. Recently, I have been doing some work with Web Services in IIS to actually monitor them since we needed to do more than just simply monitor the Web Service Definition Language (WSDL) page.

For those of you who do this sort of work, you know this is a real challenge sometimes, since the web service can actually be broken– but the WSDL page shows up. So, I had to create something to actually consume the web service so that we could truely test the web service.

Web Services are basically (yes, I’m boiling it down to the bare minimum here…) web sites that accept input via the HTTP protocol, preform work based on those parameters, and return back some value via HTTP. Just like a FUNCTION! This is an exciting technology, becasue it essentially is distributed computing.

This caused me to look for public web services, again, because I was interested in the concept since I first heard about it 4 or 5 years back. I found a decent site that had a list of web services that were available on the internet at Xmethods.net. While they all aren’t free (and they all didn’t appear to be operational) — it did seem like a decent list of sometimes useful stuff to have handy.

Having found this, I can now share the consumption of web services from VBScript with you in another blog posting– Consuming and using a web service from within VBScript to create a WHOIS tool.


Jul 18 2008   3:46PM GMT

Useful site: Tons of free books online… did I mention free?



Posted by: Jerry Lees
Networking, routers, Documentation, Development, Developer documentation, Exchange, web sites, online books, online resources

I like free stuff. Who doesn’t? And with the price of technology books you can imagine I was amazed when I found a pretty cool site recently, Scribd, that allows you to upload electronic documents. They then add this document to the database they have and make it search-able. Plus, you can search the database for specific subjects or words.

Not only are regular people uploading books and documents, but there are publisher’s uploading books. Sometimes they are just excerpts, but sometimes they are entire books as well like:

ASP Programming for the Absolute Beginner
Beginning ASP NET 3 5 in C Sharp 2008 From Novice to Professional
MSPress Exam 70-284 Implementing and managing Exchange server 2003

There’s even a CCIE Study Guide and my personal favorite the VBScript Complete Reference !

 And Many Many more… so stroll on over there and see what you can find!

Enjoy!