mirror of
https://github.com/reiyua/AutoOUADCreator.git
synced 2026-01-20 16:47:47 +00:00
will it work now???
This commit is contained in:
parent
6fdcbb26e4
commit
fd7d3143d0
1 changed files with 3 additions and 0 deletions
|
|
@ -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 a new issue