Alan's Blog

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

Menu
  • About My Blog
Menu

Tag: PowerShell

Adding Terminal Services Information to User Reports

Posted on February 4, 2017October 14, 2017 by Alan

Add-ADTSInfo.ps1 adds TerminalServicesHomeDrive, TerminalServicesHomeDirectory, TerminalServicesProfilePath and AllowLogon as additional members returned by a query of Active Directory user objects.  As you may know, when looking at a user’s properties in the Active Directory Users and Computers MMC there is a tab for these fields.  However, if you look at the properties of a user object, these…

Read more

Combine CSV Files to XLSX File with Worksheets

Posted on February 4, 2017 by Alan

Three years ago, I posted CombineXLSheets.vbs, a vbScript which allows you to drop and drag Excel spreadsheets onto it and have them combined into a single workbook file with multiple worksheets.  Now that I am working in PowerShell, I have found the need to consolidate CSV files.  Parts of  Combine-CSVFilesToWorksheets.ps1 come from code ported from…

Read more

Consolidating Data For Report: Getting from Group-Object to CSV

Posted on February 4, 2017 by Alan

I am working on some scripts which show AD domain controllers by their site.  My goal was to have the data combined so that  each site has a single row, with the server name and IP address for each site being shown joined by semi-colons.           None of the examples for…

Read more

Convert System.DirectoryServices.SearchResult to a PSObject

Posted on December 25, 2016December 25, 2021 by Alan

The ADSI accelerator is fast, and built into PowerShell, unlike the Active Directory Module.  When use it, or the ADSISearcher, you have results which look like this [Image from previous Microsoft URL]: Getting the properties out to a file can be tricky.  I wrote two little functions to make this easier: Function ConvertTo-PSObjectFromDirectorySearchResult($oDS){ $outval =…

Read more

Get COM Object Constants with PowerShell

Posted on December 25, 2016December 29, 2016 by Alan

I avoid using COM objects whenever I can. One of the annoyances is that you need to look up the value of constants. Shay Levy, in http://www.powershellmagazine.com/2013/03/20/pstip-working-with-excel-constants/ has a script which demonstrates how to enumerate the constants for the Excel COM object.  Get-COMConstants.ps1, is an advanced function generalization, which can be used for any COM…

Read more

Remove DNS Host Record and PTR with PowerShell

Posted on December 10, 2016January 18, 2017 by Alan

You have been asked, “Please remove the host record for these 15 computers, plus their associated PTR records”.  It isn’t a difficult task, but it can be time consuming, especially if you have a large DNS database.  The in-addr.arpa bit can be annoying to do over and over again.  When I first decided to automate…

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

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

Fast PowerShell Treeview OU Selection Form

Posted on April 28, 2016April 16, 2017 by Alan

A large number of my scripts involve picking an Active Directory Organizational Unit (OU). I have been using Out-Gridview for OU navigation. This is because I was unable to find a form based GUI OU picker that worked fast enough in my very large AD environment.  The scripts I have seen tended to collect all objects at…

Read more
  • Previous
  • 1
  • …
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 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

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

Terms and Conditions - Privacy Policy