# Specify target OU. This is where users will be moved.
$TargetOU = "OU=Districts,OU=IT,DC=enterprise,DC=com"
# Specify CSV path. Import CSV file and assign it to a variable.
$Imported_csv = Import-Csv -Path "C:\temp\MoveList.csv"
$Imported_csv | ForEach-Object {
# Retrieve DN of user.
$UserDN = (Get-ADUser -Identity $_.Name).distinguishedName
# Move user to target OU.
Move-ADObject -Identity $UserDN -TargetPath $TargetOU
}
Moving users to OU - powershell
DIsable LAPS
Turn all items to disabled in LAPS GPO Remove LAPS passwords Get-ADComputer -Filter * -SearchBase “OU=Servers,DC=mydomain,DC=com” | Se...
Mais vistos
-
Java Keytool Command These commands allow you to generate a new Java Keytool keystore file, create a CSR, and import certificates. A...
-
Kaspersky seems to be storing windows update files on the C Drive: Here -> C:\ProgramData\KasperskyLab\adminkit\1093\.working Change fo...
-
A few cmds to help with the DFS troubleshooting aspects, keep in mind all should be run from an elevated PowerShell Dfsdiag /TestDCs D...