close

DevOps

DevOpsIIS

Script IIS Virtual Directory Setup

IIS-PS

Script IIS Virtual DirectoryIn some environments adding new virtual directories is a daily, if not hourly task. Automating this type of work is what we all prefer. Here’s some Powershell I’ve used recently to script IIS Virtual Directory setup. One thing about this script I like is it takes very little input, just the website name. The script pulls from existing settings to create the new virtual directory. If you had a single website, you wouldn’t even need this input.

read more
DevOps

Cleanup WinSxS

no thumb

WinSxs
Anyone with a Windows 2008 Server over a year old has likely run into this problem. Your C:\ drive slowly runs out of space, when you check where all the space is going you find C:\Windows\WinSxS is using 10 – 20GB. I’m not going to go into what the folder is used for or why Microsoft originally made it not possible to clean this up, you can read the Microsoft Support KB for more info.

read more
DevOpsSQL

Query SQL Server CPU Usage

no thumb

Here’s an easy way to grap minute by minute CPU Use in a query. This only goes back 4 hours, but can be useful for looking at load on your server.

SELECT 
 CONVERT(VARCHAR(20), dateadd (ms, [timestamp] - sys.ms_ticks, getdate()), 100) as Time_Stamp,
 SQLProcessUtilization,
 100 - SystemIdle - SQLProcessUtilization AS OtherProcessUtilization,
 SystemIdle
FROM (
SELECT 
 record.value('(./Record/@id)[1]', 'int') AS record_id,
 record.value('(./Record/SchedulerMonitorEvent/SystemHealth/SystemIdle)[1]', 'int') AS SystemIdle,
 record.value('(./Record/SchedulerMonitorEvent/SystemHealth/ProcessUtilization)[1]', 'int') AS SQLProcessUtilization,
 TIMESTAMP
FROM (
 SELECT TIMESTAMP, CONVERT(XML, record) AS record 
 FROM sys.dm_os_ring_buffers 
 WHERE ring_buffer_type = N'RING_BUFFER_SCHEDULER_MONITOR'
 AND record LIKE '% %') AS x
) AS y 
cross join sys.dm_os_sys_info sys
ORDER BY record_id DESC
Query CPU Usage
read more
1 3 4 5 6 7 8
Page 5 of 8