Let's say I have below OU tree:
DataManagement └─Country ├─Germany │ └─Users │ ├─Laptops │ └─Computers ├─France │ └─Users │ ├─Laptops │ └─Computers etc.
I would like to update specific container in OU, for example, users in laptops group in France. How to do that if I would like to import users from CSV? Below code check and update all OU. Unfortunately, I have no idea how to select a specific container. Any suggestions?
Import-Module ActiveDirectory
$Userscsv = Import-Csv D:\areile\Desktop\adtest.csv
foreach ($User in $Userscsv) {
Set-ADUser $User.SamAccountName -Replace @{
Division = $User.Division;
Office = $User.Office;
City = $User.City
}
}