Category Archives: Windows OS

Powershell file mover

Pretty simple script I wrote a while back. Moves files between two paths. For example, to sweep files from a DMZ server. Optionally renames files on the target system by appending a date code. This is to avoid name collisions. … Continue reading

Posted in Powershell, Windows OS | 1 Comment

Deduplicating files with LogParser and SQL Server

Perhaps this should be categorized as a stupid people trick. On the other hand, it’s a good, cheap way to deduplicate files assuming you’re running SQL Server and LogParser. This post assumes at least a basic knowledge of T-SQL and … Continue reading

Posted in T-SQL, Utilities, Windows OS | Comments Off on Deduplicating files with LogParser and SQL Server

PowerShell Script to Clean Up Old Files Based on Age

Here’s an extremely simple PowerShell script to remove old files based on age. You could use it to enforce a policy that keeps 90 days of ETL input files on a server. Files older than that would purged with this … Continue reading

Posted in Utilities, Windows OS | 3 Comments

Quick and Dirty CSV import to SQL Server

You can use LogParser (a free, unsupported utility from Microsoft) to quickly import a CSV file into a SQL Server table using syntax like this: logparser “SELECT * INTO MyTable FROM d:\MyFile.csv” -i:csv -o:SQL -server:MyServer -database:MyDatabase -createTable:ON There are many … Continue reading

Posted in SQL Server, Windows OS | Comments Off on Quick and Dirty CSV import to SQL Server

Converting an existing Perfmon .BLG file to CSV

You may run across the situation where you need to import an existing Perfmon (or System Monitor) binary log file into and Excel spreadsheet or SQL database.  The obvious first step is to convert it to CSV format.  It took … Continue reading

Posted in Uncategorized, Utilities, Windows OS | Comments Off on Converting an existing Perfmon .BLG file to CSV

How to determine if TCP Chimmney Offloading is working

The TCP Chimmney Offload feature was introduced in Windows Server 2003 SP2.  It can offload certain functions from the OS to the network adapter card.  A lot of our newer HP Servers have a Broadcomm Ethernet chipset that supports this … Continue reading

Posted in Windows OS | Comments Off on How to determine if TCP Chimmney Offloading is working

Remote Reboot

Today while applying patches to a couple of mission-critical servers, I was reminded of something:  reboots issued through the terminal services client are not always successful.  The server can get stuck in an odd state where it is running but … Continue reading

Posted in Windows OS | Comments Off on Remote Reboot

Ongoing Lessons from the Cluster Lab

It’s been a while since I worked on my cluster lab. The first thing that I did was to tear down the old cluster and start over from scratch. The first lesson from this round of testing came when the … Continue reading

Posted in Windows OS | Comments Off on Ongoing Lessons from the Cluster Lab

Using Diskpart to Align a Windows Disk Partition

There is an EMC whitepaper titled Using diskpar and diskpart to align partitions on Windows Basic and Dynamic Disks. This paper describes how legacy Windows issues cause a single disk I/O to span multiple tracks. This puts an unnecessary load … Continue reading

Posted in Performance, Windows OS | 6 Comments

Starting Windows Performance Logging at boot time

Performance logging will not start on its own at boot time. Here’s how to get around that problem.   Applies to: W2k3, XP Using the Performance MMC, create a set of counter logs. Use a specific name to save the … Continue reading

Posted in Performance, Windows OS | Comments Off on Starting Windows Performance Logging at boot time

SQL Server Best Practices Analyzer (BPA)

A new version of the SQL Server 2005 Best Practices Analyzer (BPA) is here. On a related note, the BPA reported several operating system issues that I was unaware of, including an issue where SQL Server’s working set gets paged … Continue reading

Posted in SQL Server, Windows OS | Comments Off on SQL Server Best Practices Analyzer (BPA)

Windows shell script: putting date & time into a file

SET mydate=%DATE:~4,2%_%DATE:~7,2%_%DATE:~10,4% echo mydate >> somefile.txt

Posted in Windows OS | Comments Off on Windows shell script: putting date & time into a file

Clustering Lab

I recently built an Windows Server 2003 cluster lab using a couple of PCs, two Adaptec AHA2940UW controllers and an old SCSI drive. When configuring the SCSI HBAs, it is important to remember to disable SCSI resets. Note that when … Continue reading

Posted in Windows OS | Comments Off on Clustering Lab

Tarpits

While working on a client’s Exchange server, I stumbled across an interesting knowledgebase article: SMTP tar pit feature for Microsoft Windows Server 2003. Tarpits insert a delay into certain SMTP communications that are associated with spam or with other unwanted … Continue reading

Posted in Windows OS | Comments Off on Tarpits

Automated, Scheduled Domain Controller Diagnostics

Wouldn’t it be nice to have the time once a week to run the dcdiag against all of your domain controllers and review the results? (yeah, right) Well, I wrote a script to automate that process. It works like this: … Continue reading

Posted in Windows OS | Comments Off on Automated, Scheduled Domain Controller Diagnostics