Month: July 2005

WMI Date Conversion

Sal Young | July 6th, 2005


USE: To convert the GMT data returned from error logs to a readable date time value. CLEAR $sHostName = “TUIRA” $aLogName = “Application” $FromDate = [datetime]::today $WMIQuery = “LogFile=’$aLogName’ and Type=’Error’ and TimeGenerated>=’$FromDate'” Get-WmiObject Win32_NTLogEvent -ComputerName $sHostName ` -Filter “$WMIQuery” ` -ErrorAction SilentlyContinue | ` SELECT SourceName, ` @{Name = “TimeGenerated”; EXPRESSION = {$_.ConvertToDateTime($_.TimeGenerated)}}, ` […]

Read More

Top 25 Most Expensive Stored Procedures

Sal Young | July 1st, 2005


USE: These queries will display the top 25 most expensive stored procedures that are still in the cache.  

Read More