<html>
  <head>
    <style type="text/css">
      <!--
        body { line-height: normal; margin-bottom: 1px; font-variant: normal; margin-right: 4px; margin-left: 4px; margin-top: 4px }
        p { margin-bottom: 0; margin-top: 0 }
      -->
    </style>
    
  </head>
  <body>
    <p style="margin-top: 0; margin-bottom: 0">
      <font face="Lucida Grande" size="3">OK&#44; I was thinking about just changing the group membership back to staff&#44; but I guess deleting it from the admin group would probably be the right move&#44; since in OD they are already staff with their directory UID and GID.</font>    </p>
<br>      
    <p style="margin-top: 0; margin-bottom: 0">
      <font face="Lucida Grande" size="3">As for the policy thing&#44; this is our second year in a 1:1 and yes there are changes&#44; but like many things in our government&#44; there is a process. &nbsp;It is getting better&#44; and next year will be even better because I have learned a lot from my users. &nbsp;I have learned to never ever trust a teenager with technology&#44; hahahahahahaha. &nbsp;</font>    </p>
<br>      
    <p style="margin-top: 0; margin-bottom: 0">
      <font face="Lucida Grande" size="3">I will do some tinkering&#44; but it would be nice to maybe have some flexibility with Casper on something like this. &nbsp;I think that large educational deployments would love it&#44; and probably most enterprise business ones. &nbsp;</font>    </p>
