Created
October 17, 2019 00:17
-
-
Save gjyoung1974/e04753c70cbf4715d55bd5900dfa4a6f to your computer and use it in GitHub Desktop.
ADMT Active Directory Migrate Users
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$SearchBase='OU=Users,OU=SomeOU,DC=ad,DC=SomeDomain' | |
$arr = Get-ADUser -Server "ad.SomeDomain" -SearchBase $SearchBase -Filter * | |
ForEach ($item in $arr) { | |
# Prepare the command line | |
$command = @' | |
cmd.exe /C C:\Windows\ADMT\admt.exe USER /n $item.SamAccountName.ToString() /o C:\users\SomeUser\options.ini | |
'@ | |
# store the object: | |
Invoke-Expression -Command:$command | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment