source: branches/samba-3.3.x/examples/LDAP/convertSambaAccount@ 534

Last change on this file since 534 was 206, checked in by Herwig Bauernfeind, 17 years ago

Import Samba 3.3 branch at 3.0.0 level (psmedley's port)

File size: 5.7 KB
Line 
1#!/usr/bin/perl -w
2##
3## Convert an LDIF file containing sambaAccount entries
4## to the new sambaSamAccount objectclass
5##
6## Copyright Gerald (Jerry) Carter 2003
7##
8## Usage: convertSambaAccount --sid=<Domain SID> \
9## --input=<input ldif> --output=<output ldif> \
10## --changetype=[modify|add]
11##
12## You can generate an input ldif file using:
13## $ ldapsearch -LL -x -h ldapsrv -D cn=root,dc=company,dc=com \
14## -b dc=copmany,dc=com > /tmp/samba3.alpha23.ldif
15##
16## Note the "-LL" so no additional comments are generated
17##
18
19
20use strict;
21use Net::LDAP::LDIF;
22use Getopt::Long;
23
24
25##############################################################################
26## local variables
27
28my ( $domain, $domsid, $changetype );
29my ( $ldif, $ldif2 );
30my ( $entry, @objclasses, $obj );
31my ( $is_samba_account, $is_samba_group );
32my ( %attr_map, %group_attr_map, $key );
33my ( @dels, $deletion, @adds, $addition );
34my ( $result, %options );
35
36
37##############################################################################
38## Print the option usage
39