If you come up with a good procedure to do this, please publish what you
did. Perhaps add someting to the Samba Wiki.
> Hi Louis,
>
> Thank you. That's most helpful. I now have the relevant data exported
> and will set up a test domain to see how the import goes.
>
> regards,
> John
>
>
> On 30/08/16 17:31, L.P.H. van Belle via samba wrote:
> > Hai,
> >
> >
> >
> >> I understand that Samba doesn't support domain renaming, which
is why
> >> I'm looking for a way to export the data from one domain and
import it
> >> into a new one.
> > Export your user/group data to CSV, its not that hard.
> >
> >
https://www.manageengine.com/products/free-windows-active-directory-tools/free-active-directory-csv-generator-tool.html
> >
> > Some things work some dont.. try what you can use.
> >
> >
> >
> > Or use CSVDE ( which i preffer )
> >
> > http://www.computerperformance.co.uk/Logon/Logon_CSVDE_Export.htm
> >
> > I used it for exports to csv only, for the import u use the regular
tools on the samba server.
> >
> > Simple user export just open CMD. Type : CSVDE -f adusers.csv -r
"(objectClass=user)"
> >
> > And check your adusers.csv
> >
> >
> >
> >> Sure it would be nice to have a domain rename supported natively
but of all the things that still need to be done in
> >> Samba 4's implementation of AD I don't believe it should
be a high priority.
> >> Domain renames are a fact of life in many organisations, .....
> > Yes and No, after almost 15 years field work, i only had 1 company who
did this and ended up with lots of problems,
> >
> > which we all got fixed, but setting up a new domain and import the
users/groups is much quicker and results in a much cleaner AD.
> >
> >
> >
> >
> >
> > This is how i imported my users from csv for the groups and dns
records its about the same.
> >
> > ( The variable change for you ofcourse since the layout can be
different. )
> >
> >
> >
> > #!/bin/bash
> >
> >
> >
> > ## Show in AD as example : Louis van Belle
> >
> > cat users.csv | awk -F "|" '{system("samba-tool
user create "$5" --surname=\""$3"\"
--given-name=\""$4"\" \
> >
> > --department="$1" --mail-address="$7"
--telephone-number="$6" --random-password --userou=ou=SOMEOU ")
}'
> >
> >
> >
> > Or
> >
> > ## Shown in ad example : L.P.H. van Belle
> >
> > cat users.csv | awk -F ";"
'{system("/usr/bin/samba-tool user create "$5"
--mail-address="$7" \
> >
> > --given-name="$2" --surname=\""$3"\"
--telephone-number="$6" --department="$1"
--description=\""$1"\" \
> >
> > --random-password --userou=ou=SOMEOU ")}';
> >
> >
> >
> >
> >
> >
> >
> > Good luck,
> >
> >
> >
> > Greetz,
> >
> >
> >
> > Louis
Tom Schulz
Applied Dynamics Intl.
schulz at adi.com