in reply to Changing Organizational Unit in Active Directory

Not very open source I'm afraid but I wrote a number of proprietary Perl scripts that automate all sorts of AD stuff. Bulk user import into any OU with homedir and any other property setting etc, account enable/disable and password resets are amongst them. The company has been looking at releasing them commercially for a while but it has been on the backburner. They took quite a while to develop as most of the documentation is obscure or incorrect in essential details. Drop me a line so I can show it to the PHB and maybe something might happen. james.freeman@id3.org.uk

By way of hints lidifde utility is good but whitespace sensitive and all online docs (all copies of M$ site stuff anyway) have minor errors in the sample code you need to fix to get them to work - think whitespace and don't do that. ldifde -f dump.txt for hints. Secondly some stuff is just a lot easier to do with short <10 line VBS routines that you can write and exec from perl (I posted one example for you at your other node).

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Replies are listed 'Best First'.
Re: Re: Changing Organizational Unit in Active Directory
by meetraz (Hermit) on Mar 03, 2003 at 17:45 UTC
    I work with one of the largest AD structures in the world, and I've yet to run into very much that I can't do directly in perl. For example, to move John Doe from Marketing into Sales, you could try something like this:

    my $oContainer = Win32::OLE->GetObject("LDAP://OU=Sales, DC=Company, D +C=COM"); my $oUser = $oContainer->MoveHere("LDAP://CN=John Doe, OU=Marketing, D +C=Company, DC=COM"); $oUser->SetInfo();