+ Post New Thread
Results 1 to 4 of 4
Mac Thread, Tips on a spring clean for our Apple Mac Network in Technical; Hi Was wondering if I could get some tips on what other schools do when doing a spring clean of ...
  1. #1
    ranj's Avatar
    Join Date
    Feb 2006
    Location
    Birmingham
    Posts
    728
    Thank Post
    98
    Thanked 42 Times in 32 Posts
    Rep Power
    25

    Tips on a spring clean for our Apple Mac Network

    Hi

    Was wondering if I could get some tips on what other schools do when doing a spring clean of the Apple Mac Server.

    I am looking at simplier ways to do a cleanup of old accounts on our Open directory system on our Apple Macs.

    I have noticed when I delete a user in workgroup manager it doesnt delete the user Home Directory.

    Is there a way I can delete a user and it also deletes their home directory?

    Thanks

  2. #2

    Join Date
    Jun 2010
    Location
    worcestershire
    Posts
    3
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    I wouldn't mind finding out myself.

    Currently I run the gauntlet of manually deleting the HomeFolders off my RAID, which is very dull indeed. (after a full Retrospect backup obviously). It would be so much easier if we could get rid of all the student folders but we have to keep students who re-enroll for a further year.

    I've helped things a bit by creating the shortname of each user to include their WGM UID at the start, whilst keeping the long Studio ID card number as their login name. This does help with the searching of folders but still not great.

    Would be good to know if there's a quicker way.

  3. #3

    Join Date
    May 2006
    Location
    West Bromwich
    Posts
    2,190
    Thank Post
    299
    Thanked 215 Times in 185 Posts
    Rep Power
    56
    Having read this, it spurned me on to take a little look into it. I don't know if you guys have delved into this yourself. If so and you accomplished this how did you do it?
    If not then this next little bit of info may be of interest...

    Using the dscl command against an Active Directory server in the Directory Utilities search path (not sure if you have an integrated setup), you can extract certain information. We will look up the value given to the userAccountControl attribute. This attribute seems to be given a value of 514 if the account is disabled.

    Code:
    dscl /Active\ Directory/All\ Domains/ -read /Users/"Name of an AD Account" userAccountControl
    Replace name of an AD account with a real account name found in your AD.

    This will list the value of the userAccountControl for the user specified.

    It also seems that the dscl command can take variables. So in theory we could look up the account in the AD using the dscl command and if the value = 514 then we could assume the account is disabled and remove/move the home dir.

    I have a bit of an idea on how to go about this. I am not a brilliant coder/scripter though so there maybe an easier way.

    We could export the users into a csv file and then create a variable using the username array and feed it into the dscl command where we could list the values of each user's userAccountControl value. Using an if/then ? command we could see if the values match 514 and remove the home dirs.

    Sound feasible?
    Last edited by HodgeHi; 9th September 2010 at 02:23 PM.

  4. #4
    rolfea's Avatar
    Join Date
    Nov 2008
    Location
    Hereford
    Posts
    682
    Thank Post
    66
    Thanked 50 Times in 25 Posts
    Rep Power
    21
    Quote Originally Posted by HodgeHi View Post
    Having read this, it spurned me on to take a little look into it. I don't know if you guys have delved into this yourself. If so and you accomplished this how did you do it?
    If not then this next little bit of info may be of interest...

    Using the dscl command against an Active Directory server in the Directory Utilities search path (not sure if you have an integrated setup), you can extract certain information. We will look up the value given to the userAccountControl attribute. This attribute seems to be given a value of 514 if the account is disabled.

    Code:
    dscl /Active\ Directory/All\ Domains/ -read /Users/"Name of an AD Account" userAccountControl
    Replace name of an AD account with a real account name found in your AD.

    This will list the value of the userAccountControl for the user specified.

    It also seems that the dscl command can take variables. So in theory we could look up the account in the AD using the dscl command and if the value = 514 then we could assume the account is disabled and remove/move the home dir.

    I have a bit of an idea on how to go about this. I am not a brilliant coder/scripter though so there maybe an easier way.

    We could export the users into a csv file and then create a variable using the username array and feed it into the dscl command where we could list the values of each user's userAccountControl value. Using an if/then ? command we could see if the values match 514 and remove the home dirs.

    Sound feasible?
    It sounds great, however if you have students that have their accounts disable because of misuse this plan could go a little bit wrong...

    I was experimenting on a test network using passenger to create all the home areas in yearly folders;

    Year 10 folder = Year 10 areas
    Year 9 folder = Year 9 area
    etc

    Then just delete one folder with all the areas.

    I have had them time to finish this though, so I can't say it WILL work.

SHARE:
+ Post New Thread

Similar Threads

  1. Thomas Spring Clean!
    By Tcsltd in forum Our Advertisers
    Replies: 0
    Last Post: 15th April 2010, 10:20 AM
  2. Spring Clean
    By SimpleSi in forum General Chat
    Replies: 34
    Last Post: 27th January 2010, 11:42 AM
  3. AD Clean Up Tips
    By RobFuller in forum Windows
    Replies: 14
    Last Post: 11th January 2008, 11:11 PM
  4. How to punish an Apple Mac
    By Roberto in forum Mac
    Replies: 1
    Last Post: 18th September 2006, 11:00 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •