search
top
Currently Browsing: Scripting

Using Powershell to Parse Event Logs

Powershell is a well needed addition to Windows. For a longtime there has been Windows admins wanting a powerful and flexible scripting language similar to what Linux / Unix users have had for years, or at least I have. One of the great command line tools for Linux has been the use of commands like cat, less, more and grep as a few to parse files. Enter in Powershell for Windows. A recent need for parsing... read more

Using Powershell to check service and send email

Ran into an issue with services stopping for no reason and causing IIS to stop. This was happening in the middle of the night and was sporadic in nature, making it hard to find a root cause. As a band-aid I created a Powershell 2 script to check for the service, restart if not in a running state and send and email. Here is the script. # Checks for a service to be running and starts if needed. # Author: Me... read more

Disable NetBIOS over TCPIP with vbscript

Part of building new servers I have been creating a script to configure add and remove features added to the Windows 2008 R2 servers. The process is being handled by powershell, command scripts and vbscripts. Ran into a step to disable the WINS setting for  Disable NetBIOS over TCP/IP.  As with any step in the build process automation is the key to consistent builds and reduce human error. For this part I... read more

Search and Delete Files less than 1 hour old with vbscript

Ran into a situation where temporary created files were filling the drives of a Windows 2003 server. So I turned to vbscript and creating a scheduled task to keep the space issue at bay. Here is the script. ‘ VBscript to delete files older than 1 hour ‘ directory to delete ‘ cleanoldfiles.vbs ‘ change dir variable to directory to target files sdir=”d:\my dir” dim dt,... read more

Next Entries »

top