<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Mac Admin Corner</title>
	
	<link>http://blog.macadmincorner.com</link>
	<description>General IT and Mac administration ramblings</description>
	<lastBuildDate>Sat, 10 Apr 2010 01:07:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/MacAdminCorner" /><feedburner:info uri="macadmincorner" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>34.228478</geo:lat><geo:long>-84.504025</geo:long><feedburner:emailServiceId>MacAdminCorner</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Updated: Send softwareupdate command through ARD</title>
		<link>http://feedproxy.google.com/~r/MacAdminCorner/~3/oFV46ybkvtw/</link>
		<comments>http://blog.macadmincorner.com/send-softwareupdate-command-through-ard/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 13:00:51 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Automation]]></category>
		<category><![CDATA[Desktop Management]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Apple Remote Desktop]]></category>
		<category><![CDATA[Patching]]></category>

		<guid isPermaLink="false">http://blog.macadmincorner.com/?p=411</guid>
		<description><![CDATA[This script will run software updates only on machines that are logged out. This ensures you don&#8217;t reboot machines that are in use and don&#8217;t leave machines in an inconsistent state (by not rebooting after patching). This is not a perfect solution to patching but it&#8217;s better than nothing. You can even schedule this to [...]]]></description>
			<content:encoded><![CDATA[<p>This script will run software updates only on machines that are logged out. This ensures you don&#8217;t reboot machines that are in use and don&#8217;t leave machines in an inconsistent state (by not rebooting after patching). This is not a perfect solution to patching but it&#8217;s better than nothing. You can even schedule this to run on a recurring basis.</p>
<p><strong>Update: </strong>Added sleep command with random wait. This will help alleviate some load on your SUS and perhaps prevent a DOS attack. Thanks to <a href="http://twitter.com/rsaeks" target="_blank">rsaeks</a> via Twitter.</p>
<p>Copy and paste the following into an Apple Remote Desktop (ARD) &#8220;Send Unix Command&#8221; window and send as root:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;</span>pre <span style="color: #007800;">lang</span>=<span style="color: #ff0000;">&quot;bash&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #666666; font-style: italic;"># Random number of seconds to wait</span>
<span style="color: #666666; font-style: italic;"># The more machines you use this with, the higher the number should be</span>
<span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">expr</span> <span style="color: #007800;">$RANDOM</span> <span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000;">120</span><span style="color: #000000; font-weight: bold;">`</span></pre></div></div>

<p>if who | grep console; then</p>
<p>echo Machine is in use</p>
<p>exit 1</p>
<p>fi<br />
COMMAND_LINE_INSTALL=1 softwareupdate -i -a</p>
<p>shutdown -r now</p>
<p>exit 0</pre>

<p><a href="http://feedads.g.doubleclick.net/~a/HxcipGNtCcKEkeV7-YQfPRrRGY8/0/da"><img src="http://feedads.g.doubleclick.net/~a/HxcipGNtCcKEkeV7-YQfPRrRGY8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/HxcipGNtCcKEkeV7-YQfPRrRGY8/1/da"><img src="http://feedads.g.doubleclick.net/~a/HxcipGNtCcKEkeV7-YQfPRrRGY8/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=oFV46ybkvtw:xGz1TCYPVVk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=oFV46ybkvtw:xGz1TCYPVVk:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?i=oFV46ybkvtw:xGz1TCYPVVk:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=oFV46ybkvtw:xGz1TCYPVVk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?i=oFV46ybkvtw:xGz1TCYPVVk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=oFV46ybkvtw:xGz1TCYPVVk:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/MacAdminCorner/~4/oFV46ybkvtw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.macadmincorner.com/send-softwareupdate-command-through-ard/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.macadmincorner.com/send-softwareupdate-command-through-ard/</feedburner:origLink></item>
		<item>
		<title>Script to Configure the Mac OS X firewall</title>
		<link>http://feedproxy.google.com/~r/MacAdminCorner/~3/YPqGV9fpw4E/</link>
		<comments>http://blog.macadmincorner.com/configure-the-mac-os-x-firewall-with-a-script/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 13:54:39 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Absolute Manage]]></category>
		<category><![CDATA[Automation]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Apple Remote Desktop]]></category>
		<category><![CDATA[Desktop Management]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blog.macadmincorner.com/?p=384</guid>
		<description><![CDATA[Here is a script that can be deployed via ARD, Absolute Manage (LANrev), LANDesk or virtually any other method to enable and configure the firewall for 10.4, 10.5 or 10.6. You will need to decide how exactly you want your clients firewalls configured. Pay special attention to the stealth setting. If this is enabled, you [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a script that can be deployed via ARD, Absolute Manage (LANrev), LANDesk or virtually any other method to enable and configure the firewall for 10.4, 10.5 or 10.6. You will need to decide how exactly you want your clients firewalls configured. Pay special attention to the stealth setting. If this is enabled, you will not be able to ping that system which will make discovery difficult if they are on a different subnet than your admin system.</p>
<p style="text-align: center;"><a href="http://blog.macadmincorner.com/wp-content/uploads/2010/01/firewall.png"><img class="aligncenter size-full wp-image-386" title="Firewall" src="http://blog.macadmincorner.com/wp-content/uploads/2010/01/firewall.png" alt="" width="234" height="178" /></a><br />
<span id="more-384"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #666666; font-style: italic;"># enable_firewall.sh</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Patrick Gallagher</span>
<span style="color: #666666; font-style: italic;"># http://macadmincorner.com</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Stealth Mode - Set to 0 to disable</span>
<span style="color: #666666; font-style: italic;"># Stealth mode prevents machine from responding to ping requestst</span>
<span style="color: #666666; font-style: italic;"># Be aware that this would prevent tools such as ARD from discovering</span>
<span style="color: #666666; font-style: italic;"># the machine, though bonjour on the same subnet will still work</span>
&nbsp;
<span style="color: #007800;">osversionlong</span>=<span style="color: #000000; font-weight: bold;">`</span>sw_vers -productVersion<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">osvers</span>=<span style="color: #800000;">${osversionlong:3:1}</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Check if this is being run by root</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$(whoami)</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;root&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> ; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Must be root to run this command.&quot;</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000;">2</span>
  <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Enable firewall for Tiger</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$osvers</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">4</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Setting firewall on a <span style="color: #007800;">${osversionlong}</span> machine&quot;</span>
	<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>defaults <span style="color: #c20cb9; font-weight: bold;">write</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Preferences<span style="color: #000000; font-weight: bold;">/</span>com.apple.sharing.firewall state <span style="color: #660033;">-bool</span> YES
	<span style="color: #666666; font-style: italic;"># UDP, change to 0 to disable</span>
	<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>defaults <span style="color: #c20cb9; font-weight: bold;">write</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Preferences<span style="color: #000000; font-weight: bold;">/</span>com.apple.sharing.firewall udpenabled  <span style="color: #660033;">-int</span> <span style="color: #000000;">1</span>
	<span style="color: #666666; font-style: italic;"># Stealth, change to 0 to disable</span>
	<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>defaults <span style="color: #c20cb9; font-weight: bold;">write</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Preferences<span style="color: #000000; font-weight: bold;">/</span>com.apple.sharing.firewall stealthenabled <span style="color: #660033;">-int</span> <span style="color: #000000;">1</span>
	<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>libexec<span style="color: #000000; font-weight: bold;">/</span>FirewallTool
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Enable firewall for Leopard or Snow Leopard</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$osvers</span> <span style="color: #660033;">-ge</span> <span style="color: #000000;">5</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Setting firewall on a <span style="color: #007800;">${osversionlong}</span> machine&quot;</span>
	<span style="color: #666666; font-style: italic;"># Globalstate - Set to 0 for off, 1 for on, 2 for &quot;Block all incoming access&quot;</span>
	<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>defaults <span style="color: #c20cb9; font-weight: bold;">write</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Preferences<span style="color: #000000; font-weight: bold;">/</span>com.apple.alf globalstate <span style="color: #660033;">-int</span> <span style="color: #000000;">1</span>
	<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>defaults <span style="color: #c20cb9; font-weight: bold;">write</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Preferences<span style="color: #000000; font-weight: bold;">/</span>com.apple.alf stealthenabled <span style="color: #660033;">-int</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>


<p><a href="http://feedads.g.doubleclick.net/~a/fycmFXVAUB91WqFW-Avb2qAJf40/0/da"><img src="http://feedads.g.doubleclick.net/~a/fycmFXVAUB91WqFW-Avb2qAJf40/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/fycmFXVAUB91WqFW-Avb2qAJf40/1/da"><img src="http://feedads.g.doubleclick.net/~a/fycmFXVAUB91WqFW-Avb2qAJf40/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=YPqGV9fpw4E:sf4cuhZUfjw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=YPqGV9fpw4E:sf4cuhZUfjw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?i=YPqGV9fpw4E:sf4cuhZUfjw:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=YPqGV9fpw4E:sf4cuhZUfjw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?i=YPqGV9fpw4E:sf4cuhZUfjw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=YPqGV9fpw4E:sf4cuhZUfjw:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/MacAdminCorner/~4/YPqGV9fpw4E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.macadmincorner.com/configure-the-mac-os-x-firewall-with-a-script/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.macadmincorner.com/configure-the-mac-os-x-firewall-with-a-script/</feedburner:origLink></item>
		<item>
		<title>Bind to OD Script &amp; Add to Computer Group</title>
		<link>http://feedproxy.google.com/~r/MacAdminCorner/~3/OiTR0mlrGow/</link>
		<comments>http://blog.macadmincorner.com/bind-to-od-script-add-to-computer-group/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 00:36:01 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[AD Integration]]></category>
		<category><![CDATA[Absolute Manage]]></category>
		<category><![CDATA[Directory Services]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Open Directory]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Apple Remote Desktop]]></category>

		<guid isPermaLink="false">http://blog.macadmincorner.com/?p=403</guid>
		<description><![CDATA[The following script is what I use to bind machines to Open Directory and it solves the following challenges:

If bound to another OD domain, it removes that binding. If you&#8217;re not moving from another domain, you can ignore that part, it won&#8217;t hurt that it&#8217;s in there.
Adds the computer record to OD. Normally with anonymous [...]]]></description>
			<content:encoded><![CDATA[<p>The following script is what I use to bind machines to Open Directory and it solves the following challenges:</p>
<ol>
<li>If bound to another OD domain, it removes that binding. If you&#8217;re not moving from another domain, you can ignore that part, it won&#8217;t hurt that it&#8217;s in there.<span id="more-403"></span></li>
<li>Adds the computer record to OD. Normally with anonymous binds you have to manually add the computer account. This takes care of that by authenticating as a diradmin. Because of this, keep this script in a safe place.</li>
<li>Fixes the search order if the machine is also bound to AD in a golden triangle (or magic triangle) so that Tiger machines use AD first and Leopard/Snow Leopard machines look to OD first.</li>
<li>Bind machine(s) remotely with tools such as Apple Remote Desktop (ARD), Absolute Manage (LANrev) or LANDesk.</li>
</ol>
<p>Please be aware this script might not work in all environments. Try to understand how the script works and be prepared to modify for your environment. One issue I frequently find with any type of binding script (OD or AD) is the timing never seems to be perfect. By that I mean that the script runs faster than the directoryservice process can recognize the changes. I try to account for this by putting in &#8220;sleep xx&#8221; commands in certain places but you may need to play around with this a bit.</p>
<p>What I try to do is follow up the script with a simple &#8220;defaults read /Library/Preferences/DirectoryService/SearchNodeConfig &#8220;Search Node Custom Path Array&#8221; to ensure both OD and AD are in there. If they&#8217;re not, I just run the bind script again and it usually gets it the 2nd time.</p>
<p>To download the script, click <a href="http://macadmincorner.com/files/Bind_to_OD.sh.zip">here</a>.</p>
<p>Or copy/paste:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Patrick Gallagher</span>
<span style="color: #666666; font-style: italic;"># http://www.macadmincorner.com</span>
<span style="color: #666666; font-style: italic;"># Updated 12/11/2009</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># These variables need to be configured for your env</span>
<span style="color: #007800;">odAdmin</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #666666; font-style: italic;">#enter your OD admin name between the quotes</span>
<span style="color: #007800;">odPassword</span>=<span style="color: #ff0000;">&quot;&quot;</span>  <span style="color: #666666; font-style: italic;"># Enter your OD admin password between the quotes</span>
<span style="color: #007800;">domain</span>=<span style="color: #ff0000;">&quot;od.school.edu&quot;</span> <span style="color: #666666; font-style: italic;"># FQDN of your OD domain</span>
<span style="color: #007800;">oldDomain</span>=<span style="color: #ff0000;">&quot;oldod.school.edu&quot;</span> <span style="color: #666666; font-style: italic;"># If moving from another OD, enter that FQDN here</span>
<span style="color: #007800;">oldODip</span>=<span style="color: #ff0000;">&quot;111.222.333.444&quot;</span> <span style="color: #666666; font-style: italic;"># Enter the IP of your old OD</span>
<span style="color: #007800;">ADdomain</span>=<span style="color: #ff0000;">&quot;ad.school.edu&quot;</span> <span style="color: #666666; font-style: italic;"># Enter your AD domain here</span>
<span style="color: #007800;">computerGroup</span>=computers  <span style="color: #666666; font-style: italic;"># Add appropriate computer group you want machines to be added to, case sensitive </span>
&nbsp;
<span style="color: #666666; font-style: italic;"># These variables probably don't need to be changed</span>
<span style="color: #007800;">computerName</span>=<span style="color: #000000; font-weight: bold;">`/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>scutil <span style="color: #660033;">--get</span> LocalHostName<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">nicAddress</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ifconfig</span> en0 <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> ether <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $2}'</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">check4OD</span>=<span style="color: #000000; font-weight: bold;">`</span>dscl localhost <span style="color: #660033;">-list</span> <span style="color: #000000; font-weight: bold;">/</span>LDAPv3<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">check4ODacct</span>=<span style="color: #000000; font-weight: bold;">`</span>dscl <span style="color: #000000; font-weight: bold;">/</span>LDAPv3<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${domain}</span> <span style="color: #660033;">-read</span> Computers<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${computerName}</span> RealName <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-c</span> <span style="color: #000000;">11</span>-<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">check4AD</span>=<span style="color: #000000; font-weight: bold;">`</span>dscl localhost <span style="color: #660033;">-list</span> <span style="color: #000000; font-weight: bold;">/</span>Active\ Directory<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">osversionlong</span>=<span style="color: #000000; font-weight: bold;">`</span>sw_vers -productVersion<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">osvers</span>=<span style="color: #800000;">${osversionlong:3:1}</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Check if on OD already</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${check4OD}</span>&quot;</span> == <span style="color: #ff0000;">&quot;<span style="color: #007800;">${domain}</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;This machine is joined to <span style="color: #007800;">${domain}</span> already.&quot;</span>
	<span style="color: #007800;">odSearchPath</span>=<span style="color: #000000; font-weight: bold;">`</span>defaults <span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Preferences<span style="color: #000000; font-weight: bold;">/</span>DirectoryService<span style="color: #000000; font-weight: bold;">/</span>SearchNodeConfig <span style="color: #ff0000;">&quot;Search Node Custom Path Array&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #007800;">$domain</span><span style="color: #000000; font-weight: bold;">`</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${odSearchPath}</span>&quot;</span> = <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$domain</span> not found in search path. Adding...&quot;</span>
		dscl <span style="color: #000000; font-weight: bold;">/</span>Search <span style="color: #660033;">-append</span> <span style="color: #000000; font-weight: bold;">/</span> CSPSearchPath <span style="color: #000000; font-weight: bold;">/</span>LDAPv3<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$domain</span>
		<span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">10</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${check4OD}</span>&quot;</span> == <span style="color: #ff0000;">&quot;<span style="color: #007800;">${oldDomain}</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Removing from <span style="color: #007800;">${oldDomain}</span>&quot;</span>
	dsconfigldap <span style="color: #660033;">-r</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${oldDomain}</span>&quot;</span>
	dscl <span style="color: #000000; font-weight: bold;">/</span>Search <span style="color: #660033;">-delete</span> <span style="color: #000000; font-weight: bold;">/</span> CSPSearchPath <span style="color: #000000; font-weight: bold;">/</span>LDAPv3<span style="color: #000000; font-weight: bold;">/</span><span style="color: #ff0000;">&quot;<span style="color: #007800;">${oldDomain}</span>&quot;</span>
	dscl <span style="color: #000000; font-weight: bold;">/</span>Search<span style="color: #000000; font-weight: bold;">/</span>Contacts <span style="color: #660033;">-delete</span> <span style="color: #000000; font-weight: bold;">/</span> CSPSearchPath <span style="color: #000000; font-weight: bold;">/</span>LDAPv3<span style="color: #000000; font-weight: bold;">/</span><span style="color: #ff0000;">&quot;<span style="color: #007800;">${oldDomain}</span>&quot;</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Binding to <span style="color: #007800;">$domain</span>&quot;</span>
	dsconfigldap <span style="color: #660033;">-v</span> <span style="color: #660033;">-a</span> <span style="color: #007800;">$domain</span> <span style="color: #660033;">-n</span> <span style="color: #007800;">$domain</span>
	dscl <span style="color: #000000; font-weight: bold;">/</span>Search <span style="color: #660033;">-create</span> <span style="color: #000000; font-weight: bold;">/</span> SearchPolicy CSPSearchPath
	<span style="color: #c20cb9; font-weight: bold;">killall</span> DirectoryService
<span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${check4OD}</span>&quot;</span> == <span style="color: #ff0000;">&quot;<span style="color: #007800;">${oldODip}</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Removing from <span style="color: #007800;">${oldODip}</span>&quot;</span>
		dsconfigldap <span style="color: #660033;">-r</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${oldODip}</span>&quot;</span>
		dscl <span style="color: #000000; font-weight: bold;">/</span>Search <span style="color: #660033;">-delete</span> <span style="color: #000000; font-weight: bold;">/</span> CSPSearchPath <span style="color: #000000; font-weight: bold;">/</span>LDAPv3<span style="color: #000000; font-weight: bold;">/</span><span style="color: #ff0000;">&quot;<span style="color: #007800;">${oldODip}</span>&quot;</span>
		dscl <span style="color: #000000; font-weight: bold;">/</span>Search<span style="color: #000000; font-weight: bold;">/</span>Contacts <span style="color: #660033;">-delete</span> <span style="color: #000000; font-weight: bold;">/</span> CSPSearchPath <span style="color: #000000; font-weight: bold;">/</span>LDAPv3<span style="color: #000000; font-weight: bold;">/</span><span style="color: #ff0000;">&quot;<span style="color: #007800;">${oldODip}</span>&quot;</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Binding to <span style="color: #007800;">$domain</span>&quot;</span>
		dsconfigldap <span style="color: #660033;">-v</span> <span style="color: #660033;">-a</span> <span style="color: #007800;">$domain</span> <span style="color: #660033;">-n</span> <span style="color: #007800;">$domain</span>
		dscl <span style="color: #000000; font-weight: bold;">/</span>Search <span style="color: #660033;">-create</span> <span style="color: #000000; font-weight: bold;">/</span> SearchPolicy CSPSearchPath
		<span style="color: #c20cb9; font-weight: bold;">killall</span> DirectoryService
<span style="color: #000000; font-weight: bold;">else</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;No previous OD servers found, binding to <span style="color: #007800;">$domain</span>&quot;</span>
	dsconfigldap <span style="color: #660033;">-v</span> <span style="color: #660033;">-a</span> <span style="color: #007800;">$domain</span> <span style="color: #660033;">-n</span> <span style="color: #007800;">$domain</span>
	dscl <span style="color: #000000; font-weight: bold;">/</span>Search <span style="color: #660033;">-create</span> <span style="color: #000000; font-weight: bold;">/</span> SearchPolicy CSPSearchPath
	<span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">10</span>
	dscl <span style="color: #000000; font-weight: bold;">/</span>Search <span style="color: #660033;">-append</span> <span style="color: #000000; font-weight: bold;">/</span> CSPSearchPath <span style="color: #000000; font-weight: bold;">/</span>LDAPV3<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$domain</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Killing DirectoryService&quot;</span>
	<span style="color: #c20cb9; font-weight: bold;">killall</span> DirectoryService
	<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${check4ODacct}</span>&quot;</span> == <span style="color: #ff0000;">&quot;<span style="color: #007800;">${computerName}</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;This machine has a computer account on <span style="color: #007800;">${domain}</span> already.&quot;</span>
<span style="color: #000000; font-weight: bold;">else</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Adding computer account to <span style="color: #007800;">${domain}</span>&quot;</span>
	dscl <span style="color: #660033;">-u</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${odAdmin}</span>&quot;</span> <span style="color: #660033;">-P</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${odPassword}</span>&quot;</span> <span style="color: #000000; font-weight: bold;">/</span>LDAPv3<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${domain}</span> <span style="color: #660033;">-create</span> <span style="color: #000000; font-weight: bold;">/</span>Computers<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${computerName}</span> ENetAddress <span style="color: #ff0000;">&quot;<span style="color: #007800;">$nicAddress</span>&quot;</span>
	dscl <span style="color: #660033;">-u</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${odAdmin}</span>&quot;</span> <span style="color: #660033;">-P</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${odPassword}</span>&quot;</span> <span style="color: #000000; font-weight: bold;">/</span>LDAPv3<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${domain}</span> <span style="color: #660033;">-merge</span> <span style="color: #000000; font-weight: bold;">/</span>Computers<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${computerName}</span> RealName <span style="color: #800000;">${computerName}</span>
	<span style="color: #666666; font-style: italic;"># Add computer to ComputerList</span>
	dscl <span style="color: #660033;">-u</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${odAdmin}</span>&quot;</span> <span style="color: #660033;">-P</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${odPassword}</span>&quot;</span> <span style="color: #000000; font-weight: bold;">/</span>LDAPv3<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${domain}</span> <span style="color: #660033;">-merge</span> <span style="color: #000000; font-weight: bold;">/</span>ComputerLists<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${computerGroup}</span> apple-computers <span style="color: #800000;">${computerName}</span>		
&nbsp;
	<span style="color: #666666; font-style: italic;"># Set the GUID</span>
	<span style="color: #007800;">GUID</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$(dscl /LDAPv3/${domain} -read /Computers/${computerName} GeneratedUID | awk '{ print $2 }')</span>&quot;</span>
	<span style="color: #666666; font-style: italic;"># Add to computergroup</span>
	dscl <span style="color: #660033;">-u</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${odAdmin}</span>&quot;</span> <span style="color: #660033;">-P</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${odPassword}</span>&quot;</span> <span style="color: #000000; font-weight: bold;">/</span>LDAPv3<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${domain}</span> <span style="color: #660033;">-merge</span> <span style="color: #000000; font-weight: bold;">/</span>ComputerGroups<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${computerGroup}</span> apple-group-memberguid <span style="color: #ff0000;">&quot;<span style="color: #007800;">${GUID}</span>&quot;</span>
	dscl <span style="color: #660033;">-u</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${odAdmin}</span>&quot;</span> <span style="color: #660033;">-P</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${odPassword}</span>&quot;</span> <span style="color: #000000; font-weight: bold;">/</span>LDAPv3<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${domain}</span> <span style="color: #660033;">-merge</span> <span style="color: #000000; font-weight: bold;">/</span>ComputerGroups<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${computerGroup}</span> memberUid <span style="color: #800000;">${computerName}</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">25</span> <span style="color: #666666; font-style: italic;"># Give DS a chance to catch up</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Fix DS search order</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Checking DS search order...&quot;</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${check4AD}</span>&quot;</span> == <span style="color: #ff0000;">&quot;<span style="color: #007800;">${adDomain}</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	dsconfigad <span style="color: #660033;">-alldomains</span> <span style="color: #7a0874; font-weight: bold;">enable</span>
	dscl <span style="color: #000000; font-weight: bold;">/</span>Search <span style="color: #660033;">-delete</span> <span style="color: #000000; font-weight: bold;">/</span> CSPSearchPath <span style="color: #ff0000;">&quot;/Active Directory/<span style="color: #007800;">${adDomain}</span>&quot;</span>
	dscl <span style="color: #000000; font-weight: bold;">/</span>Search<span style="color: #000000; font-weight: bold;">/</span>Contacts <span style="color: #660033;">-delete</span> <span style="color: #000000; font-weight: bold;">/</span> CSPSearchPath <span style="color: #ff0000;">&quot;/Active Directory/<span style="color: #007800;">${adDomain}</span>&quot;</span>
	dscl <span style="color: #000000; font-weight: bold;">/</span>Search <span style="color: #660033;">-append</span> <span style="color: #000000; font-weight: bold;">/</span> CSPSearchPath <span style="color: #ff0000;">&quot;/Active Directory/All Domains&quot;</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$osvers</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">4</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;OS detected as <span style="color: #007800;">${osversionlong}</span>&quot;</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Setting AD, then OD to search order...&quot;</span>
		dscl localhost changei <span style="color: #000000; font-weight: bold;">/</span>Search CSPSearchPath <span style="color: #000000;">2</span> <span style="color: #ff0000;">&quot;/Active Directory/All Domains&quot;</span>
		dscl localhost changei <span style="color: #000000; font-weight: bold;">/</span>Search CSPSearchPath <span style="color: #000000;">3</span> <span style="color: #000000; font-weight: bold;">/</span>LDAPv3<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$domain</span>
		dscl <span style="color: #000000; font-weight: bold;">/</span>Search<span style="color: #000000; font-weight: bold;">/</span>Contacts <span style="color: #660033;">-append</span> <span style="color: #000000; font-weight: bold;">/</span> CSPSearchPath <span style="color: #ff0000;">&quot;/Active Directory/All Domains&quot;</span>
	<span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #800000;">${osvers}</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">5</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #000000;">6</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;OS detected as <span style="color: #007800;">${osversionlong}</span>&quot;</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Setting OD, then AD to search order...&quot;</span>
		dscl localhost changei <span style="color: #000000; font-weight: bold;">/</span>Search CSPSearchPath <span style="color: #000000;">3</span> <span style="color: #ff0000;">&quot;/Active Directory/All Domains&quot;</span>
		dscl localhost changei <span style="color: #000000; font-weight: bold;">/</span>Search CSPSearchPath <span style="color: #000000;">2</span> <span style="color: #000000; font-weight: bold;">/</span>LDAPv3<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$domain</span>
		dscl <span style="color: #000000; font-weight: bold;">/</span>Search<span style="color: #000000; font-weight: bold;">/</span>Contacts <span style="color: #660033;">-append</span> <span style="color: #000000; font-weight: bold;">/</span> CSPSearchPath <span style="color: #ff0000;">&quot;/Active Directory/All Domains&quot;</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">fi</span>
	<span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${check4AD}</span>&quot;</span> == <span style="color: #ff0000;">&quot;All Domains&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	dscl <span style="color: #000000; font-weight: bold;">/</span>Search <span style="color: #660033;">-append</span> <span style="color: #000000; font-weight: bold;">/</span> CSPSearchPath <span style="color: #ff0000;">&quot;/Active Directory/All Domains&quot;</span>
	<span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">15</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$osvers</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">4</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
			<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;OS detected as <span style="color: #007800;">${osversionlong}</span>&quot;</span>
			<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Setting AD, then OD to search order...&quot;</span>
			dscl localhost changei <span style="color: #000000; font-weight: bold;">/</span>Search CSPSearchPath <span style="color: #000000;">1</span> <span style="color: #ff0000;">&quot;/Active Directory/All Domains&quot;</span>
			dscl localhost changei <span style="color: #000000; font-weight: bold;">/</span>Search CSPSearchPath <span style="color: #000000;">2</span> <span style="color: #000000; font-weight: bold;">/</span>LDAPv3<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$domain</span>
		<span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #800000;">${osvers}</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">5</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #000000;">6</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
			<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;OS detected as <span style="color: #007800;">${osversionlong}</span>&quot;</span>
			<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Setting OD, then AD to search order...&quot;</span>
			dscl localhost changei <span style="color: #000000; font-weight: bold;">/</span>Search CSPSearchPath <span style="color: #000000;">2</span> <span style="color: #000000; font-weight: bold;">/</span>LDAPv3<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$domain</span>
			dscl localhost changei <span style="color: #000000; font-weight: bold;">/</span>Search CSPSearchPath <span style="color: #000000;">3</span> <span style="color: #ff0000;">&quot;/Active Directory/All Domains&quot;</span>
			dscl <span style="color: #000000; font-weight: bold;">/</span>Search<span style="color: #000000; font-weight: bold;">/</span>Contacts <span style="color: #660033;">-append</span> <span style="color: #000000; font-weight: bold;">/</span> CSPSearchPath <span style="color: #ff0000;">&quot;/Active Directory/All Domains&quot;</span>
		<span style="color: #000000; font-weight: bold;">fi</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">fi</span>	
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Finished. Exiting...&quot;</span>
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></div></div>


<p><a href="http://feedads.g.doubleclick.net/~a/MzmmzS4RzXf8jrqOsHyAvo7I8aI/0/da"><img src="http://feedads.g.doubleclick.net/~a/MzmmzS4RzXf8jrqOsHyAvo7I8aI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/MzmmzS4RzXf8jrqOsHyAvo7I8aI/1/da"><img src="http://feedads.g.doubleclick.net/~a/MzmmzS4RzXf8jrqOsHyAvo7I8aI/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=OiTR0mlrGow:QfTa3SLozxI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=OiTR0mlrGow:QfTa3SLozxI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?i=OiTR0mlrGow:QfTa3SLozxI:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=OiTR0mlrGow:QfTa3SLozxI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?i=OiTR0mlrGow:QfTa3SLozxI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=OiTR0mlrGow:QfTa3SLozxI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/MacAdminCorner/~4/OiTR0mlrGow" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.macadmincorner.com/bind-to-od-script-add-to-computer-group/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://blog.macadmincorner.com/bind-to-od-script-add-to-computer-group/</feedburner:origLink></item>
		<item>
		<title>Absolute Manage (LANrev) webinar archive available</title>
		<link>http://feedproxy.google.com/~r/MacAdminCorner/~3/9VjYd1Nkxu4/</link>
		<comments>http://blog.macadmincorner.com/absolute-manage-lanrev-webinar-archive-available/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 01:51:01 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Absolute Manage]]></category>
		<category><![CDATA[Desktop Management]]></category>
		<category><![CDATA[Asset Management]]></category>
		<category><![CDATA[ITIL]]></category>
		<category><![CDATA[webcast]]></category>

		<guid isPermaLink="false">http://blog.macadmincorner.com/absolute-manage-lanrev-webinar-archive-available/</guid>
		<description><![CDATA[Edweek.org did a webinar featuring Absolute Manage yesterday and the archive is available online. You can either watch the webinar (bit less than 1 hour) or just download the slides. It featured a case study from a school district with a few thousand managed machines and has a heavy focus on asset management and software [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.edweek.org" target="_blank">Edweek.org</a> did a webinar featuring Absolute Manage yesterday and the archive is available online. You can either watch the webinar (bit less than 1 hour) or just download the slides. It featured a case study from a school district with a few thousand managed machines and has a heavy focus on asset management and software license monitoring. It&#8217;s worth watching.</p>
<p><a href="http://www.edweek.org/ew/marketplace/webinars/webinars.html" target="_blank">http://www.edweek.org/ew/marketplace/webinars/webinars.html</a></p>
<p>Scroll down to the section titled: <strong>Getting a Grasp on Computer Assets to Deliver Maximum Cost Efficiency</strong></p>

<p><a href="http://feedads.g.doubleclick.net/~a/GTlg90glWqs5gbKzLYGnger3NO4/0/da"><img src="http://feedads.g.doubleclick.net/~a/GTlg90glWqs5gbKzLYGnger3NO4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/GTlg90glWqs5gbKzLYGnger3NO4/1/da"><img src="http://feedads.g.doubleclick.net/~a/GTlg90glWqs5gbKzLYGnger3NO4/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=9VjYd1Nkxu4:YenWjbYCTAI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=9VjYd1Nkxu4:YenWjbYCTAI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?i=9VjYd1Nkxu4:YenWjbYCTAI:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=9VjYd1Nkxu4:YenWjbYCTAI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?i=9VjYd1Nkxu4:YenWjbYCTAI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=9VjYd1Nkxu4:YenWjbYCTAI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/MacAdminCorner/~4/9VjYd1Nkxu4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.macadmincorner.com/absolute-manage-lanrev-webinar-archive-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.macadmincorner.com/absolute-manage-lanrev-webinar-archive-available/</feedburner:origLink></item>
		<item>
		<title>Add directory services data to LANDesk inventory</title>
		<link>http://feedproxy.google.com/~r/MacAdminCorner/~3/QSoH8DiYwAA/</link>
		<comments>http://blog.macadmincorner.com/add-directory-services-data-to-landesk-inventory/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 13:00:25 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[AD Integration]]></category>
		<category><![CDATA[Desktop Management]]></category>
		<category><![CDATA[Directory Services]]></category>
		<category><![CDATA[LANDesk]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Open Directory]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Active Directory]]></category>

		<guid isPermaLink="false">http://blog.macadmincorner.com/?p=396</guid>
		<description><![CDATA[I posted over at the LANDesk community site on how I add AD and OD data to inventory, most of which LANDesk does not collect on it&#8217;s own. Much of this I did because we were moving from one OD domain to another and needed a way to see which machines remained on the old [...]]]></description>
			<content:encoded><![CDATA[<p>I posted over at the LANDesk community site on how I add AD and OD data to inventory, most of which LANDesk does not collect on it&#8217;s own. Much of this I did because we were moving from one OD domain to another and needed a way to see which machines remained on the old domain.</p>
<p>You can get the script here: <a href="http://community.landesk.com/support/docs/DOC-9232" target="_blank">http://community.landesk.com/support/docs/DOC-9232</a>.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/duhDjbsrE6LHQhG7OW9VLjV1k_0/0/da"><img src="http://feedads.g.doubleclick.net/~a/duhDjbsrE6LHQhG7OW9VLjV1k_0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/duhDjbsrE6LHQhG7OW9VLjV1k_0/1/da"><img src="http://feedads.g.doubleclick.net/~a/duhDjbsrE6LHQhG7OW9VLjV1k_0/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=QSoH8DiYwAA:ftwBsUU8M1s:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=QSoH8DiYwAA:ftwBsUU8M1s:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?i=QSoH8DiYwAA:ftwBsUU8M1s:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=QSoH8DiYwAA:ftwBsUU8M1s:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?i=QSoH8DiYwAA:ftwBsUU8M1s:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=QSoH8DiYwAA:ftwBsUU8M1s:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/MacAdminCorner/~4/QSoH8DiYwAA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.macadmincorner.com/add-directory-services-data-to-landesk-inventory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.macadmincorner.com/add-directory-services-data-to-landesk-inventory/</feedburner:origLink></item>
		<item>
		<title>Changed RSS feed to show full posts</title>
		<link>http://feedproxy.google.com/~r/MacAdminCorner/~3/w_Zpk1p8zh8/</link>
		<comments>http://blog.macadmincorner.com/changed-rss-feed-to-show-full-posts/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 21:52:39 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Blogging]]></category>

		<guid isPermaLink="false">http://blog.macadmincorner.com/changed-rss-feed-to-show-full-posts/</guid>
		<description><![CDATA[Lately, I&#8217;ve been reading more and more of my daily news from my iPhone and I&#8217;ve started to get pissed off at blogs that I like that only show a short summary in the RSS feed. This drove me nuts. Then today I just realized that I was doing the exact same thing! My bad.
So [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" style="border: 0pt none; max-width: 800px;" src="http://blog.macadmincorner.com/wp-content/uploads/2010/01/rss-icon.jpg" alt="" width="180" height="90" />Lately, I&#8217;ve been reading more and more of my daily news from my iPhone and I&#8217;ve started to get pissed off at blogs that I like that only show a short summary in the RSS feed. This drove me nuts. Then today I just realized that I was doing the exact same thing! My bad.</p>
<p>So if you were cursing me for only showing the summaries and stopped subscribing, fear not, that should be fixed for future posts.</p>
<p>Subscribe to my feed from <a href="http://feeds2.feedburner.com/MacAdminCorner">here</a>.</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=b91353eb-f68e-8a67-8b57-93f1412ac251" alt="" /></div>

<p><a href="http://feedads.g.doubleclick.net/~a/l6KVYDSByaGxre36KBaMRZKdteA/0/da"><img src="http://feedads.g.doubleclick.net/~a/l6KVYDSByaGxre36KBaMRZKdteA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/l6KVYDSByaGxre36KBaMRZKdteA/1/da"><img src="http://feedads.g.doubleclick.net/~a/l6KVYDSByaGxre36KBaMRZKdteA/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=w_Zpk1p8zh8:4E_4E9L6ofU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=w_Zpk1p8zh8:4E_4E9L6ofU:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?i=w_Zpk1p8zh8:4E_4E9L6ofU:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=w_Zpk1p8zh8:4E_4E9L6ofU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?i=w_Zpk1p8zh8:4E_4E9L6ofU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=w_Zpk1p8zh8:4E_4E9L6ofU:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/MacAdminCorner/~4/w_Zpk1p8zh8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.macadmincorner.com/changed-rss-feed-to-show-full-posts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.macadmincorner.com/changed-rss-feed-to-show-full-posts/</feedburner:origLink></item>
		<item>
		<title>Ten blogs every Mac admin should know about</title>
		<link>http://feedproxy.google.com/~r/MacAdminCorner/~3/rxe-fh0hwjI/</link>
		<comments>http://blog.macadmincorner.com/ten-blogs-every-mac-admin-should-know-about/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 02:55:28 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Blogs]]></category>

		<guid isPermaLink="false">http://blog.macadmincorner.com/ten-blogs-every-mac-admin-should-know-about/</guid>
		<description><![CDATA[Need to load up your RSS reader with loads of Mac goodness? Mac Admin Corner just not quite enough for you? There are plenty of Mac experts out there sharing their knowledge with the world. Here&#8217;s a list of sites that I follow.



Krypted.com
Charles Edge has written many Mac Server Books including the Enterprise Mac Administrator&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Need to load up your RSS reader with loads of Mac goodness? Mac Admin Corner just not quite enough for you? There are plenty of Mac experts out there sharing their knowledge with the world. Here&#8217;s a list of sites that I follow.</p>
<p style="text-align: center;"><a href="http://blog.macadmincorner.com/wp-content/uploads/2010/01/hero20080609.jpg"><img class="size-medium wp-image-381  aligncenter" title="hero20080609" src="http://blog.macadmincorner.com/wp-content/uploads/2010/01/hero20080609-300x184.jpg" alt="" width="300" height="184" /></a></p>
<p style="text-align: center;"><span id="more-379"></span></p>
<ol>
<li><a href="http://krypted.com" target="_blank">Krypted.com</a><br />
Charles Edge has written many <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fentity%2F-%2FB001JPC32I&amp;tag=macadmcor-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=390957">Mac Server Books</a><img style="border: medium none  ! important; margin: 0px ! important;" src="https://www.assoc-amazon.com/e/ir?t=macadmcor-20&amp;l=ur2&amp;o=1" border="0" alt="" width="1" height="1" /> including the <a href="http://www.amazon.com/gp/product/1430224436?ie=UTF8&amp;tag=macadmcor-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1430224436">Enterprise Mac Administrator&#8217;s Guide</a><img style="border: medium none  ! important; margin: 0px ! important;" src="http://www.assoc-amazon.com/e/ir?t=macadmcor-20&amp;l=as2&amp;o=1&amp;a=1430224436" border="0" alt="" width="1" height="1" /> and <a href="http://www.amazon.com/gp/product/1430227729?ie=UTF8&amp;tag=macadmcor-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1430227729">Beginning Mac OS X Snow Leopard Server: From Solo Install to Enterprise Integration</a><img style="border: medium none  ! important; margin: 0px ! important;" src="http://www.assoc-amazon.com/e/ir?t=macadmcor-20&amp;l=as2&amp;o=1&amp;a=1430227729" border="0" alt="" width="1" height="1" />. Charles also frequently updates his blog over at Krypted.com.</li>
<li><a href="http://Systemsboy.com" target="_blank">SystemsBoy.com</a><br />
Very interesting to read, he has a great writing style.</li>
<li><a href="http://managingosx.wordpress.com" target="_blank">Managing OS X</a><br />
Greg is one of the top contributors and well respected guru&#8217;s on many of the Mac lists. He has written many useful articles including <a href="http://managingosx.wordpress.com/2008/02/07/mcx-dslocal-and-leopard/trackback/" target="_blank">MCX, dslocal, and Leopard</a> and <a href="http://managingosx.wordpress.com/2008/02/13/managing-office-2008/trackback/" target="_blank">managing Office 2008 with MCX</a>, and much more.</li>
<li><a href="http://blog.irisink.com/" target="_blank">IrisInk</a><br />
Intelligent posts, great to read.</li>
<li><a href="http://afp548.com" target="_blank">AFP548.com</a><br />
One of the most well known Mac IT sites, run by a couple Apple SE&#8217;s (I don&#8217;t remember their exact titles), this site is also home to a couple useful tools including InstaDMG and KeyMinder. Their <a href="http://www.afp548.com/forum/index.php" target="_blank">forums</a> are also pretty lively. Summarizing everything this site, and the next one on the list would require entire articles.</li>
<li><a href="http://macenterprise.org" target="_blank">MacEnterprise.org</a><br />
Originally macosxlabs.org, this site is the combined efforts of several businesses as well as higher education instututions to provide a central repository of collaborations. I&#8217;m not sure it&#8217;s considered a &#8220;blog&#8221; but it&#8217;s worth making the list anyway. Best known for their [usually] monthly webcasts as well as the mailing list.</li>
<li><a href="http://unflyingobject.com/blog/" target="_blank">Unflying Object</a><br />
He claims it&#8217;s not a blog, but it sure looks, smells and tastes like one to me. Useful posts too.</li>
<li><a href="http://www.eweek.com/c/s/Apple/" target="_blank">eWeek</a><br />
Mostly IT corporate related news, their Mac section occasionally posts some interesting commentary.</li>
<li><a href="http://www.computerworld.com/s/columnist/1057/Ryan+Faas" target="_blank">ComputerWorld</a><br />
<a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fentity%2FRyan-Faas%2FB001HD0TD2%3Fie%3DUTF8%26ref_%3Dsr%255Ftc%255F2%255F0%26qid%3D1263695166%26sr%3D1-2-ent&amp;tag=macadmcor-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=390957">Ryan Faas</a><img style="border: medium none  ! important; margin: 0px ! important;" src="https://www.assoc-amazon.com/e/ir?t=macadmcor-20&amp;l=ur2&amp;o=1" border="0" alt="" width="1" height="1" />, the author of <a href="http://www.amazon.com/gp/product/1430224452?ie=UTF8&amp;tag=macadmcor-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1430224452">iPhone for Work: Increasing Productivity for Busy Professionals (Books for Professionals by Professionals)</a><img style="border: medium none  ! important; margin: 0px ! important;" src="http://www.assoc-amazon.com/e/ir?t=macadmcor-20&amp;l=as2&amp;o=1&amp;a=1430224452" border="0" alt="" width="1" height="1" /> and other books is a regular columnist at ComputerWorld.</li>
<li><a href="http://explanatorygap.net/" target="_blank">Explanatory Gap </a><br />
Nigel Kersten is a sysadmin with Google and a Mac wiz to say the least.</li>
</ol>
<p>I know there are a ton of other relevant bloggers out there but I limited this list to those that have been posting recently. My site would not have made the list since I took close to a year off, but it&#8217;s my site and I make (or break) the rules. <img src='http://blog.macadmincorner.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Quite honestly, when you look at the number of competing Windows and Linux IT sites, we are definitely in the minority. I expect to see more and more resources (blog or otherwise) become available to the Mac management community.</p>
<p>Have I missed any that should be noted? Do you have a blog of your own you&#8217;d like to share? Share your comments!</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=4fc0fe8d-4482-8fa9-8e7a-7ecd27efb065" alt="" /></div>

<p><a href="http://feedads.g.doubleclick.net/~a/mBttKHTuz1a0HDdrebHYEyvnfHQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/mBttKHTuz1a0HDdrebHYEyvnfHQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/mBttKHTuz1a0HDdrebHYEyvnfHQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/mBttKHTuz1a0HDdrebHYEyvnfHQ/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=rxe-fh0hwjI:mO-1tqcaUWE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=rxe-fh0hwjI:mO-1tqcaUWE:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?i=rxe-fh0hwjI:mO-1tqcaUWE:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=rxe-fh0hwjI:mO-1tqcaUWE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?i=rxe-fh0hwjI:mO-1tqcaUWE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=rxe-fh0hwjI:mO-1tqcaUWE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/MacAdminCorner/~4/rxe-fh0hwjI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.macadmincorner.com/ten-blogs-every-mac-admin-should-know-about/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://blog.macadmincorner.com/ten-blogs-every-mac-admin-should-know-about/</feedburner:origLink></item>
		<item>
		<title>Can Open Directory be used enterprise wide?</title>
		<link>http://feedproxy.google.com/~r/MacAdminCorner/~3/e3dtXzx_OdA/</link>
		<comments>http://blog.macadmincorner.com/can-open-directory-be-used-enterprise-wide/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 03:27:45 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[AD Integration]]></category>
		<category><![CDATA[Directory Services]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Open Directory]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Directory Service]]></category>

		<guid isPermaLink="false">http://blog.macadmincorner.com/can-open-directory-be-used-enterprise-wide/</guid>
		<description><![CDATA[A few years ago, before I started at my employer, a project was started for an enterprise-wide Open Directory setup. Each business unit within the university has a decent number of Macs that were mostly unmanaged. The project passed governance and a budget was set aside to fund the implementation. This was back in the [...]]]></description>
			<content:encoded><![CDATA[<p>A few years ago, before I started at my employer, a project was started for an enterprise-wide Open Directory setup. Each business unit within the university has a decent number of Macs that were mostly unmanaged. The project passed governance and a budget was set aside to fund the implementation. This was back in the Tiger days and for some reason, everyone involved decided to wait for Leopard to be released. In the mean time, I had a Tiger OD setup so we could manage a handful of classrooms that needed to be managed.</p>
<p><span id="more-373"></span></p>
<p>When we were ready to get the project going again well after Leopards release, I built an evaluation OD setup and kicked it around a bit. Apple added a great new (at the time) feature that allows computer groups to be members of other computer groups. As well as allowing computers to be members of multiple computer groups. However, because of this, there is no feasible way to manage delegated administration. Computer group nesting is nothing like Active Directory OU&#8217;s, there&#8217;s no hierarchy structure. Whereas Tiger Server had the ability to give an admin control to only certain computer lists. The change to Leopard meant that if someone needs to manage preferences, add computer accounts or anything else having to do with computer groups, the admin would need to be given full domain admin rights.</p>
<p>In our non-centralized environment, this wouldn&#8217;t work. I came to the conclusion that Apple did not design Open Directory for the enterprise. Apple&#8217;s typical target market is K-12 and departments within an enterprise (higher education or corporate). We all throw out states like &#8220;if Apple wants to compete in the enterprise, they need to do&#8230;.&#8221;. Apple is not an enterprise company, and they don&#8217;t pretend to be. Apple makes assumptions about how their customers will use their products. In the case of OD, they assume the IT departments involved are either small and localized or centralized and that everyone works well together.</p>
<p>Often times, enterprises that implement Macs try to bend Apple&#8217;s server offerings to fit their environment. Then complain to Apple when it doesn&#8217;t bend the way they think it should. This is especially true in higher education, where the customers (faculty and staff) get to choose their platform. Many are going to choose Macs and it is our job to do what we need to do in order to manage them. In the case of OD, it&#8217;s just not something that can easily be centralized unless you&#8217;re willing to give every admin the equivalent of domain admin. Could you imagine doing that with Active Directory?</p>
<p>So everyone involved decided to not use a central offering. We have recently implemented OD in our area and it&#8217;s working really well for us for the most part. Delegation is still an issue as we don&#8217;t want everyone to be a domain admin but I&#8217;ve developed some methods for computer accounts to be added without granting admin rights on the domain. Stay tuned, I&#8217;ll be posting that script soon.</p>
<p>How have you implemented OD in your enviornment? Have you centralized, or localized?</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=a70af403-4ece-8cc5-97be-c84f20d28c58" alt="" /></div>

<p><a href="http://feedads.g.doubleclick.net/~a/CgA7za9toScjA77q7bKYcyF-tIE/0/da"><img src="http://feedads.g.doubleclick.net/~a/CgA7za9toScjA77q7bKYcyF-tIE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/CgA7za9toScjA77q7bKYcyF-tIE/1/da"><img src="http://feedads.g.doubleclick.net/~a/CgA7za9toScjA77q7bKYcyF-tIE/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=e3dtXzx_OdA:qHH1VS2ornQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=e3dtXzx_OdA:qHH1VS2ornQ:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?i=e3dtXzx_OdA:qHH1VS2ornQ:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=e3dtXzx_OdA:qHH1VS2ornQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?i=e3dtXzx_OdA:qHH1VS2ornQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=e3dtXzx_OdA:qHH1VS2ornQ:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/MacAdminCorner/~4/e3dtXzx_OdA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.macadmincorner.com/can-open-directory-be-used-enterprise-wide/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.macadmincorner.com/can-open-directory-be-used-enterprise-wide/</feedburner:origLink></item>
		<item>
		<title>Migrate Local User to Domain Account</title>
		<link>http://feedproxy.google.com/~r/MacAdminCorner/~3/6qA-5NZupUY/</link>
		<comments>http://blog.macadmincorner.com/migrate-local-user-to-domain-account/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 17:02:03 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[AD Integration]]></category>
		<category><![CDATA[Directory Services]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Admin]]></category>
		<category><![CDATA[Directory Service]]></category>
		<category><![CDATA[Open Directory]]></category>

		<guid isPermaLink="false">http://blog.macadmincorner.com/?p=352</guid>
		<description><![CDATA[If you are migrating your machines to authenticate via Active Directory, you may need to convert your local user accounts and their home folders to an AD user account and retain the home folder. I had a script posted here but that version was Tiger only because it used NI* commands.
The following script is written [...]]]></description>
			<content:encoded><![CDATA[<p>If you are migrating your machines to authenticate via Active Directory, you may need to convert your local user accounts and their home folders to an AD user account and retain the home folder. I had a script posted <a href="http://blog.macadmincorner.com/convert-local-accounts-home-to-ad-account-with-local-home/">here</a> but that version was Tiger only because it used NI* commands.<span id="more-352"></span></p>
<p>The following script is written in bash and can be run by double clicking (it&#8217;s a .command) as a user with sudo rights (all admin users have this right by default). It will prompt for your admin password, then present a list of numbered local users. Enter a number from the list for the user you want to migrate, then it will ask for the network ID. It runs in a loop until you select the option for &#8220;Finished&#8221; which will exit the script.</p>
<p>This should work with Tiger, Leopard or Snow Leopard and can easily be modified to work with OD user accounts (change the check4AD variable to check for OD instead).</p>
<p style="text-align: center;"><a href="http://blog.macadmincorner.com/wp-content/uploads/2010/01/Screen-shot-2010-01-14-at-11.21.29-AM.png"><img class="aligncenter size-medium wp-image-354" style="border: 0pt none;" title="Migrate user screen shot" src="http://blog.macadmincorner.com/wp-content/uploads/2010/01/Screen-shot-2010-01-14-at-11.21.29-AM-300x228.png" alt="" width="300" height="228" /></a></p>
<p>To download the script, click <a href="http://macadmincorner.com/files/MigrateLocalUserToDomainAcct.command.zip">here</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #007800;">Version</span>=<span style="color: #000000;">1.0</span>
<span style="color: #666666; font-style: italic;"># Modified 1/14/2009</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># MigrateLocalUserToDomainAcct.command</span>
<span style="color: #666666; font-style: italic;"># Patrick Gallagher</span>
<span style="color: #666666; font-style: italic;"># http://macadmincorner.com</span>
<span style="color: #666666; font-style: italic;">#</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># This script should not need any modification in most enviornments. </span>
<span style="color: #666666; font-style: italic;"># If the script does not execute when run, you may need to 'chmod +x /path/to/thisScript' to make it executable</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">clear</span>
&nbsp;
<span style="color: #007800;">netIDprompt</span>=<span style="color: #ff0000;">&quot;Please enter the network ID for this user: &quot;</span>
<span style="color: #007800;">listUsers</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$(/usr/bin/dscl . list /Users | grep -v eccsadmin | grep -v _ | grep -v root | grep -v uucp | grep -v amavisd | grep -v nobody | grep -v messagebus | grep -v daemon | grep -v www | grep -v Guest | grep -v xgrid | grep -v windowserver | grep -v unknown | grep -v unknown | grep -v tokend | grep -v sshd | grep -v securityagent | grep -v mailman | grep -v mysql | grep -v postfix | grep -v qtss | grep -v jabber | grep -v cyrusimap | grep -v clamav | grep -v appserver | grep -v appowner)</span> FINISHED&quot;</span>
<span style="color: #007800;">FullScriptName</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">basename</span> <span style="color: #ff0000;">&quot;$0&quot;</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">ShowVersion</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$FullScriptName</span> <span style="color: #007800;">$Version</span>&quot;</span>
<span style="color: #007800;">check4AD</span>=<span style="color: #000000; font-weight: bold;">`/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>dscl localhost <span style="color: #660033;">-list</span> . <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;Active Directory&quot;</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">osversionlong</span>=<span style="color: #000000; font-weight: bold;">`</span>sw_vers -productVersion<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">osvers</span>=<span style="color: #800000;">${osversionlong:3:1}</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;********* Running <span style="color: #007800;">$FullScriptName</span> Version <span style="color: #007800;">$Version</span> *********&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># If the machine is not bound to AD, then there's no purpose going any further. </span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${check4AD}</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;Active Directory&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;This machine is not bound to Active Directory.<span style="color: #000099; font-weight: bold;">\n</span>Please bind to AD first. &quot;</span>; <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
RunAsRoot<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #666666; font-style: italic;">##  Pass in the full path to the executable as $1</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${USER}</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;root&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> ; <span style="color: #000000; font-weight: bold;">then</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;***  This application must be run as root.  Please authenticate below.  ***&quot;</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span>
                <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${1}</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span>
        <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
RunAsRoot <span style="color: #ff0000;">&quot;<span style="color: #007800;">${0}</span>&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">until</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$user</span>&quot;</span> == <span style="color: #ff0000;">&quot;FINISHED&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">do</span>
&nbsp;
	<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;%b&quot;</span> <span style="color: #ff0000;">&quot;\a<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>Select a user to convert or select FINISHED:<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">2</span>
	<span style="color: #000000; font-weight: bold;">select</span> user <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$listUsers</span>; <span style="color: #000000; font-weight: bold;">do</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$user</span>&quot;</span> = <span style="color: #ff0000;">&quot;FINISHED&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
			<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Finshied converting users to AD&quot;</span>
			<span style="color: #7a0874; font-weight: bold;">break</span>
		<span style="color: #000000; font-weight: bold;">elif</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$user</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
			<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">who</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> console <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $1}'</span><span style="color: #000000; font-weight: bold;">`</span> == <span style="color: #ff0000;">&quot;<span style="color: #007800;">$user</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
				<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;This user is logged in.<span style="color: #000099; font-weight: bold;">\n</span>Please log this user out and log in as another admin&quot;</span>
				<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
			<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
			<span style="color: #666666; font-style: italic;"># Determine location of the users home folder</span>
			<span style="color: #007800;">userHome</span>=<span style="color: #000000; font-weight: bold;">`/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>dscl . <span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$user</span> NFSHomeDirectory <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-c</span> <span style="color: #000000;">19</span>-<span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
			<span style="color: #666666; font-style: italic;"># Get list of groups</span>
			<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Checking group memberships for local user <span style="color: #007800;">$user</span>&quot;</span>
			<span style="color: #007800;">lgroups</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$(/usr/bin/id -Gn $user)</span>&quot;</span>
&nbsp;
&nbsp;
			<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$(/usr/bin/dscl . -search /Groups GroupMembership &quot;$user&quot;)</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span> 
			<span style="color: #666666; font-style: italic;"># Delete user from each group it is a member of</span>
				<span style="color: #000000; font-weight: bold;">for</span> lg <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$lgroups</span>; 
					<span style="color: #000000; font-weight: bold;">do</span>
						<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>dscl . <span style="color: #660033;">-delete</span> <span style="color: #000000; font-weight: bold;">/</span>Groups<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${lg}</span> GroupMembership <span style="color: #007800;">$user</span> <span style="color: #000000; font-weight: bold;">&gt;&amp;/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null
					<span style="color: #000000; font-weight: bold;">done</span>
			<span style="color: #000000; font-weight: bold;">fi</span>
			<span style="color: #666666; font-style: italic;"># Delete the primary group</span>
			<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$(/usr/bin/dscl . -search /Groups name &quot;$user&quot;)</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  				<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>dseditgroup <span style="color: #660033;">-o</span> delete <span style="color: #ff0000;">&quot;<span style="color: #007800;">$user</span>&quot;</span>
			<span style="color: #000000; font-weight: bold;">fi</span>
			<span style="color: #666666; font-style: italic;"># Get the users guid and set it as a var</span>
			<span style="color: #007800;">guid</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$(/usr/bin/dscl . -read &quot;/Users/$user&quot; GeneratedUID | /usr/bin/awk '{print $NF;}')</span>&quot;</span>
			<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> <span style="color: #ff0000;">&quot;/private/var/db/shadow/hash/<span style="color: #007800;">$guid</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
 				<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>db<span style="color: #000000; font-weight: bold;">/</span>shadow<span style="color: #000000; font-weight: bold;">/</span>hash<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$guid</span>
			<span style="color: #000000; font-weight: bold;">fi</span>
			<span style="color: #666666; font-style: italic;"># Delete the user</span>
			<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>dscl . <span style="color: #660033;">-delete</span> <span style="color: #ff0000;">&quot;/Users/<span style="color: #007800;">$user</span>&quot;</span>
&nbsp;
&nbsp;
				<span style="color: #666666; font-style: italic;"># Verify NetID</span>
				<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;\e[1m<span style="color: #007800;">$netIDprompt</span>&quot;</span>
				<span style="color: #c20cb9; font-weight: bold;">read</span> netname
				<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">killall</span> DirectoryService
				<span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">10</span>
				<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">id</span> <span style="color: #007800;">$netname</span>
				<span style="color: #666666; font-style: italic;"># Check if there's a home folder there already, if there is, exit before we wipe it</span>
				<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$netname</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
					<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Oops, theres a home folder there already for <span style="color: #007800;">$netname</span>.<span style="color: #000099; font-weight: bold;">\n</span>If you don't want that one, delete it in the Finder first,<span style="color: #000099; font-weight: bold;">\n</span>then run this script again.&quot;</span>
					<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
				<span style="color: #000000; font-weight: bold;">else</span>
					<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #007800;">$userHome</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$netname</span>
					<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> <span style="color: #800000;">${netname}</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$netname</span>
					<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Home for <span style="color: #007800;">$netname</span> now located at /Users/<span style="color: #007800;">$netname</span>&quot;</span>			
				<span style="color: #000000; font-weight: bold;">fi</span>
			<span style="color: #7a0874; font-weight: bold;">break</span>
		<span style="color: #000000; font-weight: bold;">else</span>
			<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Invalid selection!&quot;</span>
		<span style="color: #000000; font-weight: bold;">fi</span>
	<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></div></div>


<p><a href="http://feedads.g.doubleclick.net/~a/H2FAbiTxFAu6MHxx0IDL8kFevg0/0/da"><img src="http://feedads.g.doubleclick.net/~a/H2FAbiTxFAu6MHxx0IDL8kFevg0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/H2FAbiTxFAu6MHxx0IDL8kFevg0/1/da"><img src="http://feedads.g.doubleclick.net/~a/H2FAbiTxFAu6MHxx0IDL8kFevg0/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=6qA-5NZupUY:v8M0-2rlx38:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=6qA-5NZupUY:v8M0-2rlx38:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?i=6qA-5NZupUY:v8M0-2rlx38:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=6qA-5NZupUY:v8M0-2rlx38:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?i=6qA-5NZupUY:v8M0-2rlx38:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=6qA-5NZupUY:v8M0-2rlx38:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/MacAdminCorner/~4/6qA-5NZupUY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.macadmincorner.com/migrate-local-user-to-domain-account/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		<feedburner:origLink>http://blog.macadmincorner.com/migrate-local-user-to-domain-account/</feedburner:origLink></item>
		<item>
		<title>Add user to admin group with Applescript</title>
		<link>http://feedproxy.google.com/~r/MacAdminCorner/~3/ID4LLhFhmgg/</link>
		<comments>http://blog.macadmincorner.com/add-user-to-admin-group-with-applescript/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 23:58:30 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Admin]]></category>
		<category><![CDATA[Applescript]]></category>

		<guid isPermaLink="false">http://blog.macadmincorner.com/?p=346</guid>
		<description><![CDATA[Need a way for your team to easily make a network or local user an admin? Copy and paste the code below into Script Editor (Applescript Editor in 10.6) and save it as an application. This can be used before deploying a machine to the user, or after they&#8217;ve logged in.

(*
Add user to admin group
&#160;
This [...]]]></description>
			<content:encoded><![CDATA[<p>Need a way for your team to easily make a network or local user an admin? Copy and paste the code below into Script Editor (Applescript Editor in 10.6) and save it as an application. This can be used before deploying a machine to the user, or after they&#8217;ve logged in.</p>

<div class="wp_syntax"><div class="code"><pre class="applescript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">(*
Add user to admin group
&nbsp;
This script should not need any modification, unless you want to &quot;brand&quot; it. 
&nbsp;
http://macadmincorner.com
*)</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;System Events&quot;</span>
	<span style="color: #ff0033; font-weight: bold;">set</span> shortName <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">name</span> <span style="color: #ff0033; font-weight: bold;">of</span> current user
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">set</span> userName <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">text</span> returned <span style="color: #ff0033; font-weight: bold;">of</span> <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">display dialog</span> <span style="color: #009900;">&quot;Enter the users shortname&quot;</span> <span style="color: #0066ff;">default answer</span> shortName<span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #0066ff;">do shell script</span> <span style="color: #009900;">&quot;dseditgroup -o edit -a &quot;</span> <span style="color: #000000;">&amp;</span> userName <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; -t user admin&quot;</span> <span style="color: #ff0033; font-weight: bold;">with</span> administrator privileges
&nbsp;
&nbsp;
<span style="color: #0066ff;">display dialog</span> <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">do shell script</span> <span style="color: #009900;">&quot;dscl . -read /Groups/admin users&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">with</span> title <span style="color: #009900;">&quot;The following users are admins on this machine&quot;</span> <span style="color: #0066ff;">buttons</span> <span style="color: #009900;">&quot;Ok&quot;</span> default button <span style="color: #000000;">1</span></pre></div></div>


<p><a href="http://feedads.g.doubleclick.net/~a/VpywrlzJioiHZPngmpJqHmbrbLA/0/da"><img src="http://feedads.g.doubleclick.net/~a/VpywrlzJioiHZPngmpJqHmbrbLA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/VpywrlzJioiHZPngmpJqHmbrbLA/1/da"><img src="http://feedads.g.doubleclick.net/~a/VpywrlzJioiHZPngmpJqHmbrbLA/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=ID4LLhFhmgg:KkZTC9MumJ4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=ID4LLhFhmgg:KkZTC9MumJ4:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?i=ID4LLhFhmgg:KkZTC9MumJ4:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=ID4LLhFhmgg:KkZTC9MumJ4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?i=ID4LLhFhmgg:KkZTC9MumJ4:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MacAdminCorner?a=ID4LLhFhmgg:KkZTC9MumJ4:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/MacAdminCorner?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/MacAdminCorner/~4/ID4LLhFhmgg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.macadmincorner.com/add-user-to-admin-group-with-applescript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.macadmincorner.com/add-user-to-admin-group-with-applescript/</feedburner:origLink></item>
	</channel>
</rss>
