<html>
  <head>
    <style type="text/css">
      <!--
        body { margin-right: 4px; line-height: normal; margin-left: 4px; font-variant: normal; margin-bottom: 1px; margin-top: 4px }
        p { margin-bottom: 0; margin-top: 0 }
      -->
    </style>
    
  </head>
  <body style="margin-right: 4px; margin-left: 4px; margin-bottom: 1px; margin-top: 4px">
    <p style="margin-top: 0; margin-bottom: 0">
      <font size="3" face="Lucida Grande">This looks very similar to my script but my script doesn&#39;t loop and exit if an error is found. &nbsp;This one is maybe perhaps more thorough but the script I use does the same thing. &nbsp;Also&#44; in my main master image no client is bound. &nbsp;Then as a post image and start up script my script runs to bind the client to the proper replica.</font><br><br><br>___________________________<BR>Thomas&nbsp;Larkin<BR>TIS&nbsp;Department<BR>KCKPS&nbsp;USD500<BR><a href="mailto:tlarki@kckps.org">tlarki@kckps.org</a><BR>blackberry:&nbsp;&nbsp;913-449-7589<BR>office:&nbsp;&nbsp;913-627-0351<BR><BR><BR><BR><br><br>&gt;&gt;&gt; &quot;White&#44; Christopher&quot; &lt;chris.white@friscoisd.org&gt; 05/05/09 12:36 PM &gt;&gt;&gt;<br>The following is the script that I am attempting to use to unbind workstations from OD &#40;This script is part of the resource kit and it is not working for me&#41; Any suggestions&#63;:<br><br>&#35;&#33;/bin/sh<br>&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;<br>&#35;<br>&#35; Copyright &#40;c&#41; 2008&#44; JAMF Software&#44; LLC<br>&#35; All rights reserved.<br>&#35;<br>&#35;Redistribution and use in source and binary forms&#44; with or without<br>&#35; modification&#44; are permitted provided that the following conditions are met:<br>&#35;&#42; Redistributions of source code must retain the above copyright<br>&#35;&#160;&nbsp;notice&#44; this list of conditions and the following disclaimer.<br>&#35;&#42; Redistributions in binary form must reproduce the above copyright<br>&#35;&#160;&nbsp;notice&#44; this list of conditions and the following disclaimer in the<br>&#35;&#160;&nbsp;documentation and/or other materials provided with the distribution.<br>&#35;&#42; Neither the name of the JAMF Software&#44; LLC nor the<br>&#35;&#160;&nbsp;names of its contributors may be used to endorse or promote products<br>&#35;&#160;&nbsp;derived from this software without specific prior written permission.<br>&#35;<br>&#35; THIS SOFTWARE IS PROVIDED BY JAMF SOFTWARE&#44; LLC &quot;AS IS&quot; AND ANY<br>&#35; EXPRESS OR IMPLIED WARRANTIES&#44; INCLUDING&#44; BUT NOT LIMITED TO&#44; THE IMPLIED<br>&#35; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE<br>&#35; DISCLAIMED. IN NO EVENT SHALL JAMF SOFTWARE&#44; LLC BE LIABLE FOR ANY<br>&#35; DIRECT&#44; INDIRECT&#44; INCIDENTAL&#44; SPECIAL&#44; EXEMPLARY&#44; OR CONSEQUENTIAL DAMAGES<br>&#35; &#40;INCLUDING&#44; BUT NOT LIMITED TO&#44; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES&#59;<br>&#35; LOSS OF USE&#44; DATA&#44; OR PROFITS&#59; OR BUSINESS INTERRUPTION&#41; HOWEVER CAUSED AND<br>&#35; ON ANY THEORY OF LIABILITY&#44; WHETHER IN CONTRACT&#44; STRICT LIABILITY&#44; OR TORT<br>&#35; &#40;INCLUDING NEGLIGENCE OR OTHERWISE&#41; ARISING IN ANY WAY OUT OF THE USE OF THIS<br>&#35; SOFTWARE&#44; EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.<br>&#35;<br>&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;<br>&#35;<br>&#35; SUPPORT FOR THIS PROGRAM<br>&#35;<br>&#35; This program is distributed &quot;as is&quot; by JAMF Software&#44; LLC&#39;s Resource Kit team. For more<br>&#35;information or support for the Resource Kit&#44; please utilize the following resources:<br>&#35;<br>&#35;<a href="http://www.jamfsoftware.com/mailing_lists/">http://www.jamfsoftware.com/mailing_lists/</a><br>&#35;<br>&#35;<a href="http://www.jamfsoftware.com/jamf_nation/resourcekit.php">http://www.jamfsoftware.com/jamf_nation/resourcekit.php</a><br>&#35;<br>&#35;Please reference our SLA for information regarding support of this application:<br>&#35;<br>&#35;<a href="http://www.jamfsoftware.com/jamf_nation/resourcekit_sla.php">http://www.jamfsoftware.com/jamf_nation/resourcekit_sla.php</a><br>&#35;<br>&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;<br>&#35;<br>&#35; ABOUT THIS PROGRAM<br>&#35;<br>&#35; NAME<br>&#35;unbindOD.sh -- Unbind from Open Directory.<br>&#35;<br>&#35; SYNOPSIS<br>&#35;sudo unbindOD.sh<br>&#35;sudo unbindOD.sh &lt;mountPoint&gt; &lt;computerName&gt; &lt;currentUsername&gt; &lt;serverAddress&gt; &lt;username&gt;<br>&#35;&lt;password&gt;<br>&#35;<br>&#35; If the &#36;serverAddress&#44; &#36;username&#44; and &#36;password parameters are specified &#40;parameters 4&#44; 5&#44; and<br>&#35;6&#41;&#44; these will be used to unbind the machine from Open Directory.&#160;&nbsp;The username/password that<br>&#35;should be used in this script should be an Open Directory user that has permissions to<br>&#35;remove/unbind a machinefrom Open Directory.<br>&#35;<br>&#35; If no parameters are specified for parameters 4&#44; 5&#44; and 6&#44; the hardcoded value in the script<br>&#35;will be used.<br>&#35;<br>&#35; DESCRIPTION<br>&#35;This script will unbind a client machine from an Open Directory domain.<br>&#35;The &lt;serverAddress&gt;&#44; &lt;username&gt;&#44; and &lt;password&gt; values can be used with a hardcoded value in the<br>&#35;script&#44; or read in as a parameter.&#160;&nbsp;Since the Casper Suite defines the first three parameters as<br>&#35;&#40;1&#41; Mount Point&#44; &#40;2&#41; Computer Name and &#40;3&#41; username&#44; we are using the fourth&#44; fifth&#44; and sixth<br>&#35;parameters &#40;&#36;4&#44; &#36;5&#44; &#36;6&#41; as the passable parameters.<br>&#35;<br>&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;<br>&#35;<br>&#35; HISTORY<br>&#35;<br>&#35;Version: 1.0<br>&#35;<br>&#35;- Created by Nick Amundsen on August 7th&#44; 2008<br>&#35;<br>&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;<br>&#35;<br>&#35; DEFINE VARIABLES &amp; READ IN PARAMETERS<br>&#35;<br>&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;<br><br><br>&#35; HARDCODED VALUES ARE SET HERE<br>serverAddress&#61;&quot;&quot;<br>username&#61;&quot;&quot;<br>password&#61;&quot;&quot;<br><br>&#35; CHECK TO SEE IF A VALUE WAS PASSED IN PARAMETER 4 AND&#44; IF SO&#44; ASSIGN TO &quot;serverAddress&quot;<br>if &#91; &quot;&#36;4&quot; &#33;&#61; &quot;&quot; &#93; &amp;&amp; &#91; &quot;&#36;serverAddress&quot; &#61;&#61; &quot;&quot; &#93;&#59; then<br>&#160;&#160;&#160;&nbsp;serverAddress&#61;&#36;4<br>fi<br><br>&#35; CHECK TO SEE IF A VALUE WAS PASSED IN PARAMETER 5 AND&#44; IF SO&#44; ASSIGN TO &quot;username&quot;<br>if &#91; &quot;&#36;5&quot; &#33;&#61; &quot;&quot; &#93; &amp;&amp; &#91; &quot;&#36;username&quot; &#61;&#61; &quot;&quot; &#93;&#59; then<br>&#160;&#160;&#160;&nbsp;username&#61;&#36;5<br>fi<br><br>&#35; CHECK TO SEE IF A VALUE WAS PASSED IN PARAMETER 6 AND&#44; IF SO&#44; ASSIGN TO &quot;password&quot;<br>if &#91; &quot;&#36;6&quot; &#33;&#61; &quot;&quot; &#93; &amp;&amp; &#91; &quot;&#36;password&quot; &#61;&#61; &quot;&quot; &#93;&#59; then<br>&#160;&#160;&#160;&nbsp;password&#61;&#36;6<br>fi<br><br><br>&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;<br>&#35;<br>&#35; SCRIPT CONTENTS - DO NOT MODIFY BELOW THIS LINE<br>&#35;<br>&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;&#35;<br><br>if &#91; &quot;&#36;serverAddress&quot; &#61;&#61; &quot;&quot; &#93;&#59; then<br>echo &quot;Error:&#160;&nbsp;No Server Address is specified.&#160;&nbsp;A Server Address must be specified to unbind the machine.&quot;<br>exit 1<br>fi<br><br>if &#91; &quot;&#36;username&quot; &#61;&#61; &quot;&quot; &#93; &amp;&amp; &#91; &quot;&#36;password&quot; &#61;&#61; &quot;&quot; &#93;&#59; then<br>echo &quot;No username/password is specified.&#160;&nbsp;Attempting to unbind without credentials.&quot;<br>/usr/sbin/dsconfigldap -r &quot;&#36;serverAddress&quot;<br>fi<br><br>if &#91; &quot;&#36;username&quot; &#33;&#61; &quot;&quot; &#93; &amp;&amp; &#91; &quot;&#36;password&quot; &#61;&#61; &quot;&quot; &#93;&#59; then<br>echo &quot;Error:&#160;&nbsp;No password is specified.&#160;&nbsp;Please specify a network password.&quot;<br>exit 1<br>else<br>echo &quot;Unbinding the computer from Open Directory...&quot;<br>/usr/sbin/dsconfigldap -r &quot;&#36;serverAddress&quot; -u &quot;&#36;username&quot; -p &quot;&#36;password&quot;<br>fi<br><br><br>Christopher White<br>Frisco ISD<br>W. Phone: &#40;469&#41; 633-6283<br>C. Phone: &#40;214&#41; 293-1393<br>Email: chris.white@friscoisd.org<br>Blog: <a href="https://wiki.friscoisd.org/users/chris.white/">https://wiki.friscoisd.org/users/chris.white/</a><br><br>This message contains information which may be confidential and<br>privileged. Unless you are the addressee &#40;or authorized to receive for<br>the addressee&#41; you may not use&#44; copy or disclose to anyone the<br>message or any information contained in the message. If you have<br>received this message in error&#44; please advise the sender by reply e-<br>mail and delete the message. This email may contain the thoughts and<br>opinions of the employee sending the message and may not represent<br>the official policy of Frisco Independent Schools.<br><br><br>_______________________________________________<br>Casper mailing list<br>Casper@list.jamfsoftware.com<br><a href="http://list.jamfsoftware.com/mailman/listinfo/casper">http://list.jamfsoftware.com/mailman/listinfo/casper</a><br>
    </p>
  </body>
</html>