<br>      
    <p style="margin-top: 0; margin-bottom: 0">
      <font face="Lucida Grande" size="3">As for my local admin accounts&#44; they all live in /private/var so I can sudo rm -rf /Users/&#42; all day and it wouldn&#39;t affect my local admin accounts. &nbsp;</font><br><br>&gt;&gt;&gt; &quot;Miles Leacy&quot; &lt;miles.leacy@themacadmin.com&gt; 12/09/08 2:42 PM &gt;&gt;&gt;<br>I don&#39;t believe there is a Casper way &#40;other than scripting&#44; adding the script to the JSS and creating a policy&#41; to do what you describe.&nbsp;&#160;In order to delete an account using the accounts tab you need to know the short name of the account.    </p>
    <div content="text/html; charset=UTF-8" http-equiv="Content-Type">
      <p style="margin-top: 0; margin-bottom: 0">
        <br>
              </p>
    </div>
    <div>
      <p style="margin-top: 0; margin-bottom: 0">
        The script you shared seems like the way to go.&nbsp;&#160;You&#39;ll still need to demote any unauthorized admins.&nbsp;&#160;You can adapt your script to do that.&nbsp;&#160;I&#160;believe&#160;the&#160;operative bit will be:<br><br>      </p>
    </div>
    <div>
      <p style="margin-top: 0; margin-bottom: 0">
        dscl . delete /Groups/admin GroupMembership &lt;shortname&gt;      </p>
    </div>
    <div>
      <p style="margin-top: 0; margin-bottom: 0">
        <br>
              </p>
    </div>
    <div>
      <p style="margin-top: 0; margin-bottom: 0">
        You can loop through /Users&#44; as in your script.&nbsp;&#160;It is possible that someone may have been smart enough to move their home directory&#44; so I might want to look into looping through the local directory service instead of the /Users folder.      </p>
    </div>
    <div>
      <p style="margin-top: 0; margin-bottom: 0">
        <br>
              </p>
    </div>
    <div>
      <p style="margin-top: 0; margin-bottom: 0">
        Change &#36;keep to your local admin account&#44; and remove the numbered account exclusion since you want to catch &quot;08jdoe&quot; if it is an admin account.      </p>
    </div>
    <div>
      <p style="margin-top: 0; margin-bottom: 0">
        <br>
              </p>
    </div>
    <div>
      <p style="margin-top: 0; margin-bottom: 0">
        As far as not being the boss&#44; I think most of us are in or have been in that situation.&nbsp;&#160;I suggest getting to know the person/people who &#42;are&#42; the bosses.&nbsp;&#160;Write up sensible policies and get the boss&#40;es&#41; to sign them.&nbsp;&#160;I mean print them out and have them actually put a pen to paper.&nbsp;&#160;A policy document signed by the CIO/Dean/Director/Boss holds more weight than you or I do.      </p>
    </div>
    <div>
      <p style="margin-top: 0; margin-bottom: 0">
        <br>
              </p>
    </div>
    <div>
      <p style="margin-top: 0; margin-bottom: 0">
        This also gives you a great&#44; socially acceptable way out of confrontational situations where users demand something out of scope.&nbsp;&#160;With such a signed policy&#44; you should be held to it as well&#44; since the boss approved it.&nbsp;&#160;Then when you&#39;re asked to violate it&#44; you can simply say that you&#39;re not authorized to grant the request.&nbsp;&#160;Provide them with a copy of the policy document and tell them that this policy was enacted by &quot;The Boss&quot; &#40;whomever signed the document&#41;.&nbsp;&#160;If that doesn&#39;t stop them from trying to get you to violate the policy&#44; you can say something to the effect of &quot;I understand&#44; technology should serve the goals of the organization.&nbsp;&#160;If you feel strongly that an exception or change to the policy is required in this case&#44; I can schedule a time when we can meet with &quot;The Boss&quot; to discuss it.&quot;&nbsp;&#160;I&#39;ve found that most of the time&#44; this ends the discussion.      </p>
    </div>
    <div>
      <p style="margin-top: 0; margin-bottom: 0">
        <br>
              </p>
    </div>
    <div>
      <p style="margin-top: 0; margin-bottom: 0">
        <br>
              </p>
    </div>
    <div>
      <p style="margin-top: 0; margin-bottom: 0">
        ----------<br>Miles A. Leacy IV<br><br>&#63743; Certified System Administrator 10.4<br>&#63743; Certified Technical Coordinator 10.5<br>&#63743; Certified Trainer<br>Certified Casper Administrator<br>----------<br>voice: 1-347-277-7321<br><a href="mailto:miles.leacy@themacadmin.com">miles.leacy@themacadmin.com</a><br><a href="http://www.themacadmin.com">www.themacadmin.com</a><br><br><br><br><br>      </p>
      <div class="gmail_quote">
        <p style="margin-top: 0; margin-bottom: 0">
          2008/12/9 Thomas Larkin        </p>
        <div dir="ltr">
          <p style="margin-top: 0; margin-bottom: 0">
            &lt;<a href="mailto:tlarki@kckps.org">tlarki@kckps.org</a>&gt;          </p>
        </div>
        <p style="margin-top: 0; margin-bottom: 0">
          <br>
                  </p>
        <blockquote class="gmail_quote" style="border-left: 1px #ccc solid; margin-bottom: 0; padding-left: 0; margin-right: 0; margin-left: 0; margin-top: 0">
          <div>
            <p style="margin-top: 0; margin-bottom: 0">
              <font face="Lucida Grande" size="3">Well&#44; where to start....</font>            </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <br>
                          </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <font face="Lucida Grande" size="3">My environment is huge.&nbsp;&#160;Over 50 buildings&#44; over 30 servers over 6&#44;000 clients with most of them being Macbooks.&nbsp;&#160;It is a hassle to manage at times.&nbsp;&#160;I am not in charge of everything nor am I management&#44; so it puts me in a gray area at times when managing the client machines.&nbsp;&#160;We have local user accounts that have been created that I want gone&#44; however I am not sure what the names of those user accounts are.&nbsp;&#160;We had a password leak and some users promoted their own accounts to admin&#44; and I want to demote them.&nbsp;&#160;We have a naming convention that starts with their graduation year.&nbsp;&#160;So any user account under /Users that does not start with a number can be wiped&#44; with one exception&#44; the generic local account we created for local log ins just in case the network went down.&nbsp;&#160;That account is called student.&nbsp;&#160;I am trying to script something that will scan /Users and wipe out anything that does not start with a number.&nbsp;&#160;I got some help from a bit more advanced shell scripter than myself and came up with this so far:</font>            </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <br>
                          </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <font face="Lucida Grande" size="3">&#35;&#33; /bin/sh</font>            </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <br>
                          </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <font face="Lucida Grande" size="3">keep&#61;&quot;student&quot;</font>            </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <br>
                          </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <font face="Lucida Grande" size="3">cd /Users</font>            </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <font face="Lucida Grande" size="3">&#91;&#91; &#36;&#40;pwd&#41; &#33;&#61; &quot;/Users&quot; &#93;&#93; &amp;&amp; echo warning cd failed &amp;&amp; exit 2</font>            </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <br>
                          </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <font face="Lucida Grande" size="3">for a in &#91;&#94;0-9&#93;&#42; &#59; do &#35; only loop over names that doen&#39;t start with a number</font>            </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <font face="Lucida Grande" size="3">&#160;&#160;&#160;&#160;&#91;&#91; &quot;&#36;a&quot; &#61;&#61; &quot;&#36;keep&quot; &#93;&#93; &amp;&amp; continue &#35; skip that extra local account</font>            </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <font face="Lucida Grande" size="3">&#160;&#160;&#160;&#160;/usr/bin/dscl . -delete /Users/&#36;a &#35; get rid of it</font>            </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <font face="Lucida Grande" size="3">echo &#39;removing user files&#39;</font>            </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <br>
                          </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <font face="Lucida Grande" size="3">/bin/rm -rf /Users/&#36;a</font>            </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <br>
                          </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <font face="Lucida Grande" size="3">done</font>            </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <br>
                          </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <font face="Lucida Grande" size="3">I haven&#39;t had a lot of time to test it but it basically kills everything in /Users except those that start with a number.&nbsp;&#160;My next questions are&#44; is there a Casper solution to this&#44; and how can I demote local accounts with Casper from a local admin to a mobile or managed local user&#63;</font>            </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <br>
                          </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <font face="Lucida Grande" size="3">Thoughts&#63;</font>            </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <br>
                          </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <font face="Lucida Grande" size="3">Thanks for anyone brave enough to read this.</font>            </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <br>
                          </p>
            <p style="margin-top: 0; margin-bottom: 0">
              <font face="Lucida Grande" size="3">Tom</font>            </p>
          </div>
          <p style="margin-top: 0; margin-bottom: 0">
            <br>
            _______________________________________________<br>Casper mailing list<br><a href="mailto:Casper@list.jamfsoftware.com">Casper@list.jamfsoftware.com</a><br><a href="http://list.jamfsoftware.com/mailman/listinfo/casper" target="_blank">http://list.jamfsoftware.com/mailman/listinfo/casper</a><br><br>          </p>
        </blockquote>
      </div>
      <p style="margin-top: 0; margin-bottom: 0">
        <br>
      </p>
    </div>
  </body>
</html>