May 26 2009 2:49PM GMT
Posted by: Jerry Lees
IIS6,
System Administration,
iis,
iis 6,
web tools,
webmaster,
Microsoft Windows
In re-doing my laptop after a hard drive failure recently I’ve had to setup a bunch of stuff I had previously installed, one thing that several people have asked about (or didn’t know about) is the IIS6 MMC snap in. It allows you to Administer IIS6 from your desktop. It will give you the Internet Information Services (IIS6) Manager icon in Administrative tools and allow you to create custom MMC snap-ins for the web servers. It’s a huge time saver and allows you to do everything in IIS from your local machine (except administer SSL keys, so far as I can recall) that you can do while logged into the server—without logging onto the server!
First you’ll need IIS installed on your machine, via add/remove windows components in the add/remove programs control panel applet. After that run IIS 6 Mgr setup.exe from Microsoft’s Site here.
May 2 2009 6:19PM GMT
Posted by: Jerry Lees
VBScipt,
VBScript Functions,
file access,
file modified,
modification date,
System Administration,
Disk space,
disk utilities
I recently needed a way to tell if a file had been accessed or modified recently, something that has always been a question when you’re out of space on a server and can’t just add more space to it. What do you delete??? The Old files are the obvious answer… except if people are using them.
Here is teh script I wrote to tell if a file had been accessed or modified in the last X days. In the example I use 5 days, but you can use a different number of days when you call the function.
Enjoy!
Option Explicit
Dim fName
Const DateLastModified = 1, DateLastAccessed = 2
fName=”c:\temp2.txt”
if FileAge(fname,5,DateLastAccessed) = True Then
WScript.Echo (”The file was accessed recently enough!”)
Else
WScript.Echo (”The file was not accessed recently enough!”)
End If
if FileAge(fname,5,DateLastModified) = True Then
WScript.Echo (”The file was modified recently!”)
Else
WScript.Echo (”The file was not modified recently!”)
End If
Function FileAge(fName,fAge, CompareType)
‘function returns True if the file is older than the fAge (File Age) specified and false if it isn’t
Dim LastModified, LastAccessed, FSO, DateDifference
Set FSO = CreateObject(”Scripting.FileSystemObject”)
LastModified = FSO.GetFile(fname).DateLastModified
LastAccessed = FSO.GetFile(fname).DateLastAccessed
Select Case CompareType
Case 1
DateDifference = DateDiff(”n”,LastModified, Now())
Case 2
DateDifference = DateDiff(”n”,LastAccessed, Now())
End Select
If DateDifference > fage Then
FileAge = False
Else
FileAge = True
End If
End Function
Apr 23 2009 11:28PM GMT
Posted by: Jerry Lees
tips and tricks,
System Administration,
Systems Administration,
performance tips
I read an interesting article recently that gave some excellent tips at making your computer run faster– without an upgrade! I thought I’d pass some of these tips along and add a few of my own.
First, You can make your computer run faster (and free up space by uninstalling software that you no longer use. You can easily do this with an excellent piece of software called, PC Decrapifier.
The other thing you can do is ensure that you remove applications from your startup that you do not absolutely need. In Vista, you can manage startup applications through Windows Defender. Defender has an integrated tool called Software Explorer that lets you check programs that load at startup and disable anything unnecessary.
You can also access the list of startup applications in either Vista or XP through the Msconfig utility (type “msconfig” into the Run box in the Start menu). Select the Startup tab, then uncheck any applications you think might be slowing your startup.
Consult an online database of startup processes, such as Sysinfo, to find out what the process may be– keeping in mind that it may not be 100% accurate.
If you’re serious about shaving every last second of startup time, dig into the Boot tab in the Msconfig utility, which controls the settings for the boot.ini file. Generally, users should tread carefully when tinkering with boot.ini, because one slip up and you can have a non-bootable computer. But one easy edit is to check the “/noguiboot” option to time by skipping the Windows startup animation.
Another useful tip is to clean up the registry. There are various applications out there, Free programs such as CCleaner and Glary Utilities, as well as more fully featured software such as System Mechanic (System Mechanic just simply can’t be beat in my opinion, the others are free but sometimes don’t do as complete a job) are available for download online and will scrub the registry for “keys” left over from old applications no longer resident on your machine.
Doing some or all of these will no doubt result in some extra free space on your computer as well as some extra free time– who knows, you may not even have time to get that first cup of coffee in before your computer is totally logged in.
Enjoy!
Apr 20 2009 1:44PM GMT
Posted by: Jerry Lees
Eventlogs,
Win32_NTLogEvent,
System Administration,
systems management,
VBScript
If you’ve ever tried to find a specific event log entry in a system you know what a chore it can be to find them. Sure, you can filter on the event ID and get closer but, some applications (and system components) log every event that’s from the same source as the same event ID.
IIS is terribly bad about this! Additionally, Microsoft’s search filtering isn’t powerful enough to search in the even description or the event message. The script below solves that problem!
GetLogInfo “ServerName”,”EventID”, “application”, “20081218″
Function GetLogInfo( StrComputer1, EventID, EventLogType, YYYYMMDD)
Dim objWMIService, colItems, objItem
Dim TempStr
On Error Resume Next
‘ error control block
Set objWMIService = GetObject(”winmgmts:{impersonationLevel=impersonate}//” & strComputer1 & “\root\cimv2″)
Set colItems = objWMIService.ExecQuery (”Select * from Win32_NTLogEvent Where EventCode=” & EventID & ” and logfile=’” & EventlogType & “‘”)
For Each objItem in colItems
TempStr = “”
If mid(objItem.timegenerated,1,8) = YYYYMMDD Then
TempStr = objItem.message
If Replace(TempStr,”Exception message: Request timed out.”,””) <> TempStr Then
TempStr = Mid(TempStr,InStr(1,TempStr,”Request URL: “)+13, 100)
TempStr = Mid(TempStr,1,InStr(1,TempStr,”.aspx”)+4)
WScript.Echo StrComputer1 & “,” & TempStr
End if
End if
Next
On Error GoTo 0
End Function
Apr 13 2009 3:18PM GMT
Posted by: Jerry Lees
WMI,
Windows Management Interface,
win32_process,
System Administration,
Systems Administration,
Administration tools,
VBScript,
VBScript Functions,
Functions
Recently I had an issue where I needed to find the user running a series of processes on a large number of servers. Initially, it was a long process of logging onto each server then opening task manager and sorting by process name. After about 5 servers, I realized it was going to take hours to sort out the users running the processes… so I spent 30 minutes not preforming this process and wrote a script to do the rest of the work in less than a minute!
The function below uses the Win32_Process WMI class to enumerate processes running on a server that are named the same as the process name you give it. It then outputs the name of the user running the process.
Below is the function… Enjoy!
Function FindProcessOwner( StrComputer1, ProcessName)
Dim objWMIService, colItems, objItem, Username, Domain
On Error Resume Next
‘ error control block
Set objWMIService = GetObject(”winmgmts:{impersonationLevel=impersonate}//” & strComputer1 & “\root\cimv2″)
If Err.Number <> 0 Then
WScript.Echo “An Error Occured (” & StrComputer1 & “): ” & Err.Description
End If
Set colItems = objWMIService.ExecQuery (”Select * from Win32_Process Where Name = ‘” & ProcessName & “‘”)
WScript.Echo “Searching for processes on ” & StrComputer1 & “.”
WScript.Echo colItems.count & ” processes found.”
For Each objItem in colItems
objItem.getowner Username, Domain
FindProcessOwner = FindProcessOwner & VbCrLf & strComputer1 & “: ” & objItem.name &_
“(PID: ” & objItem.processid & “) the owner is: ” & Domain & “\” & Username
Next
On Error GoTo 0
End Function
Feb 26 2009 8:00AM GMT
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
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!
Jan 28 2009 11:40PM GMT
Posted by: Jerry Lees
System Administration,
systems management,
Microsoft CRM,
CRM,
Microsoft Dynamics CRM
I’ve been doing a good deal of work with Microsoft CRM lately. Heck, I’ll say it… I’ve been doing ALL my work with Microsoft CRM lately. It’s a beast that no one here at “the office” knows about and I’ve become “The Guy”. You know what that means, scramble to stay ahead of the game and get the environment under control before it blows up in your face!
Well, recently I learned a couple things about the CRM Email router service. This post is the first thing I learned, and I found an article that states exactly what is happening:
You use the Microsoft Dynamics CRM 4.0 E-Mail Router service to process e-mail messages. After a specific period of time, the service stops processing e-mail messages. Then, after the same period of time, the service starts to process e-mail messages again.
Essentially that’s what was happening to me, CRM would send e-mail messages for about an hour then the messages would queue up for a while before being sent again. Really great when those messages are time sensitive… talk about keeping a guy up all night!
You can read all about the solution here, but basically the Microsoft Dynamics CRM 4.0 Update Rollup 1 fixes the problem, though I imagine you could adjust the ConfigUpdatePeriod mentioned in the article and get a little bit of tweaking out of it in the short term while you test the update in a non-production environment like all good systems admins do.
Enjoy!
Jan 8 2009 2:18AM GMT
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!