Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

Active Directory Scripting

Feb 17, 2006 2:49AM PST

I am stumped.

I have sample code;
Set objDesktopOu = _
GetObject("LDAP://ou=" _
& "Desktops,dc=MyDomain," _
& "dc=com")

objDesktopOu.MoveHere _
"LDAP://cn=UserOne,ou=corp," _
& "dc=MyDomain,dc=com", _
& "cn=UserOne"

For moving a user from one OU to another via script. It doesn't work though. I keep getting errors that .MoveHere isn't something that can be used here.

I try the dsmove commands from a command prompt, and the move doesn't work that way either. Is my AD Schema not setup correctly, or do these methods not really work?

What am I missing?

Discussion is locked

- Collapse -
Link, comment.
Feb 17, 2006 2:56AM PST
- Collapse -
Active Directory Scripting
Feb 17, 2006 3:02AM PST

That link is one of the places I found this code. msdn.microsoft.com has some as well.

None of them work. The MyDomain.Com is just an example. I put in my domain information and it just isn't working. I can scripting anything else I have ever tried with AD accounts, but can't seem to pull this off.

And it seems so simple.

- Collapse -
The example as supplied looks incorrect.
Feb 17, 2006 3:08AM PST

As it stands, with mydomain, it's dead.

Bob

- Collapse -
Bad example
Feb 17, 2006 3:35AM PST

Yes, I don't know how they expected this to work. From everything I see on msdn, you have to declare it as an IADSContainer, and I followed all their rules, and it still doesn't work.

I finally did get the dsmove command to work though.

That will do, I will just call the command from the script and go from there.

Thanks for looking.