title: VBS Scripting to move computers from one OU to the next
body: <p>I am working on packaging a script for the company that I work for that will allow field service techs to convert computers in a private workstation OU to a team workstation OU and vice versa.</p>
  
  <p>That is a small part of this script for now and one that has had me puzzled for most of the day.  I've tried different variations of this script and landed on one that I believe will get me on the right track. </p>
  
  <pre><code>strComputer = "." 
  Set objWMIService = GetObject("winmgmts:\\" &amp; strComputer &amp; "\root\cimv2") 
  Set colItems = objWMIService.ExecQuery("Select Name from Win32_ComputerSystem",,48) 
  For Each objItem in colItems 
  strPCName = objItem.Name 
  Next 
  Set objNewOU = GetObject("LDAP://OU=Computers,OU=Corporate,DC=xxxxx,DC=net") 
  Set objMoveComputer = objNewOU.MoveHere("LDAP://CN=" &amp; strPCName &amp; ",OU=Computers,OU=Corporate,DC=xxxxx,DC=net",vbnullstring) 
  </code></pre>
  
  <p>I get an error, There is no such object on the server.  When I put the computer manually in the OU in question, I don't get that error message.  This is where I'm stuck at the moment.  </p>
  
  <p>The scripting is in my personal lab at the moment.  </p>