Skip to content

Instantly share code, notes, and snippets.

from dns import query, update, tsigkeyring
from dns.tsig import HMAC_SHA256
key='EQSVvuA/KMAa/0ugdBBLqjxgP+o5rI7y8JoJbOICpJM='
bindhost='192.168.56.10'
ip='192.168.56.10'
keyring = tsigkeyring.from_text({
'test.local' : key
})
$PathToHomeFolder = \\domain.com\home$
$FoldersToFix = Get-Childitem $PathToHomeFolder
$GroupOrUserToRemove = 'Domain Users'
foreach($folder in $FoldersToFix)
{
$acl = get-acl $folder
$aclObjectsToRemove = $acl.access.where({$_.IdentityReference -like "*$GroupOrUserToRemove*"})
## Event IDs: 1 - Source $EventLogSource created.
## Event IDs: 2 - Drive Config Written To Disk: $driveConfig
## Event IDs: 3 - Pre-Existing Drive Exists: $Drive
## Event IDs: 4 - Pre-Existing Drive does not Exist: $Drive
## Define variables
$EventLogSource = 'Drive Checker'
$DriveConfig = 'C:\Drive.Config'
$CurrentDrives = Get-WmiObject -Class Win32_LogicalDisk | Where-Object {$_.VolumeSerialNumber -ne $null} | Select-Object Name,Description,ProviderName,VolumeSerialNumber
$DayDate=(get-date (get-date).AddDays(-1) -Format dddd)
$FileDate=(get-date (get-date).AddDays(-1) -format "MM-dd-yyyy")
$SubjectDate=(get-date (Get-Date).AddDays(-1) -format 'dddd MMMM dd, yyyy')
$DHCPLogLocation='C:\windows\system32\dhcp'
$Day=$DayDate[0..2] -join ''
$LogName="DhcpSrvLog-$Day"
$LogFile="$LogName.log"
$LogFullPath="$DHCPLogLocation\$LogFile"
$UsersToReset=Import-Csv "C:\pwreset.csv"
foreach($User in $UsersToReset)
{
$Password=($User.Password | ConvertTo-SecureString -AsPlainText -Force)
Set-ADAccountPassword -Identity $user.User -NewPassword $Password -Reset
Enable-ADAccount -Identity $User.User
}
function ExcludeBasedOnMultipleIPs($ExcludedAddresses)
{
if($ExcludedAddresses == '')
return false;
$ipaddress = '';
if (isset($_SERVER['HTTP_CLIENT_IP']))
$ipaddress = $_SERVER['HTTP_CLIENT_IP'];
else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))
$ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
error_page 400 /error/400.html;
error_page 401 /error/401.html;
error_page 402 /error/402.html;
error_page 403 /error/403.html;
error_page 404 /error/404.html;
error_page 405 /error/405.html;
error_page 406 /error/406.html;
error_page 407 /error/407.html;
error_page 408 /error/408.html;
error_page 409 /error/409.html;
[Reflection.Assembly]::LoadWithPartialName("System.Web")
$Credentials=$(get-credentials)
$RandomPassword=[System.Web.Security.Membership]::GeneratePassword(10,0)
$domainLocal='ad.fattswindstormelec.com'
$domainPublic='fattswindstormelec.com'
$UserFirst='Poopy'
$UserLast='McButthole'
$Name="$UserFirst $UserLast"
$SamAccountName="$($UserFirst.substring(0,1))$($UserLast.substring(0,7))"
################################################################
# #
# This script works in conjunction with a XBOXAPI.COM account. #
# You must create a XBOXAPI.COM account in order to use it. #
# #
# You do not need the paid subscription unless you intend #
# to perform more than 120 API Requests an hour #
# #
# The information you need from the account is: #
# -XboxAPI API Key #
employee manager
1101 jdirte
1102 jdirte