Re: Moving machine accounts from one ou to another



you can use the MOVEHERE method. See the example at the end of the page
http://www.microsoft.com/technet/scriptcenter/resources/qanda/dec04/hey1214.mspx

in your case you should use the following code:

Set objNEWOU = GetObject("LDAP://ou=newCOMPUTERSou, dc=domain, dc=com")
objNEWOU.MoveHere "LDAP://cn=computer01,ou=oldCOMPUTERSou,dc=domain,dc=com";,
"cn=computer01"

--

Cheers,
(HOPEFULLY THIS INFORMATION HELPS YOU!)
# Jorge de Almeida Pinto #
MVP Windows Server - Directory Services
BLOG --> http://blogs.dirteam.com/blogs/jorge/default.aspx
-----------------------------------------------------------------------------
* This posting is provided "AS IS" with no warranties and confers no rights!
* Always test before implementing!
-----------------------------------------------------------------------------


-----------------------------------------------------------------------------
"ButlerKevinD" <ButlerKevinD70@xxxxxxxxxxx> wrote in message
news:%23rdTfm7GGHA.2444@xxxxxxxxxxxxxxxxxxxxxxx
> Hey, does anyone here have any suggestions for or examples of scripts to
> move computer accounts from one ou to another?? i have about 6k
> workstation accounts that i would like to move to geographically named
> ou's (building they are housed in) along with segregating them based on
> their operating system. here is a basic example of what i am wanting to
> accomplish:
>
> ad root
> |
> |
> |
> machine accounts
> |
> |
> |
> bldg #1-----
> | |
> | |
> | WinNT
> | |
> | Win2k
> | |
> | WinXP
> |
> |
> bldg #2-----
> |
> |
> WinNT
> |
> Win2k
> |
> WinXP
>
> also, if there is something that is friendly to those of us who have never
> written an ADSI script, that would be extremely helpful. i'm trying to do
> this as "free" as possible. again, any suggestions would be greatly
> appreciated. thanks in advance.
>


.



Relevant Pages

  • Re: unable to add machine accounts to domain
    ... # Jorge de Almeida Pinto # MVP Windows Server - Directory Services ... BLOG --> http://blogs.dirteam.com/blogs/jorge/default.aspx ... Redirusr.exe (for user accounts) and redircomp.exe (for ...
    (microsoft.public.windows.server.active_directory)
  • Re: Rename "Users" OU
    ... child domain: CHILD.ADCORP.LAN ... try to create an OU named CHILD in ADCORP.LAN ... # Jorge de Almeida Pinto # MVP Windows Server - Directory Services ... The issue is that an application MUST hold its accounts in the users ...
    (microsoft.public.win2000.active_directory)
  • Re: Multiple Accounts Error with only one Computer Account in Domain
    ... # Jorge de Almeida Pinto # MVP Windows Server - Directory Services ... BLOG --> http://blogs.dirteam.com/blogs/jorge/default.aspx ... There are multiple accounts with name cifs/computer3 of type ... container replication with replmon and it says there are no replication ...
    (microsoft.public.windows.server.active_directory)
  • Re: LDAP?
    ... Joe Richards Microsoft MVP Windows Server Directory Services ... Author of O'Reilly Active Directory Third Edition ... freenas to connect to active directory using ldap older accounts do not work. ... Accounts predating migration cease to work.. ...
    (microsoft.public.windows.server.active_directory)
  • Re: unable to add machine accounts to domain
    ... # Jorge de Almeida Pinto # MVP Windows Server - Directory Services ... computers container to the NEW OU. ... Redirusr.exe (for user accounts) and redircomp.exe (for computer ... This allows administrators to ...
    (microsoft.public.windows.server.active_directory)