WHAT!? 47 day certificate!!! oh man! that’s crazy I know we aren’t there yet, but if we are going to get there I am going to build the system like we are – and treat the current cert length as a safety net as we get this system rolling. Once we’re actually dealing with 47-day […]
Steve Borba
My notes, I hope they help you, feel free to comment/add to them
Category: Powershell
every once in a while I need to get information from active directory, here are some of them: DN of a user in ad: DN of a group: The next one will do it for domain trusts
Get-NetFirewallRule | ? { $_.Enabled -eq “True” -and $_.Action -eq “Allow” } | Out-GridView -Title “Select Firewall Rules to change to Block” -OutputMode Multiple | Set-NetFirewallRule -Action Block
Wow… it was hard to post this… not sure what is stopping me.. my AV keeps eating the file on my PC too.
I created my first powershell module, so I am going to put it in my own words so I can create another later if I wanted to. First start making functions and store them by alone in .ps1 files. Create a folder structure with the supporting functions (ones users won’t user) in private and the […]
I was working on some powershell scripts and my son came into the room and asked me if I could get the computer to talk to him, so I had to figure out how to do it: Add-Type -AssemblyName System.speech $speak = New-Object System.Speech.Synthesis.SpeechSynthesizer ForEach ($Voice in ($speak.GetInstalledVoices() | % {$_.VoiceInfo.Name})) { $speak.SelectVoice($Voice) $speak.Speak(“I am […]
I combined a few scripts and tried to speed them up, originally it took 30-40 minutes, but I got it down to 3-5. The majority of the script came from here. I also took some from Jason for the progress bars, but added the ETA seconds. #Prompt User for VC addresses, if more than one, […]
Here is a script for progress bar and ETA, I grabbed part of it from Jason. $LoopAverage = 0 $Max = 150 $Speed = 50 $i=0 While ($i -lt $Max) { $StartLoopTime = Get-Date $ParentLoopText = (“Working on iteration “+$i++) if (($i+1 -gt 6) -or ($i+1 -gt ($Max * 0.1))) { if ( [Math]::Abs($Delta) -lt […]
Here is a Powershell Script to send a WOL packet (and I’ve had it work over a routed connection, but it depends if the router will broadcast if doesn’t have arp for the IP): function Send-WOL { <# .SYNOPSIS Send a WOL packet to a broadcast address .PARAMETER mac The MAC address of the device […]