Alan's Blog

"Yeah. I wrote a script that will do that."

Menu
  • About My Blog
Menu

Finding MTU for all Hops in a Trace Route

Posted on October 1, 2016June 8, 2025 by Alan

I know, finding the “maximum” MTU is a redundancy, as MTU is an acronym for “Maximum Transmission Units”.  However, my needs were to find all the MTUs to each hop of a tracert.  Like many scripts, Find-MaxMTU.ps1 turned out to be a cut and paste exercise.  I started with the Find-MTU script written by Robin CM. …

Read more

Function to Get Splat Parameters from a CSV File

Posted on October 1, 2016October 8, 2016 by Alan

Splatting is the use of a hash table to pass parameters to a PowerShell script.  As PowerShell scripts grow in complexity, you may want to pass a large number of parameters multiple times, for scripts which spin up a lab environment, or for Desired State Configuration.  It took me a while to figure out how…

Read more

Quickly Check Domain Controller Health

Posted on September 5, 2016February 25, 2024 by Alan

How can you tell whether an Active Directory domain controller is functioning properly?  How do you know whether some over-zealous VLAN ACL is blocking necessary ports?  Testing ICMP, is easy, just ping it.  Testing LDAP response isn’t hard, I wrote a vbScript to do that years ago.  But to complete, we want to check more. …

Read more

CIM_DATETIME Conversion Functions

Posted on September 5, 2016 by Alan

Also known as WMI Time, or WBEM DateTime,  CIM_DATETime, https://msdn.microsoft.com/en-us/library/aa387237(v=vs.85).aspx, is that odd Windows DateTime format that shows values looking like “20160905103517.816236-240”  The COM Object that presents this is  WbemScripting.SWbemDateTime, and you frequently see code to convert to this format using it, or a tortuous series of string manipulations.  My rule of thumb is this: …

Read more

Get All the Groups for A Users

Posted on June 26, 2016July 6, 2016 by Alan

Every admin has gotten the question, “What group is that user in which granted him those permissions?” I have combined a few scripts to create a list of all of a user’s groups, and included the nesting of groups memberships.  Get-ADGroupMemberships.ps1 is based on a script by I.C.A. Strahan, here. My version adds information about…

Read more

WMI Repair — The Old Way is a Bad Way

Posted on June 26, 2016March 15, 2020 by Alan

This was forwarded to me from one of our Microsoft guys.  I have been using a batch file to fix WMI with this line for years: WMI: Stop hurting yourself by using “for /f %%s in (‘dir /s /b *.mof *.mfl’) do mofcomp %%s”

Read more

Move Selected Item Up or Down in PowerShell Listbox

Posted on May 30, 2016 by Alan

Listbox Move Up Down Buttons.ps1 shows the event handlers for moving a selected item up and down in a PowerShell listbox. I wrote it because couldn’t find it anywhere else. $handler_DownButton_Click= { #only if the last item isn’t the current one if(($ListBox1.SelectedIndex -ne -1) -and ($ListBox1.SelectedIndex -lt $ListBox1.Items.Count – 1) ) { $listbox1.BeginUpdate() #Get starting…

Read more

A GUI to Select Object Properties in Pipeline

Posted on May 14, 2016May 17, 2016 by Alan

My first attempt at a GUI to select objects properties demonstrated that I didn’t have a firm grasp on how to pipeline an object through an advanced function.  The problem I had at the time was not understanding how to have the form only appear once.  Why is that difficult?  Because the Begin Block won’t…

Read more

Copy Distinguished Name of OU to Clipboard (OUADSPath2Clip Updated)

Posted on April 28, 2016May 4, 2016 by Alan

OUADSPathToClip.ps1 is an updated version of OUADSPath2Clip.ps1 and is an example implementation of the new Select-OU.ps1 script.  Fast navigation of OU structure to copy the OU’s DistinguishedName into your clipboard. Version 1.1 allows control of form and button text.

Read more

A Reasonably Fast Select AD Object PowerShell Form

Posted on April 28, 2016May 4, 2016 by Alan

Like Select-ADOU.ps1, the Select-ADObject.ps1 PowerShell Script begins by finding the AD Forest, and enumerating all domains. The user’s current domain is set as the default, and the first level of the domain is automatically expanded and put into the TreeView. This expansion of the first level is done with any domain selected. Double click on an node…

Read more
  • Previous
  • 1
  • …
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • …
  • 42
  • Next

Search

Please Note

All the scripts are saved as .txt files. Newer files have a “View Script” button which will let you save or open a script in notepad. For earlier posts, the easiest way to download with IE is to right click on the link and use “Save Target As”. Rename file from Name_ext.txt to Name.ext.

To see a full post after searching, please click on the title.

PowerShell Scripts were written with version 3 or later.

https connections are supported.

All new users accounts must be approved, as are comments. Please be patient.  If you find a post error or a script which doesn’t work as expected, I appreciate being notified.  My email is my first name at the domain name, and you are welcome to contact me that way.

Tags

1E ACLS Active Directory ActiveDirectory ADSI Advanced Functions Audit Change Administrator Password COMObject Computer Groups DateTime Desktop DNS Excel FileScriptingObject Forms General GPO GPS Group Policy Hacks ISE Lockout logons NAV740 Nessus OU OU permissions Outlook Pick Folder Power PowerShell Powershell Scriptlets RDP SCCM schedule reboot Scripting Security Shell.Application user information VBA Windows Update WMI WordPress WPF

Categories

akaplan.com

  • Back to Home Page

Archives

Scripting Sites

  • A Big Pile of Small Things
  • Adam, the Automator
  • Art of the DBA
  • Ashley McGlone
  • Boe Prox
  • Carlo Mancini
  • DexterPOSH
  • Doug Finke
  • Jaap Brasser's Blog
  • JeffOps The Scripting Dutchman
  • Jonathan Medd's Blog
  • Keith Hill's Blog
  • LazyWinAdmin
  • Nana Lakshmanan
  • PowerShell Magazine
  • PowerShell Team Blog
  • PowerShell.org
  • PwrShell.net
  • Richard Siddaway's Blog
  • Ryan Yates' Blog
  • Skatterbrainz
  • The Lonely Administrator

SQL Site

  • Art of the DBA

Meta

  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
©2025 Alan's Blog | Theme by SuperbThemes

Terms and Conditions - Privacy Policy