Free for PREMIUM members
Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium
$String = "Z:\mssql\INST1\MSSQL10_50.INST1\MSSQL\data\MSSQL10_50.INST1\MSSQL"
($String.Split("\") | Select -first 3) -Join("\")
Open in new window
(Get-ItemProperty "$fullpath\Setup").SQLDataRoot.Split("\")[0..2] -join ("\")
If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.