<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>James&#039; Tools and Tricks &#187; eDirectory</title>
	<atom:link href="http://jrudd.org/wordpress/tag/edirectory/feed/" rel="self" type="application/rss+xml" />
	<link>http://jrudd.org/wordpress</link>
	<description>Tools, Tips and Hints for managing a network.</description>
	<lastBuildDate>Mon, 26 Jul 2010 03:13:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Migrating DHCP reservations from Novell to Microsoft</title>
		<link>http://jrudd.org/wordpress/2009/02/13/migrating-dhcp-reservations-from-novell-to-microsoft/</link>
		<comments>http://jrudd.org/wordpress/2009/02/13/migrating-dhcp-reservations-from-novell-to-microsoft/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 01:36:36 +0000</pubDate>
		<dc:creator>James Rudd</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Novell]]></category>
		<category><![CDATA[dhcp]]></category>
		<category><![CDATA[dhcp reservations]]></category>
		<category><![CDATA[dhcp server service]]></category>
		<category><![CDATA[dhcp servers]]></category>
		<category><![CDATA[eDirectory]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[novell dhcp]]></category>
		<category><![CDATA[novell servers]]></category>
		<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://jrudd.org/wordpress/?p=71</guid>
		<description><![CDATA[We are gradually migrating our core services from Netware to Windows Server 2003 and 2008. As part of this migration we needed to migrate all our DHCP reservations stored on our Novell servers to Windows Servers. ]]></description>
			<content:encoded><![CDATA[<p>We are gradually migrating our core services from Novell Netware to Windows Server 2003 and 2008. As part of this migration we needed to migrate all our DHCP reservations stored on our Novell servers to Windows Servers.</p>
<p>First a comment, although Microsoft seems to have a much better DNS system than on Netware 6.5, their DHCP implementation leaves a lot to be desired.</p>
<p>On Novell I could create a scope, reservations and options and it is stored in eDirectory. I could then have multiple DHCP servers with different IP ranges to offer. I could use the java console (sometime slow) to add a reservation and it would sync to both servers.</p>
<p>On Windows Server 2003 and 2008 I need to separate create scopes, allocation ranges and reservations on each server. Their is no synchronisation or communication between these servers. This means to migrate my reservations from my current Netware DHCP servers to the target Windows servers the reservations need to be added to each server, as well as adding any future reservations to both servers.</p>
<h2>Migration Process</h2>
<p>First use the Novell DNS/DHCP console and export the DHCP scope / database you are migrating.</p>
<p>I have written the following Perl code to read in the DHCP3TAB file generated and output a netsh file that will add all your reservations to any number of Windows DHCP servers.</p>
<p>You will need to modify the DHCP servers list to your AD servers and change the scopeName to the correct IP settings.</p>
<p>After running your DHCP3TAB through the perl script, copy output to your server and run <em>netsh exec outputFile.txt</em> to add it to your servers.</p>
<pre class="brush: perl;">
#!C:\Perl\bin\perl.exe

# Designed to read in Rservations from a Novell DHCP Tab file and output a NetSH script file
# From http://technet.microsoft.com/en-us/library/cc787375.aspx
# On the destination server, the exec command is used to load and execute the converted reservations:
#  netsh exec AdReservations.txt
# After you use the exec command to load the file, you must reconcile all scopes.
# Use net stop dhcpserver to stop the DHCP Server service and net start dhcpserver to restart it. Once the service is restarted, DHCP database changes take effect.

use strict; use warnings;

my $dhcptabName = &quot;DHCP3TAB.txt&quot;;
my $outFile = &quot;AdReservations.txt&quot;;
my @dhcpServers = ('\\\\DHCPServer1.win.us.schools.nsw.edu.au',
    '\\\\DHCPServer2.win.us.schools.nsw.edu.au');
my $scopeName = &quot;10.10.11.0&quot;;

open F, &quot;&lt; $dhcptabName&quot; or die &quot;Can't open $dhcptabName : $!&quot;;
open O, &quot;&gt; $outFile&quot; or die &quot;Can't open $outFile : $!&quot;;

# File parsing
my $ip;
my $host;
my $mac;
my $type;
my $comment=&quot;&quot;;

while (my $line = &lt;F&gt;){
  if ($line =~ /^\[IP Address Configuration /i) {
  # New entry, clear values
    $ip=&quot;&quot;, $host=&quot;&quot;, $mac=&quot;&quot;, $type=&quot;&quot;, $comment=&quot;&quot;;

    while ((my $entry = &lt;F&gt;) !~ /^$/){
    # Parse and fill in values
      if ($entry =~ /IP Address Number = ([\d.]+)/i){
        $ip=$1;
      }
      elsif ($entry =~ /Assignment Type = (\d+)/i){
        $type=$1;
      }
      elsif ($entry =~ /Host Name = ([\w\-_]+)/i){
        $host=$1;
      }
      elsif ($entry =~ /MAC Address = 1 (.+)/i){
        $mac=$1;
        $mac=~ s/\s+//g;
      }
      elsif ($entry =~ /Comment = (.+)/i){
        $comment=$1;
      }
    }

    # Following determines which type of entries to convert. Default is only reservation.
    # You can comment it out and uncomment the second line to include reservations and allocated IPs.
    # If  type != 8 (reservation) discard
    next unless ($type == 8); 

    # If  type != 8 (reservation) or  != 2 (Allocated) discard
    # next unless  ($type  == 8 or $type  == 2);

    next if ($mac eq &quot;&quot; or $ip eq &quot;&quot; or $host eq &quot;&quot;);
    foreach my $server (@dhcpServers){
      print O &quot;Dhcp Server $server Scope $scopeName Add reservedip $ip $mac \&quot;$host\&quot; \&quot;$comment\&quot; \&quot;BOTH\&quot;\n&quot;;
    }
  }
}

close F;
close O;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://jrudd.org/wordpress/2009/02/13/migrating-dhcp-reservations-from-novell-to-microsoft/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Renaming Novell user accounts</title>
		<link>http://jrudd.org/wordpress/2008/12/28/renaming-novell-user-accounts/</link>
		<comments>http://jrudd.org/wordpress/2008/12/28/renaming-novell-user-accounts/#comments</comments>
		<pubDate>Sun, 28 Dec 2008 01:24:08 +0000</pubDate>
		<dc:creator>James Rudd</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Moodle]]></category>
		<category><![CDATA[Novell]]></category>
		<category><![CDATA[Utilities]]></category>
		<category><![CDATA[account]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[eDirectory]]></category>
		<category><![CDATA[home directories]]></category>
		<category><![CDATA[login names]]></category>
		<category><![CDATA[novell edirectory]]></category>
		<category><![CDATA[Password]]></category>
		<category><![CDATA[username]]></category>
		<category><![CDATA[usernames]]></category>

		<guid isPermaLink="false">http://jrudd.org/wordpress/?p=43</guid>
		<description><![CDATA[Recently we had to change the login names for around 1200 students. As part of this rename we needed to change their Novell eDirectory account and home directory. We also needed to ensure linked systems such as an LDAP authenticated Moodle site and an IDM linked Active Directory (AD) domain were properly updated. To perform <a href='http://jrudd.org/wordpress/2008/12/28/renaming-novell-user-accounts/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Recently we had to change the login names for around 1200 students.</p>
<p>As part of this rename we needed to change their Novell eDirectory account and home directory. We also needed to ensure linked systems such as an LDAP authenticated <a href="http://moodle.org/" target="_blank">Moodle </a>site and an IDM linked Active Directory (AD) domain were properly updated.</p>
<p>To perform the user account and folder rename we used <a href="http://www.hbware.com/content/view/61/12/" target="_blank">Mass User</a> from <a href="http://www.hbware.com/" target="_blank">HBWare</a>. This is a great program we already used for creating and managing home directories and quotas. There was a small bug in the rename area, but it was quickly fixed when brought to Hans’ attention.<br />
Note: Before beginning you need to have a list of the old usernames and the new usernames.  A simple two column Excel or CSV file would be fine.</p>
<h2>Novell</h2>
<p>Create Mapping File: The mapping file is used by Mass User to know what to rename the existing username to.</p>
<p>Use <a href="http://www.novell.com/coolsolutions/tools/13908.html">NDS Report</a> ( http://www.novell.com/coolsolutions/tools/13908.html ) to create a list of all the accounts. You only want the DN and CN fields. Save this as an Excel or CSV file.</p>
<div id="attachment_50" class="wp-caption alignnone" style="width: 310px"><a href="http://jrudd.org/wordpress/wp-content/uploads/2008/12/1andsrepcontainer.png" rel="lightbox[43]"><img class="size-medium wp-image-50" title="NDS Report: Select Student OU" src="http://jrudd.org/wordpress/wp-content/uploads/2008/12/1andsrepcontainer-300x251.png" alt="NDS Report: Select Student OU" width="300" height="251" /></a><p class="wp-caption-text">NDS Report: Select Student OU</p></div>
<div id="attachment_51" class="wp-caption alignnone" style="width: 310px"><a href="http://jrudd.org/wordpress/wp-content/uploads/2008/12/1bndsrepuser.png" rel="lightbox[43]"><img class="size-medium wp-image-51" title="NDS Report: Choose only CN" src="http://jrudd.org/wordpress/wp-content/uploads/2008/12/1bndsrepuser-300x249.png" alt="NDS Report: Choose only CN" width="300" height="249" /></a><p class="wp-caption-text">NDS Report: Choose only CN</p></div>
<p>Create a new MS Access file and import the account list<br />
Import the text / excel file that lists the old and new account names.<br />
You now need to create a query that maps the cn to the old account name, and then use this to generate a list of the full old dn and the new account name.</p>
<div id="attachment_53" class="wp-caption alignnone" style="width: 310px"><a href="http://jrudd.org/wordpress/wp-content/uploads/2008/12/2aaccessmapping.png" rel="lightbox[43]"><img class="size-medium wp-image-53" title="Access: Mapping Query" src="http://jrudd.org/wordpress/wp-content/uploads/2008/12/2aaccessmapping-300x274.png" alt="Access: Mapping Query" width="300" height="274" /></a><p class="wp-caption-text">Access: Mapping Query</p></div>
<div id="attachment_54" class="wp-caption alignnone" style="width: 310px"><a href="http://jrudd.org/wordpress/wp-content/uploads/2008/12/2baccessdata.png" rel="lightbox[43]"><img class="size-medium wp-image-54" title="Access: Query Results" src="http://jrudd.org/wordpress/wp-content/uploads/2008/12/2baccessdata-300x206.png" alt="Access: Query Results" width="300" height="206" /></a><p class="wp-caption-text">Access: Query Results</p></div>
<p>You can then export this as a text file.</p>
<div id="attachment_55" class="wp-caption alignnone" style="width: 310px"><a href="http://jrudd.org/wordpress/wp-content/uploads/2008/12/2caccessexport1.png" rel="lightbox[43]"><img class="size-medium wp-image-55" title="Access: Export as Text file" src="http://jrudd.org/wordpress/wp-content/uploads/2008/12/2caccessexport1-300x195.png" alt="Access: Export as text file" width="300" height="195" /></a><p class="wp-caption-text">Access: Export as text file</p></div>
<div id="attachment_56" class="wp-caption alignnone" style="width: 310px"><a href="http://jrudd.org/wordpress/wp-content/uploads/2008/12/2daccessexport2.png" rel="lightbox[43]"><img class="size-medium wp-image-56" title="Access: Export Delimited" src="http://jrudd.org/wordpress/wp-content/uploads/2008/12/2daccessexport2-300x212.png" alt="Access: Export Delimited" width="300" height="212" /></a><p class="wp-caption-text">Access: Export Delimited</p></div>
<p>You will need to set the field separate as ‘=’ and set the test qualifier to none.</p>
<div id="attachment_57" class="wp-caption alignnone" style="width: 310px"><a href="http://jrudd.org/wordpress/wp-content/uploads/2008/12/2eaccessexport3.png" rel="lightbox[43]"><img class="size-medium wp-image-57" title="Access: Export = Delimiter and no Text Qualifier" src="http://jrudd.org/wordpress/wp-content/uploads/2008/12/2eaccessexport3-300x213.png" alt="Access: = as Delimiter and no Text Qualifier" width="300" height="213" /></a><p class="wp-caption-text">Access: = as Delimiter and no Text Qualifier</p></div>
<p>You should end up with each line having format:<br />
OLDNAME.OU.C=NEWNAME<br />
Once the mapping file is generated you can apply it either to individual OUs (e.g. year groups), or to the entire Users container. I would recommend applying to small containers initially to allow checking for errors. After verifying all renames were performed correctly you can then apply the rename to your entire users’ container.</p>
<div id="attachment_58" class="wp-caption alignnone" style="width: 310px"><a href="http://jrudd.org/wordpress/wp-content/uploads/2008/12/massuserrename.png" rel="lightbox[43]"><img class="size-medium wp-image-58" title="Mass User: Rename" src="http://jrudd.org/wordpress/wp-content/uploads/2008/12/massuserrename-300x234.png" alt="Mass User: Rename" width="300" height="234" /></a><p class="wp-caption-text">Mass User: Rename</p></div>
<h2>IDM 3.0 – Active Directory</h2>
<p>Before doing the mass rename we did some simple tests of renaming eDirectory accounts to see how they replicated to Active Directory. We determined that the individual renames were successfully propagated through IDM to automatically change the pre-2000 and logon name fields to match the new eDirectory account.<br />
When performing the mass rename of accounts, AD was checked after doing each OU to check propagation was successful. We experienced no problems with IDM and all accounts were successfully synchronised with Active Directory.</p>
<h2>Moodle</h2>
<p>For Moodle we wished for users to retain their own accounts including all their settings and course information.  To do this the username stored in the Moodle Database (DB) would need to be changed to the new username.<br />
Before making changes to Moodle I recommend putting the site in admin mode and temporarily disabling your LDAP authentication. I only put the site in Admin mode and then had problems during migration as some students had attempted to logon after I had renamed the eDirectory accounts, but before migrating Moodle accounts. This created new user accounts in Moodle that prevented the update queries running due to duplicate key name problems (ie the old account would not rename to new one if one has already been created with the new name)<br />
First you need to import your list of old and new account names into the database. If you already have it in a separate DB on your Moodle server you can use that, otherwise it is best to just to create a new table in the Moodle DB.<br />
I used this query to check the mapping fields. You will need to adjust the fields and collation types for your own setup.<br />
I use the IDNumber field to store the full DN, if you use a different field you will need to adjust this.</p>
<h3>Validation:</h3>
<p><code># Shows the current username, the new username and the new IDNumber field for validation check.<br />
SELECT mdl.`username` , ern.`StudentId` , replace( `idnumber` , mdl.`username` , ern.`StudentId`<br />
COLLATE latin1_swedish_ci )<br />
FROM moodle.`mdl_user` mdl, sbhsdata.`oasisStudentIdMap` ern<br />
WHERE mdl.`username`<br />
COLLATE latin1_general_ci = ern.`OldStudentId`</code></p>
<h3>Update:</h3>
<p><code># Replaces the IDNumber field with the new username.<br />
UPDATE moodle.`mdl_user` mdl, sbhsdata.`oasisStudentIdMap` ern<br />
SET  `idnumber` = replace( `idnumber` , mdl.`username` , ern.`StudentId` COLLATE latin1_swedish_ci )<br />
WHERE mdl.`username`<br />
COLLATE latin1_general_ci = ern.`OldStudentId`</code></p>
<p><code># Replaces the mdl_user field with the new username.<br />
UPDATE `mdl_user` mdl, `rename` ren<br />
SET  mdl.`username` = ren.`newname`<br />
WHERE mdl.`username`= ren.`oldname`</code><br />
Note: As can be seen by the queries, during the migration I did two separate updates, one to update the IDNumber field and another to update the mdl_user field. When I had completed migration I realised I had only needed to update the mdl_user field as Moodle would automatically update the value in IDNumber at next log on.</p>
<h2>Round Up</h2>
<p>The migration to the new accounts went well with no problems from student passwords or accounts, although we had a few instances of students using the old username instead of the new one.</p>
<p>Since performing the change we have also implemented a <a href="http://www.papercut.com/products/ng/">Papercut</a> system which would have required the additional step of <a href="http://www.papercut.com/kb/Main/RenameUserAccounts">renaming</a> all of its accounts to ensure student balances were carried across.</p>
]]></content:encoded>
			<wfw:commentRss>http://jrudd.org/wordpress/2008/12/28/renaming-novell-user-accounts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
