This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# comma-delimited server name array, | |
# foreach into logparser command | |
# Note: edit/update the logname string, to specify variant dates | |
# one-line follows (manually wrapped for clarity) | |
$CASs="US-HUBCAS1","US-HUBCAS2","US-HUBCAS3" ; | |
foreach ($CAS in $CASs){ | |
write-host ("`n" + $CAS) ; | |
.\logparser.exe "SELECT cs(User-Agent) as Client, count(*) as Hits INTO $CAS-EWS-ALLClients.csv FROM '\\$CAS\e$\Weblogs\W3SVC1\ex130919*.log' WHERE cs-uri-stem LIKE '%/EWS/%' GROUP BY Client ORDER BY Hits DESC" -o:csv ; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1-line, wrapped at pipes and semi-colons for readability | |
$drvs="e","f","c" ; get-exchangeserver | | |
where{$_.isHubTransportServer -eq $true} | | |
foreach{ | |
write-host $_ ; | |
foreach ($drv in $drvs) { if (test-path \\$_\$drv`$\scripts\) { break } } ; | |
copy \\SourceServer\e$\scripts\get-HT-MsgTrk-TopTraffic-LastXMin.ps1 \\$_\$drv`$\scripts\ -whatif ; | |
} ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# TRIMMED GIST #> | |
#*----------------v Function ProcessLogs() v---------------- | |
Function ProcessLogs { | |
<# TRIMMED GIST #> | |
write-host -ForegroundColor White ((get-date).ToString("HH:mm:ss") + ": Site: " + $SiteName) | |
foreach ($Hub in $Hubs) { | |
write-host -foregroundcolor White ("-" * 10) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# append-x500LEDN-ToMbxEmailAddressess.ps1 | |
<# key snippet from larger script...#> | |
if(test-path $InputCSV) { | |
write-verbose -verbose:$true "$((get-date).ToString('HH:mm:ss')):Loading Input file: $($InputCSV)" ; | |
$procMbxs=import-csv $InputCSV ; | |
foreach($pMbx in $procMbxs) { | |
if($tmbx = get-mailbox -identity "$($pMbx.WindowsEmailAddress)" -ea 0 ){ | |
write-host -foregroundcolor green "$((get-date).ToString('HH:mm:ss')):MATCHED:$($pMbx.WindowsEmailAddress)($($pMbx.displayname))=>TO:$($tmbx.WindowsEmailAddress)($($tmbx.displayname))" ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#check-ExchSvcStatusRpt.ps1 | |
<# This gist is trimmed to just the core data gathering bits... | |
#> | |
#------------------------------------------------- | |
# do data collection here | |
<# trimmed #> | |
# Ex svcs | |
$svcs = (get-service -include *exchange* -computername $env:COMPUTERNAME | ?{$_.name -notmatch '^(Mimosa.*|wsbexchange)$'} | select name,DisplayName,status ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# This gist is TRIMMED to just the core pieces #> | |
#*------v Function Test-Port() v------ | |
function Test-Port { | |
# attempt to open a port (telnet xxx.yyy.zzz nnn) | |
# call: Test-Port $server $port | |
PARAM([parameter(Mandatory=$true)] [alias("s")] [string]$Server, [parameter(Mandatory=$true)][alias("p")] | |
[int]$port | |
) ; | |
$ErrorActionPreference = “SilentlyContinue” ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# Exchange HubTransport queue snippet for dumping queued external delivery domain details, | |
for all hub servers in the local AD Site. (Exchange 2010 version) | |
Update the $probdom to a target fqdn, and run it. | |
#> | |
$probdom='badmaildelivery.com' ; | |
$Site=[System.DirectoryServices.ActiveDirectory.ActiveDirectorySite]::GetComputerSite().Name ; | |
$Banner="== v Site:$($Site.toupper()) - MSGS QUEUED TO $($probdom) PER HUB: v ==" ; | |
write-host -foregroundcolor green "`n$((get-date).ToString('HH:mm:ss')):$($Banner)" ; | |
$hubsl=Get-ExchangeServer | where { $_.isHubTransportServer -eq $true -and $_.Site -match ".*\/$($Site)$"} | select -expand name ; | |
foreach($hub in $hubsl){ write-host -foregroundcolor green "$((get-date).ToString('HH:mm:ss')):----$($hub):" ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# Powershell snippet to retrieve details on top 3 queued domains on Exchange hubs in local AD site | |
I generally just paste the 1-liner version straight into a remote EMS console, for execution | |
#> | |
$TopDoms=3 ; | |
$Site=[System.DirectoryServices.ActiveDirectory.ActiveDirectorySite]::GetComputerSite().Name ; | |
$Banner="== v Site:$($Site.toupper()) - TOP $($TopDoms) QUEUED DOMAINS PER HUB: v ==" ; | |
write-host -foregroundcolor green "`n$((get-date).ToString('HH:mm:ss')):$($Banner)" ; | |
$hubsl=Get-ExchangeServer | where { $_.isHubTransportServer -eq $true -and $_.Site -match ".*\/$($Site)$"} | select -expand Name ; | |
foreach($hub in $hubsl){ write-host -foregroundcolor green "$((get-date).ToString('HH:mm:ss')):----$($hub):" ; | |
[console]::ForegroundColor = "yellow" ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# convert-ToMp3.ps1 | |
<# This gist is TRIMMED to ust the core pieces #> | |
#*================v FUNCTIONS v================ | |
#*----------------v Function convert-ToMp3 v------ | |
function convert-ToMp3 { | |
<# TRIMMED #> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# TRIMMED GIST, SEE FULL Get-IMDBSearch.ps1 SCRIPT FOR DETAILS#> | |
#*------v Function Get-IMDBSearch v------ | |
Function Get-IMDBSearch { | |
<# TRIMMED #> | |
$qryUrlRoot = "http://google.com/search?q=site:imdb.com/title" ; | |
$url = "$($qryUrlRoot) $($Title.trim())" ; | |