From 0aa8bef54015ad24408f260388d6546cee530893 Mon Sep 17 00:00:00 2001 From: reiyua Date: Fri, 12 Apr 2024 21:12:06 +1000 Subject: [PATCH] Various fixes --- AutoOUADCreator.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/AutoOUADCreator.ps1 b/AutoOUADCreator.ps1 index 6043b56..91f6bfb 100644 --- a/AutoOUADCreator.ps1 +++ b/AutoOUADCreator.ps1 @@ -22,7 +22,7 @@ echo $fpath $fous = Import-Csv $fpath #Create OU's within the Active Directory forest by looping throughout each row within the CSV file. -foreach ($row in $ouData) { +foreach ($row in $fous) { # Get the name of the OU from the CSV $ouName = $row.Name @@ -36,4 +36,6 @@ foreach ($row in $ouData) { Write-Host "OU '$ouName' already exists, proceeding to next entry." } } +} else { + Write-Host "The specified CSV file does not exist." }