all
(or*
)- hostname:
foo.example.com
- groupname:
webservers
- or:
webservers:dbserver
- exclude:
webserver:!phoenix
- intersection:
webservers:&staging
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
@echo off | |
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe | |
rem add it for all file types | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f | |
rem add it for folders | |
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f |
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
# source: https://trac.ffmpeg.org/wiki/CentosCompilationGuide | |
yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel | |
mkdir ~/ffmpeg_sources | |
cd ~/ffmpeg_sources | |
curl -O http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz | |
tar xzvf yasm-1.2.0.tar.gz | |
cd yasm-1.2.0 |
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
$guid = "bc87047d-25e8-11d3-9079-00805f31f826" | |
$gcs = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest().GlobalCatalogs | |
$gcs | % { | |
$entry = [ADSI]("GC://" + $_.Name + "/<GUID=" + $guid + ">") | |
if ($entry.Guid -ne $null) | |
{ | |
$entry | |
} | |
else |
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
# Save-AllExchangeLogs.ps1 | |
$timeString = (Get-Date).ToString("yyyyMMddHHmm") | |
$machineName = [Environment]::MachineName | |
$targetFolder = "$home\desktop\ExchangeLogs-$machineName-$timeString" | |
md $targetFolder | Out-Null | |
"Saving $targetFolder\Application.evtx..." | |
wevtutil epl Application "$targetFolder\Application.evtx" | |
"Saving $targetFolder\System.evtx..." |
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
param($alias) | |
$searcher = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest().FindGlobalCatalog().GetDirectorySearcher() | |
$searcher.Filter = "(mailnickname=$alias)" | |
$user = $searcher.FindOne() | |
$mbxSd = $user.Properties["msExchMailboxSecurityDescriptor"][0] | |
$sd = New-Object System.Security.AccessControl.RawSecurityDescriptor([byte[]]$mbxSd, 0) | |
$sd.GetSddlForm("All") |
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
$path = '\\server\path\' | |
$mailboxes = get-mailbox somemailboxfilter | |
$mailboxes | % { | |
$folders = Get-MailboxFolderStatistics $_.Alias -archive | |
$folders = $folders | ? {$_.Name -ne "Top of Information Store"} | |
$excludeFolders = $folders | % { $_.FolderPath.Substring(1) } | |
New-MailboxExportRequest -Mailbox $_.Alias -ExcludeFolders $excludeFolders -ExcludeDumpster -IsArchive -FilePath ($path + $_.Alias + '.pst') | |
} |
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
$searcher = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest().FindGlobalCatalog() | |
$searcher.Filter = "(&(objectClass=user)(msExchMailboxMoveFlags=10))" | |
$results = $searcher.FindAll() | |
"Found " + $results.Count.ToString() + " results:" | |
foreach ($result in $results) | |
{ | |
$dn = $result.Properties["distinguishedName"][0].ToString() | |
$dn | |
$entry = [ADSI]("LDAP://" + $dn) | |
$entry.Properties["msExchMailboxMoveFlags"].Clear() |
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
$filter = "(proxyAddresses=SMTP:[email protected])" | |
$gcs = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest().GlobalCatalogs | |
$gcs | % { | |
$searcher = $_.GetDirectorySearcher() | |
$searcher.Filter = $filter | |
$results = $searcher.FindAll() | |
if ($results.Count -gt 0) | |
{ | |
$results |