I don&#39;t believe there is a Casper way (other than scripting, adding the script to the JSS and creating a policy) to do what you describe. &nbsp;In order to delete an account using the accounts tab you need to know the short name of the account.<div>
<br></div><div>The script you shared seems like the way to go. &nbsp;You&#39;ll still need to demote any unauthorized admins. &nbsp;You can adapt your script to do that. &nbsp;I&nbsp;believe&nbsp;the&nbsp;operative bit will be:<br><br></div><div>dscl . delete /Groups/admin GroupMembership &lt;shortname&gt;</div>
<div><br></div><div>You can loop through /Users, as in your script. &nbsp;It is possible that someone may have been smart enough to move their home directory, so I might want to look into looping through the local directory service instead of the /Users folder.</div>
<div><br></div><div>Change $keep to your local admin account, and remove the numbered account exclusion since you want to catch &quot;08jdoe&quot; if it is an admin account.</div><div><br></div><div>As far as not being the boss, I think most of us are in or have been in that situation. &nbsp;I suggest getting to know the person/people who *are* the bosses. &nbsp;Write up sensible policies and get the boss(es) to sign them. &nbsp;I mean print them out and have them actually put a pen to paper. &nbsp;A policy document signed by the CIO/Dean/Director/Boss holds more weight than you or I do.</div>
<div><br></div><div>This also gives you a great, socially acceptable way out of confrontational situations where users demand something out of scope. &nbsp;With such a signed policy, you should be held to it as well, since the boss approved it. &nbsp;Then when you&#39;re asked to violate it, you can simply say that you&#39;re not authorized to grant the request. &nbsp;Provide them with a copy of the policy document and tell them that this policy was enacted by &quot;The Boss&quot; (whomever signed the document). &nbsp;If that doesn&#39;t stop them from trying to get you to violate the policy, you can say something to the effect of &quot;I understand, technology should serve the goals of the organization. &nbsp;If you feel strongly that an exception or change to the policy is required in this case, I can schedule a time when we can meet with &quot;The Boss&quot; to discuss it.&quot; &nbsp;I&#39;ve found that most of the time, this ends the discussion.</div>
<div><br></div><div><br></div><div>----------<br>Miles A. Leacy IV<br><br> Certified System Administrator 10.4<br> Certified Technical Coordinator 10.5<br> 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><div class="gmail_quote">2008/12/9 Thomas Larkin <span dir="ltr">&lt;<a href="mailto:tlarki@kckps.org">tlarki@kckps.org</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

  
    
    
  
  <div>
    <p style="margin-bottom:0;margin-top:0">
      <font face="Lucida Grande" size="3">Well, where to start....</font>    </p>
<br>      
    <p style="margin-bottom:0;margin-top:0">
      <font face="Lucida Grande" size="3">My environment is huge. &nbsp;Over 50 buildings, over 30 servers over 6,000 clients with most of them being Macbooks. &nbsp;It is a hassle to manage at times. &nbsp;I am not in charge of everything nor am I management, so it puts me in a gray area at times when managing the client machines. &nbsp;We have local user accounts that have been created that I want gone, however I am not sure what the names of those user accounts are. &nbsp;We had a password leak and some users promoted their own accounts to admin, and I want to demote them. &nbsp;We have a naming convention that starts with their graduation year. &nbsp;So any user account under /Users that does not start with a number can be wiped, with one exception, the generic local account we created for local log ins just in case the network went down. &nbsp;That account is called student. &nbsp;I am trying to script something that will scan /Users and wipe out anything that does not start with a number. &nbsp;I got some help from a bit more advanced shell scripter than myself and came up with this so far:</font>    </p>

<br>      
    <p style="margin-bottom:0;margin-top:0">
      <font face="Lucida Grande" size="3">#! /bin/sh</font>    </p>
<br>      
    <p style="margin-bottom:0;margin-top:0">
      <font face="Lucida Grande" size="3">keep=&quot;student&quot;</font>    </p>
<br>      
    <p style="margin-bottom:0;margin-top:0">
      <font face="Lucida Grande" size="3">cd /Users</font>    </p>
    <p style="margin-bottom:0;margin-top:0">
      <font face="Lucida Grande" size="3">[[ $(pwd) != &quot;/Users&quot; ]] &amp;&amp; echo warning cd failed &amp;&amp; exit 2</font>    </p>
<br>      
    <p style="margin-bottom:0;margin-top:0">
      <font face="Lucida Grande" size="3">for a in [^0-9]* ; do # only loop over names that doen&#39;t start with a number</font>    </p>
    <p style="margin-bottom:0;margin-top:0">
      <font face="Lucida Grande" size="3">&nbsp;&nbsp;&nbsp;&nbsp;[[ &quot;$a&quot; == &quot;$keep&quot; ]] &amp;&amp; continue # skip that extra local account</font>    </p>
    <p style="margin-bottom:0;margin-top:0">
      <font face="Lucida Grande" size="3">&nbsp;&nbsp;&nbsp;&nbsp;/usr/bin/dscl . -delete /Users/$a # get rid of it</font>    </p>
    <p style="margin-bottom:0;margin-top:0">
      <font face="Lucida Grande" size="3">echo &#39;removing user files&#39;</font>    </p>
<br>      
    <p style="margin-bottom:0;margin-top:0">
      <font face="Lucida Grande" size="3">/bin/rm -rf /Users/$a</font>    </p>
<br>      
    <p style="margin-bottom:0;margin-top:0">
      <font face="Lucida Grande" size="3">done</font>    </p>
<br>      
    <p style="margin-bottom:0;margin-top: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;My next questions are, is there a Casper solution to this, and how can I demote local accounts with Casper from a local admin to a mobile or managed local user?</font>    </p>

<br>      
    <p style="margin-bottom:0;margin-top:0">
      <font face="Lucida Grande" size="3">Thoughts?</font>    </p>
<br>      
    <p style="margin-bottom:0;margin-top:0">
      <font face="Lucida Grande" size="3">Thanks for anyone brave enough to read this.</font>    </p>
<br>      
    <p style="margin-bottom:0;margin-top:0">
      <font face="Lucida Grande" size="3">Tom</font>
    </p>
  </div>

<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></blockquote></div><br></div>