I hereby claim:
- I am joegasper on github.
- I am joegasper (https://keybase.io/joegasper) on keybase.
- I have a public key ASDCmG_QehgIwQJf6B46RTYvKYONihcYoWYJFBjgf5AZdwo
To claim this, I am signing this object:
[ScriptBlock]$cmd = { | |
$SizeGb = 0; Get-ChildItem -Path 'C:\Program Files\Microsoft\Exchange Server\V15\Logging' -Recurse -Filter '*.log' | ? {$_.LastWriteTime -lt (Get-Date).AddDays(-30)} | % {$SizeGb += $_.Length/1024/1024/1024}; Write-Output $SizeGb | |
} | |
#assumes your systems are named 'myexchbox01', 'myexchbox02', etc. | |
1..20 | % { $exmbx = 'myexchbox' + '{0:D2}' -f $_; $ServerGB = Invoke-Command -ComputerName $exmbx -ScriptBlock $cmd; Write-Output "$exmbx = $ServerGB" } |
#Requires -Version 4.0 | |
#Create your record and then immediately run this script | |
$domainSuffix = '.my.domain.edu' #domain suffix for less typing | |
$client = 'dept-joe04' #client to query for on the DCs | |
$DNStype = 'CNAME' #type of DNS record to query | |
$DCs = @('dc-01','dc-02','dc-03','dc-04') #DCs to query against | |
$DClength = (-join $DCs).Length #for determining when all DCs have answered | |
$DCdone = '' #string that collects DC names as they answer | |
Write-Output "Checking $client at $(Get-Date)" |
$counters = @('\Paging File(_total)\% Usage','\Paging File(_total)\% Usage Peak','\Memory\Available MBytes','\Memory\% Committed Bytes In Use','\System\System Up Time') | |
$servers = @() | |
#assumes your systems are named 'myexchbox01', 'myexchbox02', etc. and you have 20 of them | |
1..20 | % { $servers += 'myexchbox' + '{0:D2}' -f $_ } | |
$Path = 'C:\Work\Perf\' | |
$filename = 'Exchange' | |
$delay = 1 | |
$count = 1 | |
$sequence = 1 | |
$testrun = Get-Date -Format yyyy-MM-dd |
Import-Module AzureRM.Websites | |
Login-AzureRmAccount | |
$MyResourceGroup = 'myresourcegroupname' | |
$MyResourceName = 'myresourcename' | |
Invoke-AzureRmResourceAction -ResourceGroupName $MyResourceGroup -ResourceType Microsoft.Web/sites -ResourceName $MyResourceName -Action sync -ApiVersion 2015-08-01 -Force -Verbose |
#Wi-Fi Connection Information | |
$data = (netsh wlan show networks mode=Bssid | | |
where {$_ -like "SSID*" -or $_ -like "*Authentication*" -or $_ -like "*Encryption*" -or $_ -like "*Signal*"}).trim() | |
$result = for ( $i = 0; $i -lt $data.count; ) { | |
'' | Select @{n='Connection';e={($data[$i].split(':')[1]).trim()}}, | |
@{n='Authentication';e={($data[$i+1].split(':')[1]).trim()}}, | |
@{n='Encryption';e={($data[$i+2].split(':')[1]).trim()}}, | |
@{n='Signal';e={($data[$i+3].split(':')[1]).trim()}} | |
$i = $i + 4 | |
} |
I hereby claim:
To claim this, I am signing this object:
#Show all values in sequence up to number $seqnum | |
[int]$seqnum = 10 | |
$fibseq = @() | |
for($i = 0; $i -lt $seqnum; $i++) { | |
if ($i -eq 0 ) { | |
$fibseq = $fibseq + 0 | |
} | |
if ($i -eq 1 ) { | |
$fibseq = $fibseq + $i | |
} |
#Simple check on a generic WordPress site | |
$page = Invoke-WebRequest -Uri http://mywordpress03.site | |
$WPver = ($page.Scripts.src).where({$_ -match 'wp-embed.min'}).Split('=')[1] |
$site = 'mysite01' | |
$source = "\\my-web1\e$\websites\$site\" | |
$destination = "E:\websites\$site\" | |
#List only first | |
$logfile = "E:\$site-robo-test.txt" | |
$switches = "/E /L /R:2 /W:3 /NP /FFT /DST /LOG:$logfile /XF "".DS_Store"" ""thumbs.db""" | |
& robocopy.exe $source $destination $switches.Split(' ') | |
#Check Log File | |
Get-Content -Path $logfile -First 17 |
#Inspired by http://woshub.com/rdp-session-shadow-to-windows-10-user/ | |
#You could feed ConvertFrom-String a template to have a perfect object from the qwinsta.exe command, but I didn't want to | |
#have to keep the template file around. | |
#This is quicker than walking someone through Quick Assist, but QA will work over the internet. | |
#This command will shadow a user's Windows 10 system and you will have control (after remote user's consent if you are proper - see GPO in the link). | |
$PC=(Read-Host -Prompt "PC Name");$ID = (qwinsta.exe /server:$PC | ConvertFrom-String | Where-Object P2 -eq console | select P4).P4;mstsc.exe /shadow:$ID /v:$PC /control |