The VBScript Network and Systems Administrator's Cafe: February, 2009 archives

The VBScript Network and Systems Administrator's Cafe:

February, 2009

Feb 28 2009   10:38AM GMT

The Scripting Crossword Puzzle



Posted by: Jerry Lees
VBScript, Games, Puzzles, Crossword

I found this recently and thought some of you might like to take a stab at it. A fun little crossword puzzle from Microsoft devoted to scripting concepts! Check it out, The Scripting Crossword Puzzle.

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!


Feb 20 2009   3:53PM GMT

Using the IIS ADSI object to retrieve the anonymous user password for a server via VBScript



Posted by: Jerry Lees
iis, System Administration, Systems Administration, Toolkit, VBScipt, VBScript Functions, VBScript, working with objects

I recently had to change the anonymous user account for a change request for a site in IIS, but unfortunately the change did not work and we had to roll it back. However, I didn’t have and wouldn’t have known the account’s password since IIS and windows changes it periodically.

So, out came the scripting tool belt and I found that I had a script written previously that let me get the anonymous user account and password through the IIS ADSI object.

Below is a snippet from the script to display the password.

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

Enjoy!


Feb 13 2009   6:40PM GMT

Creating a unique GUID for use in your VBScripts



Posted by: Jerry Lees
GUID, Scriptlet.TypeLib, VBScipt

Today I answered a question in the ITKE unanswered questions for Word VBA on how to be certain a filename was unique across several users using it. The answer I gave answered the question, but I knew there was a way to create GUID’s within VBScript but couldn’t recall how.

GUID’s are cryptic to look at, but they are pretty much guaranteed to be unique. After some research I found the library that provides this functionality… Scriptlet.TypeLib! Below is a short script that gives you an idea of how to use it in your scripts to generate unique strings for when you need a guaranteed unique name or identifier.

Option Explicit

Dim GUID
Set TypeLib = CreateObject(”Scriptlet.TypeLib”)
GUID = TypeLib.Guid

Enjoy!


Feb 10 2009   6:11PM GMT

Easily compare dates from with in VBScript



Posted by: Jerry Lees
VBScipt, DATEDIFF, date, Dates, Date Comparison, VBScript Functions

On occasion you need to compare two dates in your scripts, this can be a real challenge when you approach the date as if it were a string and/or compare the date parts to one another. Then finding the difference can be a whole other set of challenges if your dates span several months, days, or years.

Luckily, there is a function right into VBScript that helps you compare two dates to one another and returns the difference in a unit of time that you specify! That function is the datediff function!

Below is an example that returns the number of seconds, minutes, hours, days, and years between now and February 25, 1973.

Option Explicit

Dim DateThen, DateNow

DateThen = “2/25/1973″
DateNow = Now

WScript.Echo DateDiff(”s”,DateThen, DateNow)
WScript.Echo DateDiff(”n”,DateThen, DateNow)
WScript.Echo DateDiff(”h”,DateThen, DateNow)
WScript.Echo DateDiff(”d”,DateThen, DateNow)
WScript.Echo DateDiff(”yyyy”,DateThen, DateNow)

Enjoy!


Feb 5 2009   2:32PM GMT

New high-end enterprise search solution revealed from Microsoft



Posted by: Jerry Lees
Microsoft, searching google

 Apparently, Microsoft’s Live search wasn’t good enough… so like every normal Multi-Billion dollar company would do, They bought another one. Read below:

Here’s an update on the great results from Microsoft’s acquisition of enterprise search developer FAST Search & Transfer last April. As you may recall, the plan was to bring together FAST’s deep search expertise with the widely used SharePoint Server platform technology. Today, Microsoft gave out some details on FAST Search for SharePoint, a new search server that will add the high-end search capabilities of FAST ESP to SharePoint.

You can read more about the search buy-out here, New high-end enterprise search solution revealed.


Feb 2 2009   7:12PM GMT

BlogJetThis! extension for Firefox 3 Fixes Firefox plugin installation error



Posted by: Jerry Lees
blogjet, blog software, tips and tricks

This really isn’t Systems Administration related, but I recently started using a tool called blogjet to write blog entries and had a hard of a time getting the extensions to work properly in Firefox. It was telling me that the BlogJetThis! extension was not compatible with Firefox 3.0.6.

Essentially, It looks like it was installing a Firefox 2 extension… even though the extension said it was for “< 2.0”. A quick google search found this article that solved the issue.

 BlogJet extension for Firefox 3.