My Windows Datacenter license will be delivered today so I get to upgrade my home lab servers from 2012 r2 to 2022. Yay!
Posts made by Grey
-
RE: What Are You Doing Right Now
-
PWSH: Reboot servers from a file
A little script I wrote to reboot a bunch of servers at a specific, calculated time. You can adjust the filename or time in the header. Default time is 730 pm. You need winrm enabled on all the target systems, and I don't know what the limit would be on server count. If you run a NOC, warn them before all the servers reboot at exactly the same time. lol!
###########
#Boot systems in a file at 730 pm$file = "$($ENV:USERPROFILE)\desktop\systems.txt"
$target = Get-Date -Hour 19 -Minute 30 -Second 0#don't change anything below here
$systems = get-content $file
$utz = Get-Date -Hour 19 -Minute 30 -Second 0 -UFormat "%Z"
$now = $(Get-Date)
$serverTZ = (get-timezone).id
$seconds = ($target - $now).TotalSeconds
$final = [math]::Round($seconds)
$final = $final - 15
Write-Host -ForegroundColor cyan -NoNewline "nSeconds until $target $serverTZ ($utz UTC)
:"
write-host -ForegroundColor Yellow " $final"
$final |clip
Write-Host -ForegroundColor Cyan "15 second delay to cancel a scheduled reboot for $($($systems).count) systems:`n$systems"
#Write-Progress -SecondsRemaining 15 -Activity "Reboot schedule countdown."
Start-Sleep -Seconds 15
Invoke-Command -ComputerName $Systems -ScriptBlock {shutdown -r -t $using:final}
Write-Host -ForegroundColor Cyan "End of Line" -
RE: Windows/vmware server licensing
@travisdh1 Does that imply that each guest needs a minimum number of cores assigned?
-
Windows/vmware server licensing
I'm looking to upgrade a pair of end-of-life home lab Windows servers and wanted to double check on the current licensing since I haven't relicensed since Technet closed up. From what I can tell, it looks like data center covers up to five windows servers? There also appear to be maybe a minimum number of cores per server? Is that accurate?
Also, on VMWare ESXi, since they're broadcom now, do they still offer a free ESXi? Maybe I should migrate to a new baremetal hypervisor?
-
RE: Need a tool to share tasks with client staff
Trello. You can see how the Subnautica team used it to show their development. https://trello.com/b/yxoJrFgP/subnautica-development
-
RE: IPv6 New Deadline for Adoption
@scottalanmiller said in IPv6 New Deadline for Adoption:
At this point 2148 feels a little ambitious.
Right? It's weird that March was both last month and it's also next month, so 2148 is going to be at least an eternity.
-
RE: What Are You Doing Right Now
@dafyre said in What Are You Doing Right Now:
@DustinB3403 said in What Are You Doing Right Now:
@jt1001001 said in What Are You Doing Right Now:
Troubleshooting weird switch issues; looks like we lost a VLAN power cycled switch and everything came back. Then the AP's all started having weird issues. Second power cycle and everything's settled down. Starting to see why @JaredBusch is not a fan of Netgear (this is my only Netgear switch in the company). Keeping an eye on it.
Very few people here are fans of Netgear switches I believe.
I love their dumb switches. No experience with their newer stuff.
Check out this cute little fella! Runs off PoE, too.
https://store.ui.com/collections/unifi-network-routing-switching/products/usw-flex-mini
-
RE: Pi-hole dumps on Fedora
@VoIP_n00b said in Pi-hole dumps on Fedora:
Just switch to AdGuard Home already
I seem to recall AdGuard was embroiled in something where advertisers were paying to be whitelisted. Maybe it was a different product?
-
RE: NC: Download direct from Plex
Why are you trying to share with all of North Carolina?
-
RE: UniFi Protect G3 Instant - Unboxing, review, and comparison
But it's part of 'protect' so pretty fuckin' worthless.
-
RE: Powershell to unhide all files and copy to nextcloud folder
@JaredBusch said in Powershell to unhide all files and copy to nextcloud folder:
@Grey said in Powershell to unhide all files and copy to nextcloud folder:
@JaredBusch But why robocopy?
Because it does at least skip the ones with no changes.
Why get convoluted with Powershell to do the same?
Not every system may have Robocopy.
-
Powershell for Snapshot Management
3 scripts to help you manage your snapshots:
I think I posted this one before, but I'm including it for completeness.
take-SnapsInteractively.ps1############################# # # Simple process to take a list of vm guests and take snapshots. # VM Guests lists one per line. # # -- Grey Howe Nov 5 2020 # ############################# ############################# # Variables # # Change this to your VSphere server name: $viserver = "" # Use your favorite format or leave as is: $date=get-date -format FileDate # # End Variables ############################# cls Write-Host -ForegroundColor cyan "------------------------------------------------------------`nMake snapshots based on a list in a file.`n------------------------------------------------------------" $file = "$($ENV:USERPROFILE)\desktop\systems.txt" do{Write-Host -ForegroundColor Cyan "Is your file ready?" $ready = (Read-Host -prompt "(q)uit, (Y)es, (n)o").ToLower()} while ($ready -notin @('q','y','n','')) if($ready -eq ''){$ready = 'y'} if($ready -eq 'n'){ $nptest = Test-Path 'C:\Program Files\Notepad++\notepad++.exe' if($nptest -eq $true){ Write-Host -ForegroundColor Cyan "Edit your file and rerun when ready." & "C:\Program Files\Notepad++\notepad++.exe" $file} else{ & $env:windir\system32\notepad.exe $file throw "You're not ready yet. Ending." } } if($ready -eq 'y'){ try {$vmlist = Get-VM |where {$_.guestid -like "dev" -and $_.Name -notlike "*replica*"} } catch [VMware.VimAutomation.Sdk.Types.V1.ErrorHandling.VimException.ViServerConnectionException]{ write-host -ForegroundColor yellow "Caution: No VIServer connection present. Please wait..." Connect-VIServer -Server $viserver -verbose:$false -WarningAction 0 $vmlist = Get-VM |where {$_.guestid -like "dev" -and $_.Name -notlike "*replica*"} } $systems = get-content $file # Run in test mode? do{Write-Host -ForegroundColor cyan "`nRun in test mode? " -NoNewline $test = (Read-Host -prompt "(Y/n)").ToLower()} while ($test -notin @('y','n','')) #Fix 'default' and proceed to test mode. if($test -eq ''){$test = 'y' # test mode Write-Host -ForegroundColor Green "Test mode on the following systems:" $systems|write-host -ForegroundColor Green # Name the new snaps automatically, without asking, just to show work. $name = "$($env:USERNAME)-test" foreach($guest in $systems){ get-vm -Name $guest|ft New-Snapshot -vm $guest -name $name -Verbose -whatif } # Exit Test Mode } ###### Active mode elseif($test -eq 'n'){ Write-Host -ForegroundColor Yellow "Caution: Proceeding to make real snaps." $systems|write-host -ForegroundColor Yellow # Establish what to name the new snaps. Write-Host -ForegroundColor Cyan "Enter name for snapshots.`nENTER for '$($env:USERNAME)':" -NoNewline $name = read-host Write-Host -ForegroundColor Cyan "Purpose & requestor of these snapshots: " -NoNewline $reason = Read-Host # Fix 'default' name. if($name -eq ''){$name = "$($env:USERNAME)-snap"} foreach($guest in $systems){ get-vm -Name $guest|ft New-Snapshot -vm $guest -name $name -Verbose -Description "$($env:USERNAME)-$($reason)" -RunAsync } } } # Quit if($ready -eq 'q'){ Write-Host -ForegroundColor Cyan "Quitting." }
get-SnapList.ps1
###### Variables # Change this to your VSphere server name: $viserver = "" ###### End Variables try {$vmsnaps = get-vm | Get-Snapshot| ?{$_.name -notlike "*veeam*" -and $_.name -and $_.name -notlike "*rest*" -and $_.name -notlike "*repl*"}|select vm,name,description,created,@{l='SizeInGB';e={($_.SizeGB).tostring("#.#")}} |sort created|ft -AutoSize $vmsnaps} catch [VMware.VimAutomation.Sdk.Types.V1.ErrorHandling.VimException.ViServerConnectionException]{ write-host -ForegroundColor yellow "Caution: No VIServer connection present. Please wait..." Connect-VIServer -Server $viserver -verbose:$false -WarningAction 0 $vmsnaps = get-vm | Get-Snapshot| ?{$_.name -notlike "*veeam*" -and $_.name -and $_.name -notlike "*rest*" -and $_.name -notlike "*repl*"}|select vm,name,description,created,@{l='SizeInGB';e={($_.SizeGB).tostring("#.#")}} |sort created|ft -AutoSize $vmsnaps}
remove-snapsInteractively.ps1
###### Variables # Change this to your VSphere server name: $viserver = "" ###### End Variables $l = 0 try {$vmsnaps = get-vm | Get-Snapshot| ?{$_.name -notlike "*veeam*" -and $_.name -and $_.name -notlike "*rest*" -and $_.name -notlike "*repl*"} } catch [VMware.VimAutomation.Sdk.Types.V1.ErrorHandling.VimException.ViServerConnectionException]{ write-host -ForegroundColor yellow "Caution: No VIServer connection present. Please wait..." Connect-VIServer -Server $viserver -verbose:$false -WarningAction 0 $vmsnaps = get-vm | Get-Snapshot| ?{$_.name -notlike "*veeam*" -and $_.name -and $_.name -notlike "*rest*" -and $_.name -notlike "*repl*"} } # Add 'Line' numbers to the array. $vmsnaps | %{$_ | Add-Member -NotePropertyName Line -NotePropertyValue $l -Force; $l++} # Display the list of snapshots, sorted by age. $vmsnaps |select Line,vm,name,description,created,@{l='SizeInGB';e={($_.SizeGB).tostring("#.#")}} |sort created|ft -AutoSize do { # Determine, by input, which snapshot to eliminate. $remLine = Read-Host -Prompt "Enter 'Line' number to remove" # Remove the requested snapshot. Remove-Snapshot $vmsnaps[$remLine] -runasync $quit = Read-host -prompt "Remove another?" } until ($quit -eq 'n') Write-host -ForegroundColor Cyan "`nEnd of Line."
This last one isn't as 'pretty' as the other 2, but it gets the job done. Enjoy!
-
RE: What Are You Doing Right Now
@JaredBusch said in What Are You Doing Right Now:
company meeting
Willy needs to do some dishes and take out the trash, Mike could add some tinsel to his taxidermy, and clearly Bill is deep in thought.
-
RE: Windows Batch: Select Drive
I was a little bored, so here you go:
## Example drive letter selection # Only allow X, Y or <enter> do{Write-Host -NoNewline -ForegroundColor Cyan "What drive letter do you prefer as a backup?" $letter = (Read-Host -prompt "(X) or Y?").ToUpper()} while ($letter -notin @('x','y','')) # This sets the default to X, allowing the user to simply press enter if X is OK. if($letter -eq ''){$letter = 'X'} # Now set the drive letter. New-PSDrive –Name $letter –PSProvider FileSystem –Root “\\server\backup” –Persist -ErrorAction SilentlyContinue
Basic drive letter set is done, but we can be more complicated:
# Do actions based on a user that has an network location from IP. $ipaddr = Get-NetIPAddress|?{$_.SuffixOrigin -eq "Dhcp" -and $_.AddressState -like "*preferred*"}|select -ExpandProperty ipaddress # Set the preferred drive letter. $letter = X If($ipaddr -like '192.168.0.*'){ New-PSDrive –Name $letter –PSProvider FileSystem –Root “\\alpha\backup” –Persist -ErrorAction SilentlyContinue Write-Host -ForegroundColor Green "You're in Alpha!`nBackup drive connected to Alpha site.`nHave a sumptuous day!" } # if you have more networks, insert here with more if statements. Else{ New-PSDrive –Name $letter –PSProvider FileSystem –Root “\\bravo\backup” –Persist -ErrorAction SilentlyContinue Write-Host -ForegroundColor Green "You're in Bravo!`nBackup drive connected to Bravo site.`nHave a sumptuous day!" }
-
RE: What Are You Doing Right Now
@black3dynamite said in What Are You Doing Right Now:
@bnrstnr said in What Are You Doing Right Now:
@travisdh1 said in What Are You Doing Right Now:
@siringo said in What Are You Doing Right Now:
@nadnerB said in What Are You Doing Right Now:
@siringo said in What Are You Doing Right Now:
left a word out.
would free/truenas run AS a vm in hyper-v?
trying to keep myself busy, it's quieter than a cemetery at midnight atm
The general consensus that I've seen here is
- a NAS OS is redundant and hampers efforts to repair things.
- You're better off using something like Fedora, CentOS, Ubuntu Server, or your favourite flavour
so do you mean, just build up another server consisting of an OS that support staff are familiar with, fill it with disk and use that?
Yep, that's been the consensus around here. No real value add in having an appliance manage SAMBA and/or NFS for you. If you really really want a GUI interface, use a RedHat distribution for cockpit.
I haven't tried Cockpit in a while, but I don't believe you could manage shares there last I tried. Do you know if that's changed?
You can manage storage but not shares.
Neth, using Cockpit, allows for share management.
-
VM Hardware Version script to upgrade?
I'm adjusting the vmware hardware version, something similar to:
([VMware.VimAutomation.ViCore.Types.V1.VM.VMVersion]::v10)
What was the script that you used to do a bunch of these, without a reboot, and do you have information on the current vicore type version id for 7.0U1?
-
RE: Non-IT News Thread
@scottalanmiller said in Non-IT News Thread:
https://www.cnn.com/2020/11/02/europe/russia-sausage-king-killed-intl/index.html
At least it wasn't Abe Froman, the sausage king of Chicago!