Skip to content

Instantly share code, notes, and snippets.

@jkullick
jkullick / exchange-restart-services.md
Last active December 29, 2016 13:34
Restart all Exchange Services
$services = Get-Service | ? { $_.name -like "MSExchange*" -and $_.Status -eq "Running"}
foreach ($service in $services) {Restart-Service $service.name -Force}

Source

@jkullick
jkullick / exchange-set-max-message-size.md
Last active July 29, 2016 12:01
Set Max Message Size in Exchange
Set-TransportConfig -MaxReceiveSize 50MB -MaxSendSize 50MB
@jkullick
jkullick / exchange-export-pst.md
Last active July 29, 2016 12:01
Export .pst in Exchange
  1. Create request:
New-MailboxExportRequest -Mailbox $ALIAS -FilePath \\$PATH_TO_PST`
  1. Check request status:
Get-MailboxExportRequest
@jkullick
jkullick / exchange-force-database-switch.md
Last active July 29, 2016 11:52
Force Exchange to switch over to other Database
Move-ActiveMailboxDatabase $DATABASE -ActivateOnServer $SERVER -SkipLagCheck -SkipClientExperience -SkipHealthChecks -MountDialOverride:None
@jkullick
jkullick / exchange-move-mailbox-database.md
Last active July 29, 2016 11:59
Move Mailbox to other Exchange Database
New-MoveRequest -Identity '$USER' -TargetDatabase '$DATABASE'
@jkullick
jkullick / exchange-reset-owa-virtual-directory.md
Last active July 29, 2016 11:58
Reset Exchange OWA Virtual Directory
Remove-OwaVirtualDirectory -Identity '$SERVER\owa (Default Web Site)'
New-OwaVirtualDirectory -InternalUrl 'https://$FQDN/owa' -WebSiteName 'Default Web Site'
@jkullick
jkullick / windows-server-clear-dns-cache.md
Last active July 29, 2016 11:58
Clear Windows Server DNS Cache
Clear-DnsServerCache –ComputerName $SERVER -Force
@jkullick
jkullick / linux-tcp-connection-count.md
Last active July 29, 2016 11:58
Show active TCP Connection Count in Linux
wc -l /proc/net/tcp
@jkullick
jkullick / debian-ubuntu-oracle-jdk.md
Last active July 29, 2016 11:58
Install Oracle JDK (Java) on Debian/Ubuntu
mkdir -p /opt/java
curl -b 'oraclelicense=accept-securebackup-cookie' -L 'http://download.oracle.com/otn-pub/java/jdk/8u92-b14/jdk-8u92-linux-x64.tar.gz' | tar xz -C /opt/java
update-alternatives --remove-all java
update-alternatives --remove-all javac
update-alternatives --install /usr/bin/java java /opt/java/jdk1.8.0_92/bin/java 1
update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.8.0_92/bin/javac 1
@jkullick
jkullick / find-replace-multiple-files.md
Last active December 29, 2016 13:34
Find & Replace in multiple Files
grep -rli "$OLD_STRING" . | \
  xargs -i@ sed -i 's/$OLD_STRING/$NEW_STRING/g' @

Source