<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't loop and exit if an error is found. This one is maybe perhaps more thorough but the script I use does the same thing. Also, in my main master image no client is bound. 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 Larkin<BR>TIS Department<BR>KCKPS USD500<BR><a href="mailto:tlarki@kckps.org">tlarki@kckps.org</a><BR>blackberry: 913-449-7589<BR>office: 913-627-0351<BR><BR><BR><BR><br><br>>>> "White, Christopher" <chris.white@friscoisd.org> 05/05/09 12:36 PM >>><br>The following is the script that I am attempting to use to unbind workstations from OD (This script is part of the resource kit and it is not working for me) Any suggestions?:<br><br>#!/bin/sh<br>####################################################################################################<br>#<br># Copyright (c) 2008, JAMF Software, LLC<br># All rights reserved.<br>#<br>#Redistribution and use in source and binary forms, with or without<br># modification, are permitted provided that the following conditions are met:<br>#* Redistributions of source code must retain the above copyright<br>#  notice, this list of conditions and the following disclaimer.<br>#* Redistributions in binary form must reproduce the above copyright<br>#  notice, this list of conditions and the following disclaimer in the<br>#  documentation and/or other materials provided with the distribution.<br>#* Neither the name of the JAMF Software, LLC nor the<br>#  names of its contributors may be used to endorse or promote products<br>#  derived from this software without specific prior written permission.<br>#<br># THIS SOFTWARE IS PROVIDED BY JAMF SOFTWARE, LLC "AS IS" AND ANY<br># EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED<br># WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE<br># DISCLAIMED. IN NO EVENT SHALL JAMF SOFTWARE, LLC BE LIABLE FOR ANY<br># DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES<br># (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;<br># LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND<br># ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT<br># (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS<br># SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.<br>#<br>####################################################################################################<br>#<br># SUPPORT FOR THIS PROGRAM<br>#<br># This program is distributed "as is" by JAMF Software, LLC's Resource Kit team. For more<br>#information or support for the Resource Kit, please utilize the following resources:<br>#<br>#<a href="http://www.jamfsoftware.com/mailing_lists/">http://www.jamfsoftware.com/mailing_lists/</a><br>#<br>#<a href="http://www.jamfsoftware.com/jamf_nation/resourcekit.php">http://www.jamfsoftware.com/jamf_nation/resourcekit.php</a><br>#<br>#Please reference our SLA for information regarding support of this application:<br>#<br>#<a href="http://www.jamfsoftware.com/jamf_nation/resourcekit_sla.php">http://www.jamfsoftware.com/jamf_nation/resourcekit_sla.php</a><br>#<br>####################################################################################################<br>#<br># ABOUT THIS PROGRAM<br>#<br># NAME<br>#unbindOD.sh -- Unbind from Open Directory.<br>#<br># SYNOPSIS<br>#sudo unbindOD.sh<br>#sudo unbindOD.sh <mountPoint> <computerName> <currentUsername> <serverAddress> <username><br>#<password><br>#<br># If the $serverAddress, $username, and $password parameters are specified (parameters 4, 5, and<br>#6), these will be used to unbind the machine from Open Directory.  The username/password that<br>#should be used in this script should be an Open Directory user that has permissions to<br>#remove/unbind a machinefrom Open Directory.<br>#<br># If no parameters are specified for parameters 4, 5, and 6, the hardcoded value in the script<br>#will be used.<br>#<br># DESCRIPTION<br>#This script will unbind a client machine from an Open Directory domain.<br>#The <serverAddress>, <username>, and <password> values can be used with a hardcoded value in the<br>#script, or read in as a parameter.  Since the Casper Suite defines the first three parameters as<br>#(1) Mount Point, (2) Computer Name and (3) username, we are using the fourth, fifth, and sixth<br>#parameters ($4, $5, $6) as the passable parameters.<br>#<br>####################################################################################################<br>#<br># HISTORY<br>#<br>#Version: 1.0<br>#<br>#- Created by Nick Amundsen on August 7th, 2008<br>#<br>####################################################################################################<br>#<br># DEFINE VARIABLES & READ IN PARAMETERS<br>#<br>####################################################################################################<br><br><br># HARDCODED VALUES ARE SET HERE<br>serverAddress=""<br>username=""<br>password=""<br><br># CHECK TO SEE IF A VALUE WAS PASSED IN PARAMETER 4 AND, IF SO, ASSIGN TO "serverAddress"<br>if [ "$4" != "" ] && [ "$serverAddress" == "" ]; then<br>    serverAddress=$4<br>fi<br><br># CHECK TO SEE IF A VALUE WAS PASSED IN PARAMETER 5 AND, IF SO, ASSIGN TO "username"<br>if [ "$5" != "" ] && [ "$username" == "" ]; then<br>    username=$5<br>fi<br><br># CHECK TO SEE IF A VALUE WAS PASSED IN PARAMETER 6 AND, IF SO, ASSIGN TO "password"<br>if [ "$6" != "" ] && [ "$password" == "" ]; then<br>    password=$6<br>fi<br><br><br>####################################################################################################<br>#<br># SCRIPT CONTENTS - DO NOT MODIFY BELOW THIS LINE<br>#<br>####################################################################################################<br><br>if [ "$serverAddress" == "" ]; then<br>echo "Error:  No Server Address is specified.  A Server Address must be specified to unbind the machine."<br>exit 1<br>fi<br><br>if [ "$username" == "" ] && [ "$password" == "" ]; then<br>echo "No username/password is specified.  Attempting to unbind without credentials."<br>/usr/sbin/dsconfigldap -r "$serverAddress"<br>fi<br><br>if [ "$username" != "" ] && [ "$password" == "" ]; then<br>echo "Error:  No password is specified.  Please specify a network password."<br>exit 1<br>else<br>echo "Unbinding the computer from Open Directory..."<br>/usr/sbin/dsconfigldap -r "$serverAddress" -u "$username" -p "$password"<br>fi<br><br><br>Christopher White<br>Frisco ISD<br>W. Phone: (469) 633-6283<br>C. Phone: (214) 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 (or authorized to receive for<br>the addressee) you may not use, copy or disclose to anyone the<br>message or any information contained in the message. If you have<br>received this message in error, 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>