Script to delete user accounts on mac

I am looking for a script that will delete user profiles on mac clients. Such as there home folders and any other clutter that is made when they logon. Since all users logon with there AD account and save to a servver. I am hopign to clean up stuff that's made on the client macs. all my labs are tiger except for one that is panther. Any one have a script that could be ran via ard or could be ran after the user logs off. My mac server that manages the labs is a leopard server. If that helps I just noticed if i delete folders under users on my panterh lab that users are able to logon other wise some times they seam to hang at logon.

I don't know if you will appreciate this answer or not, but have you considered upgrading to Leopard? Leopard has a guest account feature. The guest account is cleared of all user data and erased on logout, and then re-created fresh on the next login.

Similar Messages

  • How to permanently/manually delete User Account on MAC OS X 10.6.8

    Hi There,
    Can you please assist with providing instructions on how to manually delete USER accounts on MAC OS X 10.6.8.  Everyone but one user (who's account was deleted) can not log into the damain device.  As a test I tried to add a new user accout with the same name as before and even though nothing existing in the USERS folder; it states that a duplicate name exists.
    How do I delete that duplicate?  Where could that be located?
    Please let me know,
    Sonia

    Solution!
    Command to locate the hidden User Profile:
    dscl . list /users
    Command to delete the now found hidden User Profile:
    sudo dscl . delete /users/<userID>
    Thanks,
    SoniaCP

  • Can't Delete User Account - On Mac Os X Server

    Hi, I am running Server v 2.2.1 on Mountain Lion 10.8.3 (I don't see a community set up for this new server software so I'm asking here)
    I just created a user  account in the server but made a mistake and for some reason it won't let me delete the account.
    Clicking on the little minus box does nothing and when I go into the "edit user" everything is greyed out accept for the "Administer the server" checkbox.
    Other accounts I've created don't have this issue so I'm not sure what is going on.
    Is there a way to delete this account? Maybe from the Terminal?
    Any help would be greatly appreciated.
    Thanks.

    I figured it out. For some reason there was no admin write access to the User folders.

  • New Macbook Air setup problem with deleting user account

    I recently changed from a MBP to a MBA and upon completing my migration data from old mac to new one I had an extra user account. So I have my admin account and a guest account and a third account that I don't want. Upon trying to delete this account it show "deleting user account and home folder" but it has been doing this for more than an hour therefore it will not let me exit system preferences. Any help on this?

    I'm not sure I understand what you mean by "need configuration data ... " However, if both computers are on your network then you should be able to synchronize various files or folders using backup software. However, to start you will need to enable File Sharing on one of the computers.
    For help with this select Mac Help from the Finder's Help menu. Search for "file sharing." You should find several links on how to configure it on your computer. Also see Mac 101- File sharing and Tutorial- File sharing in OS X - MacFixIt.
    Once file sharing is set up you can then try a backup utility to do the synching. Most backup utilities not only do backups but can also be configured to synchronize files and/or folders. Here are some possibilities:
    Backup Software Recommendations
    1. Synchronize! Pro X (Commercial)
    2. Synk (Backup, Standard, or Pro)
    3. Deja Vu (Shareware)
    4. Carbon Copy Cloner (Donationware)
    5. Data Backup (Commercial)
    6. SilverKeeper 2.0 (Freeware)
    7. Tri-Backup (Commercial)
    8. SyncTwoFolders (Freeware)
    9, Data Lore (Commercial - exclusively for network file transfers over Bonjour.)
    Others may be found at VersionTracker or MacUpdate.
    Visit The XLab FAQs and read the FAQ on backup and restore. Also read How to Back Up and Restore Your Files.
    Hope this helps get you started.

  • Powershell Script to delete ADComputer Accounts

    Hi There,
    I have this script which deletes a computer account from AD if found but my problem now is it throws an error " Cannot find an object property " if the account doesnt exist. I read somewhere of using the try catch and others saying its not
    advisable within a if else block.
    Any help will be appreciated. Thanks
    #Script to Delete Computer Accounts.
    $CptName = Read-host "Which computer accounts do you want to delete"
    #Get-Adcomputer $CptName
    If ($cptName -eq $Null)
     Write-Host " This accounts does not exist " 
    Else
     Remove-ADComputer -Identity $CptName
     Write-host "This computer accounts has been successfully deleted"

    Thx for the help link.
    Finally got it to work by using the try catch
    Code is:
    try
       $CptName = Read-host "Which computer accounts do you want to delete"
       Remove-ADComputer -Identity $CptName
       Write-host "This computer accounts has been successfully deleted"
    catch
     Write-Warning " This accounts does not exist " 

  • Can't delete user account with open shopping cart

    Hi all,
    Is it okay to delete user account with open shopping cart? I can't delete user by users_gen, it says existing partner document. I then applied notes 1148837,report PARTNER_SET_DELETE. And this report doesn't really work. I ran it and it found zero occurrnences. Is anybody using this report?
    So is it the only way to delete user from SRM is by su01 and leave some informations on Busines partner (bp)
    Thanks,
    Kev

    Hi. You can easily lock the user and change the validity dates using SU01.
    Then, I would write a program that looks through all locked users and checks their valdity dates. Table USR02 holds all this data.
    Then, if the user is locked and the validity end date was 3 or 6 or whatever months ago (make this a selection parameter probably), then you know you want to delete this user.
    So, go into table HRP1001 where SCLAS = US and SOBID = user name and OTYPE = CP and get field OBJID. This is the central person (CP) number.
    Then, go into table HRP1001 again, this time where SCLAS = BP  and OTYPE = CP and OBJID = the CP number and get field SOBID. This is the business partner (BP) number.
    Now, run function BAPI_USER_DELETE to delete the SU01 user fully, then function HR_CENTRALPERSON_DELETE to delete the central person, then function BUP_BUPA_DELETE to delete the business partner.
    And that should delete everything.
    Regards,
    Dave.

  • Deleting user accounts

    Is there an automated way to delete user accounts on a regular basis through Apple Remote Desktop

    Well you can issue a send unix command or set ARD to regulary send a unix command. The complecity of that unix command is really up to what you can find, hire, or can write yourself.
    If your accounts are coming from an Open Directory or Active Directory, you can configure the account to be 'mobile accounts.' At witch point you can set mobile accounts to expire after x time of inactivty.
    But why do you want to delete accounts? what about the risk of deleting files a user wants / needs.

  • How to find who deleted user account

    Hi there,
    I need help from Security Specialists to find out who deleted user account in past in a R/3 46C system.
    I have already tried below methods and checked previous posts in this forum but no use -
    1. SUIM
    2. SM20
    3. SM21
    4. Report RSTBHIST
    5. ST03
    6. STAT
    7. SECR
    8. SM19
    Thanks in advance.

    Thanks Ben,
    I tried and got output as below -
    Clien     User     Modificati   Modifica   Changed by    PROFS
      900          304902       03.02.2007   15:11:23   107901            D
      900          304902       15.05.2007   13:39:42    AMOL            C ZRFCCPIC__
      900          304902         08.06.2007   12:28:56   AMOL            M FSTSTKCOUN  ZRFCCPIC__
    Which means user was last deleted on 03/02 by 107901 and then I recreated it on 15/05 and maintained on 08/06.
    But again today I found this user missing and thats the reason I 'm desparately looking for delete log.
    I didnt find latest deletion log anywhere.

  • Apple Configurator - 1.2 (Delete User Account while Checked Out)

    Hi Community,
    I have a supervised iPad that was checked out to a particular user. The user account in apple configurator was deleted while checked out. The iPad is now unavailable to check out because it is permanently checked out to the deleted user account.
    I reset and deleted all information on the iPad but since it is supervised it comes right back to the point I checked it out (which I really like). But in this situation how to I get that user off...because I can't check it back in and currently can't use it for anyone else. 
    Thanks!

    I attempted to, but if a device is checked out to a user the unsupervise option isn't available. This is only because I believe the device was checked out and the user it was checked out to was deleted. Normally if there wasn't a user checked out to the device unsupervise would be available. 

  • Not Enough Hard Drive Space on my Mac Mini to Save Deleted User Account Folder: What to do?

    I am no longer able to access my original user account on my mac mini because the account is corrupted and won't load. Thanks to the helpful advice I found on the internet, I was able to create a new user account and resume using my mac, but all of my old files are trapped in the old user account.
    The plan was to delete the old user account, create a disk image of the old account folders, and then migrate those folders to the new user account. Unfortunately, I don't have enough disc space left on my Mac to do that. I have just under 11gb left after deleting absolutely everything I could, and I need 81gb for the old user files. The back up plan was to select the "don't change the home folder" option, but when I went to delete the account, there was no such option. The message simply read:
    "The user's home folder will not be saved. To do so, you need 81.1gb of free disk space. Try emptying the trash or deleting other files on your disk, then deleting the user account. If you do not want to save the user's home folder, click delete immediately."
    My only two choices were CANCEL or DELETE IMMEDIATELY. There was no "don't change the home folder" option.
    So I am not sure how to proceed. Here are some questions:
    1) is there a way to save the disk image directly to an external drive instead of the user's folder on the mac hard drive?
    2) If I use the "delete immediately" option, will the files go into a "deleted users" folder where they can be recovered or will they just be erased from the computer and unretrievable?
    3) Is there a way to use terminal to change access permission on the original user account files so that I can copy them onto an external drive or integrate them with the new user account without having to first delete the original user account?
    4) In the absence of deleting the user account, will using either:
    sudo chown -R `id -un` /Users/oldusername
    and/or
    sudo chmod -R u+rw /Users/oldusername
    in Terminal allow the new user account permission to access the original user files and merge them seamlessly into my new user account? Or must I delete the original account first?
    5) Is there something else I haven't thought of that would work, would be more efficient, or more effective? This wouldn't be the first time I have overthought a solution...
    When considering any solutions, please keep in mind that I cannot launch the original user account as that starts the whole endless loading loop. So, while I have the password for the original user account, any solution would appear to require that I work from the new user account only, without launching the old account.  Also I am a complete newbie at this. I've used Macs exclusively for 17 years but this is the first time I've had to do anything like this. Up to now, everything has always "just worked".  So please be as detailed with any instructions as possible!
    Any help greatly appreciated.  Thanks!
    Mac Mini 2ghz 1g ram running OS 10.4.11

    I think ComputerFixer is correct, you should be able to drag and drop it to another drive, no worries. However, if not, you could create an disk image of it using DiskUtility and create it on a new drive. But again, I don't think that is necessary. If you have administrator rights with your new account, can you simply go into the old user account folder and drag and drop the files you want to save? I have done that as well as copy the older user account to another drive (in my case, another computer on the network) and salgage my files from there. Is that an option for you?

  • Mac OS X maintenance scripts and multiple user accounts

    Hi everyone
    Just wondering how the default maintenance scripts scheduled to run in the early morning works with multiple user accounts. Our Macs at home all have multiple user accounts (one for each of us) and I'm wondering whether the scripts work their magic across all accounts (assuming the computer itself is switched on AND not asleep).
    Also, is the behaviour the same regardless of Mac OS X version? More specifically we're using snow leopard, lion, mountain lion, and maybe shortly mavericks.
    Thanks!
    Joe.

    The maintenance scripts run by periodic perform system tasks. They do nothing in a user's account (unless you modify the scripts or create your own). They are primarily designed for long lived systems (servers). There isn't any magic nor would a normal mac users find any differences whether they ran or not.
    In all the operating system versions that you mention, the scripts will run when the computer wakes, assuming that the computer was turned on before the prescribe times.

  • Script to delete user profiles

    I am looking for a script that could be ran either by logout or via ARD . The script needs to delete all user profiles stored on the local mac. except for the admin account and ladmin also an admin account Since all users have an AD account there is no need to keep the users profile. I tried to find a script but no luck I know almost nothing about apple scripts so I am lost. all mac computers are either tiger or panther. All mac clients are managed via a Lepord server also if that helps

    I am looking for a script that could be ran either by logout or via ARD . The script needs to delete all user profiles stored on the local mac. except for the admin account and ladmin also an admin account Since all users have an AD account there is no need to keep the users profile. I tried to find a script but no luck I know almost nothing about apple scripts so I am lost. all mac computers are either tiger or panther. All mac clients are managed via a Lepord server also if that helps

  • Itunes libraries on new user account on Mac

    Hi everyone, got a complicated one for you, or I think so.  I bought my Mac from a relative.  I set up users for all the family but I kept his user account and just changed it to be mine as an administrator.  All was fine and managed to transfer my itunes data and sync my iphone and then it was the primary itunes library for it.  But as time went on I was fed up having his name appear on the system when it should have been mine as I now owned it so I created a new administrator/user account for me and deleted his.  Worked fab. 
    But then I tried to sync my iphone and it wont do it.  It comes up with the message that my iphone is already associated/synced with an itunes library on the Mac and can only be associated with one library.  The problem is I have no idea what to do now.  Ive deleted the old user account, ive no idea where I can find out where on the Mac that library is etc etc.  I have tried to transfer purchases from the iphone onto the Mac but it only picks up a very small amount of the music I ave on it.  Can anyone help please.  Hope this makes sense and thank you in advance.  Operating OS X 10.9.2

    The library was in the user account you deleted.  You should have transferred the iTunes folder before deleting the account.
    Your i-device was not designed for unique storage of your media. It is not a backup device and media transfer was planned with you maintaining a master copy of your media on a computer which is itself properly backed up against loss.  To use a device with a new computer you transfer the content from the old computer (or its backup) directly to the new computer, not the device to the new computer. Syncing is one way, computer to device, updating the device content to the content on the computer, not updating or restoring content on a computer. The exception is iTunes Store purchases which can be transferred to a computer.
    iTunes Store: Transferring purchases from your iOS device or iPod to a computer - http://support.apple.com/kb/HT1848 - only purchases from iTunes Store
    For transferring other items from an i-device to a computer you will have to use third party commercial software.  See this document by turingtest2: Recovering your iTunes library from your iPod or iOS device - https://discussions.apple.com/docs/DOC-3991

  • Migrate my Suse Linux users account  to mac os x moutain lion?

    Can someone tell me how to migrate my Suse Linux user accounts, including mail, to mac os x moutain lion?

    You need write a script to map your /etc/passwd database to the values in MacOS. Use the dscl command like here: http://www.deadmarshes.com/Blog/20111105010130.html or here: http://hintsforums.macworld.com/showthread.php?t=141798
    You can't take the /etc/shadow, because MacOS encrypts the passwords other than Linux.
    Your users need to change their password:
    - via Webinterface from Mountain Lion
    - or via Server.app
    - or on a linux client using the OpenDirectory (LDAP) from ML
    Each mail user needs to belong to the group com.apple.access_mail. You can configure with ML-tools any forwards. Tools: Server.app (Appstore), WorkGroupManager (http://support.apple.com/kb/dl1567)
    I'm migrated/migrating my users from Solaris LDAP. I'm using this technology.
    Migrating the Mail system is an other task.

  • Import mail from deleted user account

    I created a new administrator account on my mac mini and deleted the old one but chose to retain all of the user folders and files.
    I would like to go back and import mail messages from a pop mail account in the deleted user library, but can not navigate
    to the library when mail asks for the location of the files to import.  Is it possible to find those files?

    Never did find a solution to this. However because we are using IMAP accounts most of the mail was cached on the client Macs. So I offlined them, loaded Mail, copied all the mail into local mailboxes, recreated the users, went online and copied the mail back into the new hierarchy.
    Still can't believe I did such a daft thing!

Maybe you are looking for