I hereby claim:
- I am jcefoli on github.
- I am jcefoli (https://keybase.io/jcefoli) on keybase.
- I have a public key whose fingerprint is 1EEF B0D8 3F20 F83B 086B 888C CE34 4425 E18C 50B4
To claim this, I am signing this object:
[bool]$isLocked = (Get-ADUser 'username' -Properties LockedOut).LockedOut | |
if ($isLocked -eq $True) { | |
Write-Host "Account is locked" | |
} else { | |
Write-Host "Account is not locked" | |
} |
$headers = @{'Accept' = 'application/json'} | |
$tokenString = "REPLACE-GITHUB-TOKEN-HERE" + ":x-oauth-basic" | |
$base64Auth = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(($tokenString))) | |
$headers.Add('Authorization',"Basic $base64Auth") | |
$content = Invoke-RestMethod -Uri "https://raw.githubusercontent.com/ORG/Repo/master/something.ps1" -Headers $headers |
#Add to end of script | |
if ($PSSenderInfo) { | |
#Script was launched remotely. Do Not Pause | |
} | |
else { | |
#Script is running locally, pause | |
[void](Read-Host 'Press Enter to continue') | |
} |
for ($x = 1; $x -le 100; $x++) { | |
$Output = "" | |
if ($x % 3 -eq 0) { $Output += "Fizz" } | |
if ($x % 5 -eq 0) { $Output += "Buzz" } | |
if ($Output -eq "") { $Output = $x } | |
Write-Output $Output | |
} |
[bool]$isLocked = (Get-ADUser 'username' -Properties LockedOut).LockedOut | |
if ($isLocked -eq $True) { | |
Write-Host "Account is locked" | |
} else { | |
Write-Host "Account is not locked" | |
} |
$message = new-object Net.Mail.MailMessage; | |
$message.From = "[email protected]"; | |
$message.To.Add('[email protected]'); | |
$message.Subject = "Test by Joe"; | |
$message.Body = "Message body here"; | |
$smtp = new-object Net.Mail.SmtpClient("smtp.server.local", "25"); | |
$smtp.send($message); |
# Force TLS 1.2 | |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
# Basic Auth Credentials | |
$user = 'changeme' | |
$pass = 'insecure-password' | |
# Handle Basic Auth (Hacky in Powershell) | |
$pair = "$($user):$($pass)" | |
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair)) |
I hereby claim:
To claim this, I am signing this object:
#Run as Admin | |
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "DisallowShaking" -Value "0" -PropertyType "DWord" |
for i in {1..100}; do dig mydomain.com @my.nameserver.com +short; done | sort | uniq -c | |
# replace mydomain.com with your domain name | |
# replace my.nameserver.com with the hostname of your domain's nameserver |