mirror of
https://github.com/reiyua/AutoOUADCreator.git
synced 2026-01-20 16:47:47 +00:00
More fixes
This commit is contained in:
parent
0aa8bef540
commit
a313e7b671
1 changed files with 1 additions and 1 deletions
|
|
@ -27,7 +27,7 @@ foreach ($row in $fous) {
|
||||||
$ouName = $row.Name
|
$ouName = $row.Name
|
||||||
|
|
||||||
# Check if the OU already exists
|
# Check if the OU already exists
|
||||||
if (-not (Get-ADOrganizationalUnit -Filter {Name -eq $ouName})) {
|
if (-not (Get-ADOrganizationalUnit -Filter "Name -eq '$ouName'")) {
|
||||||
# Create the OU
|
# Create the OU
|
||||||
New-ADOrganizationalUnit -Name $ouName -Path "DC=alphadelta,DC=com" -ErrorAction SilentlyContinue
|
New-ADOrganizationalUnit -Name $ouName -Path "DC=alphadelta,DC=com" -ErrorAction SilentlyContinue
|
||||||
Write-Host "OU '$ouName' created successfully."
|
Write-Host "OU '$ouName' created successfully."
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue