Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Our Archives > General Archives > Servers > Need help writing script to import MacAdmin Users

 
Need help writing script to import MacAdmin Users
Thread Tools
Fresh-Faced Recruit
Join Date: May 2002
Location: Seattle, WA
Status: Offline
Aug 3, 2004, 06:54 PM
 
Hello,

I was wondering if someone could help me build a script to import the Client Control Database (CCD) from MacAdministrator 3.0 into Mac OS X Server 10.3. The CCD is stored in directories of XML files. Each XML file is named after the user's login name. This is an example of one of the XML files. We'll say the file is named 'user1':
Code:
<LoginEnabled>1</LoginEnabled> <PrintCredits>0</PrintCredits> <MacAdminPasswordOn>1</MacAdminPasswordOn> <MacAdminPassword>password</MacAdminPassword> <LoginList></LoginList>
Some files have addition entries like LastPasswordChange. Notice the password is stored in the XML file as plain text. Also, notice that the username is not contained in the XML, only the file name. Mac OS X Server 10.3 can import users in from an XML file, but the format is different than MacAdministrator. Example:
Code:
0x0A 0x5C 0x3A 0x2C dsRecTypeStandard:Users 3 dsAttrTypeStandard:RecordName dsAttrTypeStandard:Password dsAttrTypeStandard:RealName user1:password:user1
The one time record description at the top is not a problem. I can add that manually. The important part is the user1:password:user1. That's the actual user entry.
If you want to read more on the file format, and what the hex numbers at the top are for, look at this PDF.
So basically, I need a script to build an XML file by taking the password out of the MacAdministrator XML files, and putting the file's name on either side of the password seperated by ':'. I can then throw the example Record Descriptor in my second example, and import them all into Mac OS X Server 10.3.

Any Questions?
Thanks!
skinlayers
     
 
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:22 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2