Categories
October Surprise 2024

Powershell script to extract a substring from a string

The Pathname object, which is a COM object implementation of the IADsPathname interface, has been around since Windows 2000. It’s not very well known, but it’s really the right tool to use for parsing AD paths. It lacks a typelib so it’s a bit awkward to use from PowerShell; hence the Get-ADPathname.ps1 script.