will it work now???
This commit is contained in:
parent
6fdcbb26e4
commit
fd7d3143d0
|
@ -26,6 +26,9 @@ foreach ($row in $fous) {
|
||||||
# Get the name of the OU from the CSV
|
# Get the name of the OU from the CSV
|
||||||
$ouName = $row.Name
|
$ouName = $row.Name
|
||||||
|
|
||||||
|
# Get all existing OUs in the specified path
|
||||||
|
$existingOUs = Get-ADOrganizationalUnit -Filter * -SearchBase "DC=alphadelta,DC=com" | Select-Object -ExpandProperty Name
|
||||||
|
|
||||||
# Check if the OU already exists
|
# Check if the OU already exists
|
||||||
if (-not (Get-ADOrganizationalUnit -LDAPFilter "(Name=$ouName)")) {
|
if (-not (Get-ADOrganizationalUnit -LDAPFilter "(Name=$ouName)")) {
|
||||||
# Create the OU
|
# Create the OU
|
||||||
|
|
Loading…
Reference in New Issue