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
$dnsServer = '10.10.10.10' # Replace with a DNS server accepting insecure updates. | |
$dnsDomain = 'home.mydomain.com' # Replace with your domain name. | |
$dhcpCmd = $args[0] | |
$dhcpMac = $args[1] | |
$dhcpIp = $args[2] | |
if ( $args.count -eq 4 ) { | |
$dhcpHostname = $args[3] -replace '[^a-zA-Z0-9-]', '-' | |
} else { |
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
Get-BitLockerVolume | ` | |
Where-Object { $_.VolumeStatus -like "FullyEncrypted" } | ` | |
ForEach-Object { | |
foreach( $Key in $_.KeyProtector ) { | |
if( $Key -like "RecoveryPassword" ) { | |
Backup-BitLockerKeyProtector -MountPoint $_.mountpoint -KeyProtectorId $key.KeyProtectorId | |
} | |
} | |
} |
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
Get-Counter -Counter "\LogicalDisk(_Total)\Disk Read Bytes/sec","\LogicalDisk(_Total)\Disk Write Bytes/sec" -Continuous -SampleInterval 1 | ForEach-Object { | |
[PSCustomObject]@{ | |
Time = (get-date $_.Timestamp -Format u).replace("Z", "") | |
Read = [math]::round($_.CounterSamples[0].CookedValue /1Mb, 0) | |
Write = [math]::round($_.CounterSamples[1].CookedValue /1Mb, 0) | |
} | |
} |
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
$basePath = 'HKCU:\Control Panel\NotifyIconSettings\' | |
Get-ChildItem -Path $basePath | ` | |
ForEach-Object { Get-ItemProperty "$basePath$($_.PSChildName)" } | ` | |
Set-ItemProperty -Name 'IsPromoted' -Value 1 |
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
# Simplified version runs defrag command against all drive letters with only the TRIM flag. Original version | |
# did not run against my Storage Spaces RAID volumes since it couldn't convert a member Physical Disk to a | |
# drive letter but this version does. Drive letters that Windows doesn't recognize as SSD will be skipped. | |
$( Get-Volume | Where-Object { [string] $_.DriveLetter -ne '' } | ForEach-Object { "$($_.DriveLetter):" } ) -join ' ' | ForEach-Object { | |
& defrag $($_ -split ' ') /Retrim /MultiThread | |
} |
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
#Start-Transcript -Append -Path .\plex-monitor-transcript.log -IncludeInvocationHeader:$false -Force | |
<# | |
This is my Plex monitoring script. There are many like it, but this one is mine. If | |
you're running Plex as a Windows Service this script is not for you as-written, but | |
you could possibly modify it to work for you by commenting out the Start-Process | |
line, configuring the service to automatically restart, and coming up with a | |
different way to keep the script running. | |
This updated version should automatically discover the Plex installation path and |
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
<# | |
Wrote this to scratch an itch for tracking where my disks are physically located within and across | |
storage enclosures. Before writing this I was using a spreadsheet, which was tedious to maintain. | |
For this script to be useful, you'll need a storage enclosure that Windows recognizes and exposes | |
through WMI, ie: one that provides SCSI Enclosure Services (SES). | |
Check the output of Get-StorageEnclosure. | |
On my systems with multiple Promise J610S/J630S enclosures, Get-PhysicalDisk provides "Slot #" in | |
the PhysicalLocation property but the EnclosureNumber isn't populated. This script adds two |
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
javascript:void(open('https://archive.is/newest/%27+encodeURIComponent( document.location.origin + document.location.pathname ),"_self")) |
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
root@ck-plus:~# memtester 2700M 10 | |
memtester version 4.3.0 (64-bit) | |
Copyright (C) 2001-2012 Charles Cazabon. | |
Licensed under the GNU General Public License version 2 (only). | |
pagesize is 4096 | |
pagesizemask is 0xfffffffffffff000 | |
want 2700MB (2831155200 bytes) | |
got 2700MB (2831155200 bytes), trying mlock ...locked. | |
Loop 1/10: |
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
@ECHO OFF | |
GOTO :TheLoop | |
:TheFile | |
FOR /F "tokens=1-7 delims=. " %%a in (%1) do ( | |
IF EXIST "\\server\tv\%%a %%b %%c %%d %%e %%f %%g" CALL :MoveFile %1 "\\server\tv\%%a %%b %%c %%d %%e %%f %%g\" & GOTO :EOF | |
IF EXIST "\\server\tv\%%a %%b %%c %%d %%e %%f" CALL :MoveFile %1 "\\server\tv\%%a %%b %%c %%d %%e %%f\" & GOTO :EOF | |
IF EXIST "\\server\tv\%%a %%b %%c %%d %%e" CALL :MoveFile %1 "\\server\tv\%%a %%b %%c %%d %%e\" & GOTO :EOF | |
IF EXIST "\\server\tv\%%a %%b %%c %%d" CALL :MoveFile %1 "\\server\tv\%%a %%b %%c %%d\" & GOTO :EOF | |
IF EXIST "\\server\tv\%%a %%b %%c" CALL :MoveFile %1 "\\server\tv\%%a %%b %%c\" & GOTO :EOF |