Hi,
I need to build a server using MDT system which log on as local administrator during the build. then I need to move the server from a staging OU to the APP OUT during the automatic build process. I know I have to run it with another admin account that has rights to do so in AD.
I log on to the server with the required admin account and manually execute the script and it worked fine. However, when create a run command line sequence in MDT and specify it to run with the same admin account then it failed
the error is: Operating System deployement did not complete successfully.....
Litetouch deployement failed, Return Code = *2417467259 0x80004005
Failed to run the action: Move server to AppName OU
Incorrect function. (erro:00000001'Source:Windows)
The execution of the group (task sequence) has failed and the execution has been aborted.
an action failed
Operation aborted (Erro:90004004;Source:windows)
....
Last line is is Error Task Sequence manager failed to execute task sequence. Code 0x80004005
the code below:
$servername = "$env:COMPUTERNAME"
$targetOU = "OU=APPName, OU=Application,OU=Servers, DC=XYX,DC=ABC,DC=DEF"
$serverDistinguishedName = (Get-ADComputer $servername).DistinguishedName
Move-ADObject $serverDistinguishedName -TargetPath $targetOU
so I am thinking of instead of specify MDT to run the script with admin account, why not use Move-ADObject with -credential parameter.
however, I don't know how to do that. could you please assist?
is it possible to do the above task with one line? ie. get the computer name then move it to a selected OU using a specify admin account and password that has rights to do so in AD?
thank you very much for your help in advance.
Regard,
Betrai