<?xml version="1.0" encoding="utf-8"?><!-- generator="wordpress/2.2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: MacInTouch: updating then resetting a Mac for an Out of the Box experience</title>
	<link>http://www.theconsultant.net/archives/2005/10/03/macintouch-updating-then-resetting-a-mac-for-an-out-of-the-box-experience/</link>
	<description>Simplicity is complicated.</description>
	<pubDate>Fri,  8 Aug 2008 18:33:27 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>

	<item>
		<title>By: StyleMac.com</title>
		<link>http://www.theconsultant.net/archives/2005/10/03/macintouch-updating-then-resetting-a-mac-for-an-out-of-the-box-experience/#comment-1778</link>
		<author>StyleMac.com</author>
		<pubDate>Thu, 15 Dec 2005 06:52:46 +0000</pubDate>
		<guid>http://www.theconsultant.net/archives/2005/10/03/macintouch-updating-then-resetting-a-mac-for-an-out-of-the-box-experience/#comment-1778</guid>
		<description>&lt;strong&gt;Reset your Mac&#8217;s Out-of-the-box experience&lt;/strong&gt;

	This is an awesome tip. I should have known about this some months ago when I sold my iBook. Theconsultant.net explains how to reset your Mac so it starts with the Out-Of-The-Box experience again, that is Intro-Movie, Account setup, Network-Setup, etc...</description>
		<content:encoded><![CDATA[<p><strong>Reset your Mac&#8217;s Out-of-the-box experience</strong></p>
<p>	This is an awesome tip. I should have known about this some months ago when I sold my iBook. Theconsultant.net explains how to reset your Mac so it starts with the Out-Of-The-Box experience again, that is Intro-Movie, Account setup, Network-Setup, etc&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JazzDude</title>
		<link>http://www.theconsultant.net/archives/2005/10/03/macintouch-updating-then-resetting-a-mac-for-an-out-of-the-box-experience/#comment-1765</link>
		<author>JazzDude</author>
		<pubDate>Sun, 16 Oct 2005 11:50:55 +0000</pubDate>
		<guid>http://www.theconsultant.net/archives/2005/10/03/macintouch-updating-then-resetting-a-mac-for-an-out-of-the-box-experience/#comment-1765</guid>
		<description>I tried the script on a machine running Panther. Doesn't work, gives me an error when trying to delete the 501 user. .AppleSetupDone file isn't deleted either. Does this run only on Tiger?</description>
		<content:encoded><![CDATA[<p>I tried the script on a machine running Panther. Doesn&#8217;t work, gives me an error when trying to delete the 501 user. .AppleSetupDone file isn&#8217;t deleted either. Does this run only on Tiger?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lolopb</title>
		<link>http://www.theconsultant.net/archives/2005/10/03/macintouch-updating-then-resetting-a-mac-for-an-out-of-the-box-experience/#comment-1763</link>
		<author>lolopb</author>
		<pubDate>Wed, 05 Oct 2005 16:44:59 +0000</pubDate>
		<guid>http://www.theconsultant.net/archives/2005/10/03/macintouch-updating-then-resetting-a-mac-for-an-out-of-the-box-experience/#comment-1763</guid>
		<description>My mistake, I forgot to check if the user is called admin. In this case, we should not delete the admin group but just removing the user from the group.

The linked zip file is correct now, here is the code :

#!/bin/sh

#########
# This script will erase user with UID 501, the first created
# It also removes the associated group and removes the user
# from system groups.
# Finally, it removes the file indicating the Setup Assistand was done so
# it's relaunched at next boot.
#########

#########
#
# Laurent Pertois, Massy, le 5 octobre 2005
#
#########


NIDB_FILE="/var/db/netinfo/local.nidb"
PASSWORD_FILES="/var/db/shadow/hash"
USER_SHORT_NAME="`/usr/bin/nicl -raw "${NIDB_FILE}" -search /users 0 1 uid 501 &#124; /usr/bin/grep -w "name:" &#124; /usr/bin/awk '{print $2}'`"
USER_GENERATEDUID="`/usr/bin/nicl -raw "${NIDB_FILE}" -read /users/${USER_SHORT_NAME} generateduid &#124; /usr/bin/awk '{print $2}'`"
USER_HOME="/Users/${USER_SHORT_NAME}"
APPLE_ASSISTANT="/var/db/.AppleSetupDone"

if [ ! -e "${NIDB_FILE}" ]; then
  echo "There is no NetInfo Database !" ;exit
fi
	
	
echo "  Deleting user '${USER_SHORT_NAME}' !" 2&#62;&#38;1

echo "  Deleting user '${PASSWORD_FILES}/${USER_GENERATEDUID}' !" 2&#62;&#38;1 /bin/rm "$PASSWORD_FILES/$USER_GENERATEDUID" "$PASSWORD_FILES/$USER_GENERATEDUID.state"

echo "  Deleting user '${USER_SHORT_NAME}' from NetInfo/users !" 2&#62;&#38;1 /usr/bin/nicl -raw "${NIDB_FILE}" -delete /users/$USER_SHORT_NAME

echo "  Deleting group '${USER_SHORT_NAME}' from NetInfo/groups !" 2&#62;&#38;1
	if [ "${USER_SHORT_NAME}" = admin ]; then
		echo " admin is a system group, we can't delete it, we will remove the user at next step" 2&#62;&#38;1;
	else
		/usr/bin/nicl -raw "${NIDB_FILE}" -delete /groups/$USER_SHORT_NAME;
	fi

echo "  Removing user '${USER_SHORT_NAME}' from NetInfo/groups/admin !" 2&#62;&#38;1 /usr/bin/nicl -raw "${NIDB_FILE}" -delete /groups/admin users $USER_SHORT_NAME

echo "  Removing user '${USER_SHORT_NAME}' from NetInfo/groups/appserveradm !" 2&#62;&#38;1 /usr/bin/nicl -raw "${NIDB_FILE}" -delete /groups/appserveradm users $USER_SHORT_NAME

echo "  Removing user '${USER_SHORT_NAME}' from NetInfo/groups/appserverusr !" 2&#62;&#38;1 /usr/bin/nicl -raw "${NIDB_FILE}" -delete /groups/appserverusr users $USER_SHORT_NAME

echo "  Deleting '${USER_HOME}' !" 2&#62;&#38;1 /bin/rm -r "${USER_HOME}"

echo "  Deleting '${APPLE_ASSISTANT}' !" 2&#62;&#38;1 /bin/rm "${APPLE_ASSISTANT}"

---------------------

Beware of line cut !</description>
		<content:encoded><![CDATA[<p>My mistake, I forgot to check if the user is called admin. In this case, we should not delete the admin group but just removing the user from the group.</p>
<p>The linked zip file is correct now, here is the code :</p>
<p>#!/bin/sh</p>
<p>#########<br />
# This script will erase user with UID 501, the first created<br />
# It also removes the associated group and removes the user<br />
# from system groups.<br />
# Finally, it removes the file indicating the Setup Assistand was done so<br />
# it&#8217;s relaunched at next boot.<br />
#########</p>
<p>#########<br />
#<br />
# Laurent Pertois, Massy, le 5 octobre 2005<br />
#<br />
#########</p>
<p>NIDB_FILE=&#8221;/var/db/netinfo/local.nidb&#8221;<br />
PASSWORD_FILES=&#8221;/var/db/shadow/hash&#8221;<br />
USER_SHORT_NAME=&#8221;`/usr/bin/nicl -raw &#8220;${NIDB_FILE}&#8221; -search /users 0 1 uid 501 | /usr/bin/grep -w &#8220;name:&#8221; | /usr/bin/awk &#8216;{print $2}&#8217;`&#8221;<br />
USER_GENERATEDUID=&#8221;`/usr/bin/nicl -raw &#8220;${NIDB_FILE}&#8221; -read /users/${USER_SHORT_NAME} generateduid | /usr/bin/awk &#8216;{print $2}&#8217;`&#8221;<br />
USER_HOME=&#8221;/Users/${USER_SHORT_NAME}&#8221;<br />
APPLE_ASSISTANT=&#8221;/var/db/.AppleSetupDone&#8221;</p>
<p>if [ ! -e &#8220;${NIDB_FILE}&#8221; ]; then<br />
  echo &#8220;There is no NetInfo Database !&#8221; ;exit<br />
fi</p>
<p>echo &#8221;  Deleting user &#8216;${USER_SHORT_NAME}&#8217; !&#8221; 2&gt;&amp;1</p>
<p>echo &#8221;  Deleting user &#8216;${PASSWORD_FILES}/${USER_GENERATEDUID}&#8217; !&#8221; 2&gt;&amp;1 /bin/rm &#8220;$PASSWORD_FILES/$USER_GENERATEDUID&#8221; &#8220;$PASSWORD_FILES/$USER_GENERATEDUID.state&#8221;</p>
<p>echo &#8221;  Deleting user &#8216;${USER_SHORT_NAME}&#8217; from NetInfo/users !&#8221; 2&gt;&amp;1 /usr/bin/nicl -raw &#8220;${NIDB_FILE}&#8221; -delete /users/$USER_SHORT_NAME</p>
<p>echo &#8221;  Deleting group &#8216;${USER_SHORT_NAME}&#8217; from NetInfo/groups !&#8221; 2&gt;&amp;1<br />
	if [ &#8220;${USER_SHORT_NAME}&#8221; = admin ]; then<br />
		echo &#8221; admin is a system group, we can&#8217;t delete it, we will remove the user at next step&#8221; 2&gt;&amp;1;<br />
	else<br />
		/usr/bin/nicl -raw &#8220;${NIDB_FILE}&#8221; -delete /groups/$USER_SHORT_NAME;<br />
	fi</p>
<p>echo &#8221;  Removing user &#8216;${USER_SHORT_NAME}&#8217; from NetInfo/groups/admin !&#8221; 2&gt;&amp;1 /usr/bin/nicl -raw &#8220;${NIDB_FILE}&#8221; -delete /groups/admin users $USER_SHORT_NAME</p>
<p>echo &#8221;  Removing user &#8216;${USER_SHORT_NAME}&#8217; from NetInfo/groups/appserveradm !&#8221; 2&gt;&amp;1 /usr/bin/nicl -raw &#8220;${NIDB_FILE}&#8221; -delete /groups/appserveradm users $USER_SHORT_NAME</p>
<p>echo &#8221;  Removing user &#8216;${USER_SHORT_NAME}&#8217; from NetInfo/groups/appserverusr !&#8221; 2&gt;&amp;1 /usr/bin/nicl -raw &#8220;${NIDB_FILE}&#8221; -delete /groups/appserverusr users $USER_SHORT_NAME</p>
<p>echo &#8221;  Deleting &#8216;${USER_HOME}&#8217; !&#8221; 2&gt;&amp;1 /bin/rm -r &#8220;${USER_HOME}&#8221;</p>
<p>echo &#8221;  Deleting &#8216;${APPLE_ASSISTANT}&#8217; !&#8221; 2&gt;&amp;1 /bin/rm &#8220;${APPLE_ASSISTANT}&#8221;</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Beware of line cut !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dAVE</title>
		<link>http://www.theconsultant.net/archives/2005/10/03/macintouch-updating-then-resetting-a-mac-for-an-out-of-the-box-experience/#comment-1762</link>
		<author>dAVE</author>
		<pubDate>Tue, 04 Oct 2005 15:44:54 +0000</pubDate>
		<guid>http://www.theconsultant.net/archives/2005/10/03/macintouch-updating-then-resetting-a-mac-for-an-out-of-the-box-experience/#comment-1762</guid>
		<description>Tweaks and additions to this can be found here: &lt;a href="http://www.macintouch.com/tiger32.html"&gt;macintouch.com&lt;/a&gt; and here &lt;a href="http://www.tuaw.com/2005/10/04/get-the-out-of-the-box-experience-with-an-older-mac/#comments"&gt;tuaw.com&lt;/a&gt;.

Included are details on wiping the netinfo database to remove users created during the setup.

Dave

</description>
		<content:encoded><![CDATA[<p>Tweaks and additions to this can be found here: <a href="http://www.macintouch.com/tiger32.html">macintouch.com</a> and here <a href="http://www.tuaw.com/2005/10/04/get-the-out-of-the-box-experience-with-an-older-mac/#comments">tuaw.com</a>.</p>
<p>Included are details on wiping the netinfo database to remove users created during the setup.</p>
<p>Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lolopb</title>
		<link>http://www.theconsultant.net/archives/2005/10/03/macintouch-updating-then-resetting-a-mac-for-an-out-of-the-box-experience/#comment-1761</link>
		<author>lolopb</author>
		<pubDate>Tue, 04 Oct 2005 13:06:59 +0000</pubDate>
		<guid>http://www.theconsultant.net/archives/2005/10/03/macintouch-updating-then-resetting-a-mac-for-an-out-of-the-box-experience/#comment-1761</guid>
		<description>Oups the URL has gone :

http://lpertois.free.fr/mosx_scripts/del_user_ni_en.sh.zip

</description>
		<content:encoded><![CDATA[<p>Oups the URL has gone :</p>
<p><a href="http://lpertois.free.fr/mosx_scripts/del_user_ni_en.sh.zip" rel="nofollow">http://lpertois.free.fr/mosx_scripts/del_user_ni_en.sh.zip</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lolopb</title>
		<link>http://www.theconsultant.net/archives/2005/10/03/macintouch-updating-then-resetting-a-mac-for-an-out-of-the-box-experience/#comment-1760</link>
		<author>lolopb</author>
		<pubDate>Tue, 04 Oct 2005 08:37:21 +0000</pubDate>
		<guid>http://www.theconsultant.net/archives/2005/10/03/macintouch-updating-then-resetting-a-mac-for-an-out-of-the-box-experience/#comment-1760</guid>
		<description>Well, that method doesn't erase the first user, its group and all groups he's integrated in.

I have a shell script that does it so I can have a perfectly out-of-the box experience (ie the user created by the assistant has UID 501 and so on...). You just need to start in Single-User Mode, fsck, mount the boot volume as readable then execute the script and, finally, remove the script.

Put the script at volume root (so you won't search it when in SU mode) and make it executable (chmod +x /path/to/the/script.

Here is the script :

==============================

#!/bin/sh

#########
# This script will erase user with UID 501, the first created
# It also removes the associated group and removes the user
# from system groups.
# Finally, it removes the file indicating the Setup Assistand was done so
# it's relaunched at next boot.
#########

#########
#
# Laurent Pertois, Massy, le 13 juillet 2005
#
#########


NIDB_FILE="/var/db/netinfo/local.nidb"
PASSWORD_FILES="/var/db/shadow/hash"
USER_SHORT_NAME="`/usr/bin/nicl -raw "${NIDB_FILE}" -search /users 0 1 uid 501 &#124; /usr/bin/grep -w "name:" &#124; /usr/bin/awk '{print $2}'`"
USER_GENERATEDUID="`/usr/bin/nicl -raw "${NIDB_FILE}" -read /users/${USER_SHORT_NAME} generateduid &#124; /usr/bin/awk '{print $2}'`"
USER_HOME="/Users/${USER_SHORT_NAME}"
APPLE_ASSISTANT="/var/db/.AppleSetupDone"

if [ ! -e "${NIDB_FILE}" ]; then
  echo "Il n'y a pas de base NetInfo !" ;exit
fi
	
	
echo "  Deleting user '${USER_SHORT_NAME}' !" 2&#62;&#38;1

echo "  Deleting user '${PASSWORD_FILES}/${USER_GENERATEDUID}' !" 2&#62;&#38;1	
/bin/rm "$PASSWORD_FILES/$USER_GENERATEDUID" "$PASSWORD_FILES/$USER_GENERATEDUID.state"

echo "  Deleting user '${USER_SHORT_NAME}' from NetInfo/users !" 2&#62;&#38;1
/usr/bin/nicl -raw "${NIDB_FILE}" -delete /users/$USER_SHORT_NAME

echo "  Deleting group '${USER_SHORT_NAME}' from NetInfo/groups !" 2&#62;&#38;1
/usr/bin/nicl -raw "${NIDB_FILE}" -delete /groups/$USER_SHORT_NAME

echo "  Removing user '${USER_SHORT_NAME}' from NetInfo/groups/admin !" 2&#62;&#38;1
/usr/bin/nicl -raw "${NIDB_FILE}" -delete /groups/admin users $USER_SHORT_NAME

echo "  Removing user '${USER_SHORT_NAME}' from NetInfo/groups/appserveradm !" 2&#62;&#38;1
/usr/bin/nicl -raw "${NIDB_FILE}" -delete /groups/appserveradm users $USER_SHORT_NAME

echo "  Removing user '${USER_SHORT_NAME}' from NetInfo/groups/appserverusr !" 2&#62;&#38;1
/usr/bin/nicl -raw "${NIDB_FILE}" -delete /groups/appserverusr users $USER_SHORT_NAME

echo "  Deleting '${USER_HOME}' !" 2&#62;&#38;1
/bin/rm -r "${USER_HOME}"

echo "  Deleting '${APPLE_ASSISTANT}' !" 2&#62;&#38;1
/bin/rm "${APPLE_ASSISTANT}"

==================================

Beware of line cuts, I have a downloadable version here :



Feel free to improve but don't forget to tell me :

legends AT free DOT fr
</description>
		<content:encoded><![CDATA[<p>Well, that method doesn&#8217;t erase the first user, its group and all groups he&#8217;s integrated in.</p>
<p>I have a shell script that does it so I can have a perfectly out-of-the box experience (ie the user created by the assistant has UID 501 and so on&#8230;). You just need to start in Single-User Mode, fsck, mount the boot volume as readable then execute the script and, finally, remove the script.</p>
<p>Put the script at volume root (so you won&#8217;t search it when in SU mode) and make it executable (chmod +x /path/to/the/script.</p>
<p>Here is the script :</p>
<p>==============================</p>
<p>#!/bin/sh</p>
<p>#########<br />
# This script will erase user with UID 501, the first created<br />
# It also removes the associated group and removes the user<br />
# from system groups.<br />
# Finally, it removes the file indicating the Setup Assistand was done so<br />
# it&#8217;s relaunched at next boot.<br />
#########</p>
<p>#########<br />
#<br />
# Laurent Pertois, Massy, le 13 juillet 2005<br />
#<br />
#########</p>
<p>NIDB_FILE=&#8221;/var/db/netinfo/local.nidb&#8221;<br />
PASSWORD_FILES=&#8221;/var/db/shadow/hash&#8221;<br />
USER_SHORT_NAME=&#8221;`/usr/bin/nicl -raw &#8220;${NIDB_FILE}&#8221; -search /users 0 1 uid 501 | /usr/bin/grep -w &#8220;name:&#8221; | /usr/bin/awk &#8216;{print $2}&#8217;`&#8221;<br />
USER_GENERATEDUID=&#8221;`/usr/bin/nicl -raw &#8220;${NIDB_FILE}&#8221; -read /users/${USER_SHORT_NAME} generateduid | /usr/bin/awk &#8216;{print $2}&#8217;`&#8221;<br />
USER_HOME=&#8221;/Users/${USER_SHORT_NAME}&#8221;<br />
APPLE_ASSISTANT=&#8221;/var/db/.AppleSetupDone&#8221;</p>
<p>if [ ! -e &#8220;${NIDB_FILE}&#8221; ]; then<br />
  echo &#8220;Il n&#8217;y a pas de base NetInfo !&#8221; ;exit<br />
fi</p>
<p>echo &#8221;  Deleting user &#8216;${USER_SHORT_NAME}&#8217; !&#8221; 2&gt;&amp;1</p>
<p>echo &#8221;  Deleting user &#8216;${PASSWORD_FILES}/${USER_GENERATEDUID}&#8217; !&#8221; 2&gt;&amp;1<br />
/bin/rm &#8220;$PASSWORD_FILES/$USER_GENERATEDUID&#8221; &#8220;$PASSWORD_FILES/$USER_GENERATEDUID.state&#8221;</p>
<p>echo &#8221;  Deleting user &#8216;${USER_SHORT_NAME}&#8217; from NetInfo/users !&#8221; 2&gt;&amp;1<br />
/usr/bin/nicl -raw &#8220;${NIDB_FILE}&#8221; -delete /users/$USER_SHORT_NAME</p>
<p>echo &#8221;  Deleting group &#8216;${USER_SHORT_NAME}&#8217; from NetInfo/groups !&#8221; 2&gt;&amp;1<br />
/usr/bin/nicl -raw &#8220;${NIDB_FILE}&#8221; -delete /groups/$USER_SHORT_NAME</p>
<p>echo &#8221;  Removing user &#8216;${USER_SHORT_NAME}&#8217; from NetInfo/groups/admin !&#8221; 2&gt;&amp;1<br />
/usr/bin/nicl -raw &#8220;${NIDB_FILE}&#8221; -delete /groups/admin users $USER_SHORT_NAME</p>
<p>echo &#8221;  Removing user &#8216;${USER_SHORT_NAME}&#8217; from NetInfo/groups/appserveradm !&#8221; 2&gt;&amp;1<br />
/usr/bin/nicl -raw &#8220;${NIDB_FILE}&#8221; -delete /groups/appserveradm users $USER_SHORT_NAME</p>
<p>echo &#8221;  Removing user &#8216;${USER_SHORT_NAME}&#8217; from NetInfo/groups/appserverusr !&#8221; 2&gt;&amp;1<br />
/usr/bin/nicl -raw &#8220;${NIDB_FILE}&#8221; -delete /groups/appserverusr users $USER_SHORT_NAME</p>
<p>echo &#8221;  Deleting &#8216;${USER_HOME}&#8217; !&#8221; 2&gt;&amp;1<br />
/bin/rm -r &#8220;${USER_HOME}&#8221;</p>
<p>echo &#8221;  Deleting &#8216;${APPLE_ASSISTANT}&#8217; !&#8221; 2&gt;&amp;1<br />
/bin/rm &#8220;${APPLE_ASSISTANT}&#8221;</p>
<p>==================================</p>
<p>Beware of line cuts, I have a downloadable version here :</p>
<p>Feel free to improve but don&#8217;t forget to tell me :</p>
<p>legends AT free DOT fr</p>
]]></content:encoded>
	</item>
</channel>
</rss>
