This file contains hidden or 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
#!/usr/bin/env python3 | |
""" | |
Retry decorator | |
Example: | |
import requests | |
logging.basicConfig( | |
format="%(asctime)s | %(name)s | %(message)s", |
This file contains hidden or 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
function repall { | |
$cred = $(Get-Credential "domain\username") | |
(Get-ADDomainController -Filter *).Name | % { | |
$dc = $_ | |
Start-Job {param($dc);Write-Host "== REP-$dc";repadmin /syncall $dc (Get-ADDomain).DistinguishedName /e /A; Start-Sleep 5} -ArgumentList $dc -Name "rep-$dc" -Credential $cred | |
} | |
While (Get-Job -State "Running" | ? {$_.Name -like "rep*"}) { | |
Start-Sleep 20 | |
cls |