sweety_devil Posted March 13, 2012 Report post Posted March 13, 2012 Dear all, I migrate my computers from XP to Windows 7. I wanted to move the computers with Windows 7 in a new OU. My user has right to add and move computers in AD. But it doesn't work. Do you know why ? I used this script : ' //*************************************************************************** ' //*************************************************************************** ' // ***** Script Header ***** ' // ' // Solution: ConfigMgr ' // File: MoveComputerToCorrectOU.vbs ' // Author: Jakob Gottlieb Svendsen, Coretech A/S. http://blog.coretech.dk ' // Purpose: Move computer to the correct OU that remains in variable MachineObjectOU ' // Run inside TS after install ' // ' // Usage: MoveComputerToCorrectOU.vbs ' // ' // ' // CORETECH A/S History: ' // 0.0.1 JGS 17/12/2009 Created initial version. ' // 0.0.2 MIP 17/03/2009 Added feature to add argument to script ' // 0.0.3 JGS 02/12/2010 Changed to ADSystemInfo for the DN retrieval, instead of a homemade function. ' // Thanks to Nico_ at Technet Forums ' // ' // Customer History: ' // ' // ***** End Header ***** ' //*************************************************************************** '//---------------------------------------------------------------------------- '// Main routines '//---------------------------------------------------------------------------- On Error Resume Next 'Get MachineObjectOU Value Set wshNetwork = CreateObject("WScript.Network") Set oFso = CreateObject("Scripting.FileSystemObject") Set objSysInfo = CreateObject( "ADSystemInfo" ) Set ArgObj = WScript.Arguments 'Use first argument as target OU strMachineObjectOU = ArgObj(0) strComputerDN = objSysInfo.ComputerName nComma = InStr(strComputerDN,",") strCurrentOU = Mid(strComputerDN,nComma+1) strComputerName = Left(strComputerDN,nComma - 1) 'If current ou is different than target OU. Move object If UCase(strCurrentOU) <> UCase(strMachineObjectOU) Then Set objNewOU = GetObject("LDAP://" & strMachineObjectOU) Set objMoveComputer = objNewOU.MoveHere("LDAP://" & strComputerDN, strComputerName) End If '//---------------------------------------------------------------------------- '// End Script '//---------------------------------------------------------------------------- Quote Share this post Link to post Share on other sites More sharing options...
Jorgen Nilsson Posted March 13, 2012 Report post Posted March 13, 2012 Hi, I use the same script a lot, are you sure you have delegeted the correct permissions? The user account must have Delete permissions as well. If you run the script manually with the same user accound does it work then? Here are the correct permissions documentet:http://blog.coretech.dk/mip/creating-a-joindomain-account-for-use-with-sccm-osd/ Regards, Jörgen Quote Share this post Link to post Share on other sites More sharing options...
sweety_devil Posted March 13, 2012 Report post Posted March 13, 2012 I run the script manually and it works. It doesn't work in my task sequence. Quote Share this post Link to post Share on other sites More sharing options...
dani3l Posted March 14, 2012 Report post Posted March 14, 2012 I had the same Problem with a script and i solve it by changeing the tasksequencve like this. Before the change: OSD Step -> Conifg Mgr Client -> Script with Domain Acc With the solution: OSD Step -> Restart -> Config Mgr Client -> Script with Domain Acc The Restart Step solved the problem for me... maybe this helps you Quote Share this post Link to post Share on other sites More sharing options...
RedSoldier-sg Posted May 14, 2013 Report post Posted May 14, 2013 Hi sweety_devil,I face same issue with you...Hi Dani3l,How can i configure the configr client?I was using mdt 2012.... i do a restart and do the custom move.But same problem Quote Share this post Link to post Share on other sites More sharing options...