Skip to content

Instantly share code, notes, and snippets.

choco install googlechrome notepadplusplus firefox paint.net slack vscode git wget greenshot -Y
@atrommer
atrommer / uniques.sql
Created March 28, 2016 18:58
unique users over 30 minutes IIS access logs
select count(distinct(wl.Username)) as "usercount", DATEADD(MINUTE, (DATEDIFF(MINUTE, 0, wl.EntryTime)/30)*30,0) as "roundtime" from WebsiteLog2 wl
group by DATEADD(MINUTE, (DATEDIFF(MINUTE, 0, wl.EntryTime)/30)*30,0)
order by count(distinct(wl.Username)) desc
@atrommer
atrommer / ResetVersioning.ps1
Created April 10, 2014 14:32
Finds lists with unlimited versions, logs, and optionally updates to a new version limit
# finds lists with unlimited versions, logs, and resets to new value
param(
[Parameter(Mandatory=$true)] [string]$WebAppUrl = "$(Read-Host 'Enter the WebApp Url')",
[switch]$PerformUpdate,
[int]$VersionLimit = 10
)
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$updates = @{}
$WebApp = Get-SPWebApplication($WebAppUrl)
@atrommer
atrommer / getPageCountBySC.ps1
Created February 20, 2014 23:44
Get Count of all pages in all site collections in all webapps
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$report = "$PWD\pagesBySC.txt"
$webapps = Get-SPWebApplication
$pgTotal = 0
foreach ($wa in $webapps)
{
$pgWA = 0
$sites = $wa | select -Expand Sites
foreach ($site in $sites)