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

Similar Messages

  • Script to delete users profile only months old profile with the Registry itself but should leave current profile intact.

    Hi every one.
    first of all sry if this post is repetitive for the profile deletion.
    If you have a correct link please post it below or the script itself.
    Question: as i have a lot of computers with windows 7 (2400 systems) as the operating system on them and as the users keep on changing or shifting place from one PC to another PC and managing the system or the C drive for the consistent system performance
    or freeing space is a challenging task.
    I would like have a Script that would only delete old (No of Months) profile as well as the registry itself  but should keep the current profile instanct the the registry too.
    I did find the below script on some forum that gets the job done but not the right way as it deletes all the profile and excludes the admin,administrator etc as seen in the script but i cannot delete the old profile of a certain time or date period.
    As again sorry if this post looks like mess but help is appreciated 
    @echo off
    ' DELETES LOCAL PROFILES ON WINDOWS 7
    :START
    FOR /f "tokens=*" %%a IN ('dir c:\USERS /b /ad') DO CALL :PATHCHECK "%%a"
    GOTO REGISTRY
    ::The following is where you would put in the profile you wish to exclude from the wipe. Just copy/paste a line and make the appropriate revisions.
    :PATHCHECK
    IF /i [%1]==["Administrator"] GOTO :PATHSKIP
    IF /i [%1]==["Admin"] GOTO :PATHSKIP
    IF /i [%1]==["All Users"] GOTO :PATHSKIP
    IF /i [%1]==["Default"] GOTO :PATHSKIP
    IF /i [%1]==["Default user"] GOTO :PATHSKIP
    IF /i [%1]==["public"] GOTO :PATHSKIP
    GOTO PATHCLEAN
    :PATHSKIP
    ECHO. Skipping path clean for user %1
    GOTO :EOF
    :PATHCLEAN
    ECHO. Cleaning profile for: %1
    rmdir C:\USERS\%1 /s /q > NUL
    IF EXIST "C:\USERS\%1" GOTO RETRYPATHFIRST
    IF NOT EXIST "C:\USERS\%1" GOTO :EOF
    :RETRYPATHFIRST
    ECHO. Error cleaning profile for: %1 - Trying again.
    rmdir C:\USERS\%1 /s /q > NUL
    IF EXIST "C:\USERS\%1" GOTO RETRYPATHSECOND
    IF NOT EXIST "C:\USERS\%1" GOTO :EOF
    :RETRYPATHSECOND
    ECHO. Error cleaning profile for: %1 - Trying again.
    rmdir C:\USERS\%1 /s /q > NUL
    GOTO :EOF
    :REGISTRY
    ECHO.------------
    FOR /f "tokens=*" %%a IN ('reg query "hklm\software\microsoft\windows nt\currentversion\profilelist"^|find /i "s-1-5-21"') DO CALL :REGCHECK "%%a"
    GOTO VERIFY
    ::The following is where it parses the registry data and checks it against the user path. Copy/paste the IF line and make the user modification needed.
    :REGCHECK
    FOR /f "tokens=3" %%b in ('reg query %1 /v ProfileImagePath') DO SET USERREG=%%b
    IF /i [%USERREG%]==[c:\Users\Administrator] GOTO :REGSKIP
    GOTO REGCLEAN
    :REGSKIP
    ECHO. Skipping registry clean for %USERREG%
    GOTO :EOF
    :REGCLEAN
    ECHO. Cleaning registry for: %USERREG%
    reg delete %1 /f
    GOTO :EOF
    ::The cleaning portion of the script is now done. Now begins the verification and log reporting.
    :VERIFY
    FOR /f "tokens=*" %%c IN ('dir c:\USERS /b /ad') DO CALL :VERIFYPATH "%%c"
    ::Same thing as the clean - if you need to exclude an account, make your copy/paste below.
    :VERIFYPATH
    IF /i [%1]==["Administrator"] GOTO :EOF
    IF /i [%1]==["All Users"] GOTO :EOF
    IF /i [%1]==["Default"] GOTO :EOF
    IF /i [%1]==["Default user"] GOTO :EOF
    IF /i [%1]==["public"] GOTO :EOF
    GOTO VERPATHREPORT
    :VERPATHREPORT
    ECHO. %1
    IF /i [%1]==[] (
    set PATHRESULT=PATH_SUCCESS
    ) ELSE (
    set PATHRESULT=PATH_FAILURE
    ECHO. %PATHRESULT%
    GOTO REGVERIFY
    :REGVERIFY
    ECHO.------------
    FOR /f "tokens=*" %%d IN ('reg query "hklm\software\microsoft\windows nt\currentversion\profilelist"^|find /i "s-1-5-21"') DO CALL :REGCHECKVERIFY "%%d"
    GOTO REGVERIFYECHO
    ::Same thing as the registry clean - copy/paste excluded profiles below.
    :REGCHECKVERIFY
    FOR /f "tokens=3" %%e in ('reg query %1 /v ProfileImagePath') DO SET USERREGV=%%e
    IF /i [%USERREGV%]==[c:\Users\Administrator] GOTO :EOF
    GOTO REGVERIFYECHO
    :REGVERIFYECHO
    ECHO. %1
    IF /i [%1]==[] (
    set REGRESULT=REG_SUCCESS
    ) ELSE (
    set REGRESULT=REG_FAILURE
    ECHO. %REGRESULT%
    GOTO REPORTCHECK
    ::The following is where you would enter the mapped drive path.
    ::You can use a straight UNC if you like, but I find this to be a bit
    ::more solid and it allows you to use different creds in case you
    ::automate it for a local scheduled task to run as local admin.
    :REPORTCHECK
    'net use t: \\server\path
    'IF EXIST "t:\labreport.txt" (
    'GOTO REPORTGEN
    ') ELSE (
    'GOTO EXIT
    ::This is a time/date stamp creator that I actually pulled from a Minecraft
    ::to Dropbox backup script I made a long while back.
    ':REPORTGEN
    'FOR /F "tokens=1 delims=:" %%f in ('time /T') DO SET T=%%f
    'FOR /F "tokens=*" %%g in ('echo %date:~10,4%-%date:~4,2%-%date:~7,2% %T%-%time:~3,2%-%time:~6,2%') DO SET TDATETIME=%%g
    ECHO. %PATHRESULT% %REGRESULT% %COMPUTERNAME% %TDATETIME% >> "t:\labreport.txt"
    net use t: /delete
    GOTO EXIT
    :EXIT
    exit
    :EOF

    Hi every one.
    first of all sry if this post is repetitive for the profile deletion.
    If you have a correct link please post it below or the script itself.
    Question: as i have a lot of computers with windows 7 (2400 systems) as the operating system on them and as the users keep on changing or shifting place from one PC to another PC and managing the system or the C drive for the consistent system performance
    or freeing space is a challenging task.
    I would like have a Script that would only delete old (No of Months) profile as well as the registry itself  but should keep the current profile instanct the the registry too.
    I did find the below script on some forum that gets the job done but not the right way as it deletes all the profile and excludes the admin,administrator etc as seen in the script but i cannot delete the old profile of a certain time or date period.
    As again sorry if this post looks like mess but help is appreciated 
    @echo off
    ' DELETES LOCAL PROFILES ON WINDOWS 7
    :START
    FOR /f "tokens=*" %%a IN ('dir c:\USERS /b /ad') DO CALL :PATHCHECK "%%a"
    GOTO REGISTRY
    ::The following is where you would put in the profile you wish to exclude from the wipe. Just copy/paste a line and make the appropriate revisions.
    :PATHCHECK
    IF /i [%1]==["Administrator"] GOTO :PATHSKIP
    IF /i [%1]==["Admin"] GOTO :PATHSKIP
    IF /i [%1]==["All Users"] GOTO :PATHSKIP
    IF /i [%1]==["Default"] GOTO :PATHSKIP
    IF /i [%1]==["Default user"] GOTO :PATHSKIP
    IF /i [%1]==["public"] GOTO :PATHSKIP
    GOTO PATHCLEAN
    :PATHSKIP
    ECHO. Skipping path clean for user %1
    GOTO :EOF
    :PATHCLEAN
    ECHO. Cleaning profile for: %1
    rmdir C:\USERS\%1 /s /q > NUL
    IF EXIST "C:\USERS\%1" GOTO RETRYPATHFIRST
    IF NOT EXIST "C:\USERS\%1" GOTO :EOF
    :RETRYPATHFIRST
    ECHO. Error cleaning profile for: %1 - Trying again.
    rmdir C:\USERS\%1 /s /q > NUL
    IF EXIST "C:\USERS\%1" GOTO RETRYPATHSECOND
    IF NOT EXIST "C:\USERS\%1" GOTO :EOF
    :RETRYPATHSECOND
    ECHO. Error cleaning profile for: %1 - Trying again.
    rmdir C:\USERS\%1 /s /q > NUL
    GOTO :EOF
    :REGISTRY
    ECHO.------------
    FOR /f "tokens=*" %%a IN ('reg query "hklm\software\microsoft\windows nt\currentversion\profilelist"^|find /i "s-1-5-21"') DO CALL :REGCHECK "%%a"
    GOTO VERIFY
    ::The following is where it parses the registry data and checks it against the user path. Copy/paste the IF line and make the user modification needed.
    :REGCHECK
    FOR /f "tokens=3" %%b in ('reg query %1 /v ProfileImagePath') DO SET USERREG=%%b
    IF /i [%USERREG%]==[c:\Users\Administrator] GOTO :REGSKIP
    GOTO REGCLEAN
    :REGSKIP
    ECHO. Skipping registry clean for %USERREG%
    GOTO :EOF
    :REGCLEAN
    ECHO. Cleaning registry for: %USERREG%
    reg delete %1 /f
    GOTO :EOF
    ::The cleaning portion of the script is now done. Now begins the verification and log reporting.
    :VERIFY
    FOR /f "tokens=*" %%c IN ('dir c:\USERS /b /ad') DO CALL :VERIFYPATH "%%c"
    ::Same thing as the clean - if you need to exclude an account, make your copy/paste below.
    :VERIFYPATH
    IF /i [%1]==["Administrator"] GOTO :EOF
    IF /i [%1]==["All Users"] GOTO :EOF
    IF /i [%1]==["Default"] GOTO :EOF
    IF /i [%1]==["Default user"] GOTO :EOF
    IF /i [%1]==["public"] GOTO :EOF
    GOTO VERPATHREPORT
    :VERPATHREPORT
    ECHO. %1
    IF /i [%1]==[] (
    set PATHRESULT=PATH_SUCCESS
    ) ELSE (
    set PATHRESULT=PATH_FAILURE
    ECHO. %PATHRESULT%
    GOTO REGVERIFY
    :REGVERIFY
    ECHO.------------
    FOR /f "tokens=*" %%d IN ('reg query "hklm\software\microsoft\windows nt\currentversion\profilelist"^|find /i "s-1-5-21"') DO CALL :REGCHECKVERIFY "%%d"
    GOTO REGVERIFYECHO
    ::Same thing as the registry clean - copy/paste excluded profiles below.
    :REGCHECKVERIFY
    FOR /f "tokens=3" %%e in ('reg query %1 /v ProfileImagePath') DO SET USERREGV=%%e
    IF /i [%USERREGV%]==[c:\Users\Administrator] GOTO :EOF
    GOTO REGVERIFYECHO
    :REGVERIFYECHO
    ECHO. %1
    IF /i [%1]==[] (
    set REGRESULT=REG_SUCCESS
    ) ELSE (
    set REGRESULT=REG_FAILURE
    ECHO. %REGRESULT%
    GOTO REPORTCHECK
    ::The following is where you would enter the mapped drive path.
    ::You can use a straight UNC if you like, but I find this to be a bit
    ::more solid and it allows you to use different creds in case you
    ::automate it for a local scheduled task to run as local admin.
    :REPORTCHECK
    'net use t: \\server\path
    'IF EXIST "t:\labreport.txt" (
    'GOTO REPORTGEN
    ') ELSE (
    'GOTO EXIT
    ::This is a time/date stamp creator that I actually pulled from a Minecraft
    ::to Dropbox backup script I made a long while back.
    ':REPORTGEN
    'FOR /F "tokens=1 delims=:" %%f in ('time /T') DO SET T=%%f
    'FOR /F "tokens=*" %%g in ('echo %date:~10,4%-%date:~4,2%-%date:~7,2% %T%-%time:~3,2%-%time:~6,2%') DO SET TDATETIME=%%g
    ECHO. %PATHRESULT% %REGRESULT% %COMPUTERNAME% %TDATETIME% >> "t:\labreport.txt"
    net use t: /delete
    GOTO EXIT
    :EXIT
    exit
    :EOF

  • Need a Script for Removing User Profiles in Windows 7

    I am in need of a script that will allow me to remotely delete user profiles from multiple computers. I am an IT Admin over around 15-20 computers that are publicly used by many different people each day, and at least once a month we have to go into each
    computer individually..my computer, properties, profiles and delete them one by one. This is growing very tedious due to manpower and the number of computers we have to do this on. 
    I have absolutely zero knowledge in the scripting department so could somebody point me in the right direction on this? I would like to have a script that i can just run once a month or so and say "delete all profiles from computers x y and z that are
    over a few months old." Is this possible? Thanks in advance!

    Try this link - http://superuser.com/questions/643417/delete-user-profile-from-command-line-windows-7
    https://social.technet.microsoft.com/Forums/scriptcenter/en-US/7663ea51-9f4e-4fd7-9946-e16e65c3ed9d/remove-windows-7-user-profiles-via-powershell-script-initiated-on-logoff?forum=ITCG
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • What is the best way to automatically delete user profiles after x days of inactivity (school lab environment)?

    I work at a school where we have multiple Mac Carts that have 30 MacBooks per cart. We image the macs every summer to delete the older user profiles but we are looking for way to possible have this done automatically through out the year to help with HDD space. What is the best way to delete user profiles after...say 180 days.... of inactivity automatically? I am open to login hooks, bash scripts, etc. Anything to get the job done. Thanks for any help or advice.

    A search here turned up this post Deleting inactive users
    It appears that the script posted will do as advertised though I would test it out on your systems and under your conditions to see if it does do what you need.
    regards
    Message was edited by: Frank Caggiano - That script looks for users over 21 days. To look for ones over 180 days change the 21 to 180 in the find command.

  • Delete user profiles on multiple computers using ARD

    Hi Everyone,
    I was wondering if there is a way to delete user profiles on all of my remote clients (250+) using ARD.
    Or if anyone knows about a script which can do this and some more.
    This is what I am trying to do:
    I wanted to delete any user profile which exceeds the size of 300 MBs or older than 1 month.
    All of my clients are Intel Macs using newest version of ARD and Leopard.
    Thanks,

    finding folders by size is pretty easy, modification date is a bit harder.
    Here is a script that will list all user folders over 300mb.
    I will leave it to you to test and modify to delete those folders.
    #!/bin/bash
    #list all folders larger than 300MB in /Users
    #will exclude administrator and Shared
    for user in $(ls -1 /Users | grep -v "Shared" | grep -v "administrator")
    do
    homeSize=$(du -sm /Users/$user | cut -d"/" -f1)
    if [[$homeSize -gt 300]]; then
    echo "/Users/$user"
    fi
    done

  • 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.

  • PowerShell Script to Clean User Profiles File Location

    Hello,
    I have been searching around to accomplish what I am trying to do. It is pretty basic so I am hoping someone can point me in the right direction. I want to write a powershell script to clean out two locations in all the user profiles on a Citrix server.
    Here are the steps I'd like to accomplish.
    1. Find all user profiles on the Citrix server
    2. Delete all the files from these two locations; "\Local Settings\Application Data\Mozilla\*.*" and "\Local Settings\Application Data\Microsoft\OneNote\*.*"
    This will run on a weekly basis via a scheduled task. A nice to have would be to add any profile over 60 days old.
    I have a pretty good start, but I am still learning PowerShell, so any help would be appreciated.
    Thanks in advance!
    Thanks, Jeremy

    Hello mbwc,
    how about showing us what you got so far and detail where you have trouble?
    That way, we can help you understand your problems and find the solution yourself (= good for learning), instead of having one of us simply provide the solution (= bad for learning).
    Cheers,
    Fred
    There's no place like 127.0.0.1

  • Need to develope report for Deleting user profiles

    Hi All,
    I need to develop a report to delete inactive user profiles from SAP system. We have  a found out a list of valid users but need to delete all the users which are not contained in this list.
    If anybody is having any inputs, they are welcome.
    Thanks & Regards
    Abhii

    REPORT  ztest5.
    PERFORM delete_user USING 'TEST' .
    *&      Form  DELETE_USER
    *       text
    *      -->USERNAME   text
    FORM delete_user USING username TYPE bapibname-bapibname .
      DATA : li_mess TYPE TABLE OF bapiret2 ,
             ls_mess TYPE          bapiret2 ,
             lv_mess TYPE          string   .
      CALL FUNCTION 'BAPI_USER_DELETE'
        EXPORTING
          username = username
        TABLES
          return   = li_mess.
      LOOP AT li_mess INTO ls_mess .
        CLEAR lv_mess .
        MESSAGE ID     ls_mess-id
                TYPE   ls_mess-type
                NUMBER ls_mess-number
                INTO   lv_mess
                WITH  ls_mess-message_v1
                      ls_mess-message_v2
                      ls_mess-message_v3
                      ls_mess-message_v4.
        WRITE : / ls_mess-type , lv_mess .
      ENDLOOP .
    ENDFORM .                    "DELETE_USER

  • Script to delete users created in database after specific days

    Hi,
    I am working as a QA. In my team, we need to create oracle users frequently for testing purpose but no one deletes user from oracle after finishing testing thus creating lots of user in oracle and also wasting lots of space. so need help to create a script which will delete user defined table after specific days which we can set in script ?
    Early response will be appreciable.
    Thanks in advance

    Its a oracle users which are created by team members for testing purposeprogramatically how will you differentiate between schemas/usernames created by Oracle & those created locally?
    SQL> select username, created from dba_users order by 2;
    USERNAME                 CREATED
    SYSTEM                      15-AUG-09
    SYS                      15-AUG-09
    OUTLN                      15-AUG-09
    DIP                      15-AUG-09
    ORACLE_OCM                 15-AUG-09
    DBSNMP                      15-AUG-09
    APPQOSSYS                 15-AUG-09
    WMSYS                      15-AUG-09
    EXFSYS                      15-AUG-09
    CTXSYS                      15-AUG-09
    ANONYMOUS                 15-AUG-09
    XDB                      15-AUG-09
    XS$NULL                  15-AUG-09
    MDSYS                      15-AUG-09
    ORDSYS                      15-AUG-09
    SI_INFORMTN_SCHEMA            15-AUG-09
    ORDDATA                  15-AUG-09
    ORDPLUGINS                 15-AUG-09
    OLAPSYS                  15-AUG-09
    MDDATA                      15-AUG-09
    SPATIAL_WFS_ADMIN_USR            15-AUG-09
    SPATIAL_CSW_ADMIN_USR            15-AUG-09
    SYSMAN                      15-AUG-09
    MGMT_VIEW                 15-AUG-09
    APEX_030200                 15-AUG-09
    APEX_PUBLIC_USER            15-AUG-09
    FLOWS_FILES                 15-AUG-09
    OWBSYS                      15-AUG-09
    OWBSYS_AUDIT                 15-AUG-09
    SCOTT                      15-AUG-09
    IX                      07-MAY-10
    BI                      07-MAY-10
    SH                      07-MAY-10
    HR                      07-MAY-10
    PM                      07-MAY-10
    OE                      07-MAY-10
    DBADMIN                  07-MAY-10
    BONGO                      22-MAY-10
    USER1                      30-AUG-10
    SAM                      29-SEP-10
    40 rows selected.which "old" schemas need to be discarded.
    post SELECT that properly produces usernames to be removed.

  • Apple script to delete user home folder

    I wish to run a appple script to delete all user home folders except for ladmin which is an admin account. All other user home folders need to go. Any one have a script that can do this by using ARD

    Account information is kept in NetInfo, a complex system database. If you just delete a home folder the account will still exist, and a new home folder will be created the next time a user logs into it.

  • Can't add or delete User Profiles in System Preferences

    I'm trying to connect to my school's wireless network, which is now using WPA2 Enterprise encryption and I need to change my User Profile to connect. As far as I can tell, I've done this several times, but my new profile doesn't show up and the old two don't go away (which I have deleted from the 802.1X page).
    What do I need to do to get my preferences to work correctly?

    Try repairing permissions and ACLs on that user.
    The Repair Permissions run from Disk Utility in your Applications doesn't touch anything in any of the user folders, so startup holding command-r keys into your Recovery Volume.
    From the menu bar choose Utilities then select Terminal.
    At the prompt type resetpassword
    Press return
    The Password reset utility will launch (do not reset password)
    Instead, click your Mac hard drive.
    Then from the drop-down select the user account you want to repair. At the bottom of the window, you’ll see an area labeled ‘Reset Home Directory Permissions and ACLs’. Click the Reset button there.
    The process takes a couple of minutes. When it’s done, quit the programs you’ve opened and restart your Mac.

  • Deleting User Profile

    When a user is deleted, is the accompanying user profile also suppososed to be deleted?
    If not, how do you delete the user profile?

    Please ignore this post!!
    I've read the earlier q/a's on this topic and found the solution!!

  • Need a script to delete user files and run on logout.

    Hi folks!
    I'm a total Mac novice so forgive me if I'm vague on anything here. I work in a library and we have recently acquired an iMac running Mountain Lion. The unit is primarily for use by Visually Impaired users however sighted folks can use it as well.
    What I need is something that will delete any files created/downloaded by the sighted users but that will not delete anyone else's files. I tried just using the Guest Account however that also deletes all the system preferences for that account including the dock setup which I need to stay the same.
    If possible I would like this to run on logout.
    For additional points anyone who can also find me something that will run automatically when the users sign in and will sign them out after 30 minutes would super spectacularly awesome.
    Thanks people!

    That being said, if you you still really want to do this you can create a logout hook and write a shell script to remove the files.  See "About Daemons and Services", Appendix B on writing a logout hook.
    But a far easier way is to create Account's login item that will cause a shell script to be launched to delete the files.  You can encapsulate the shell script so it runs as an application that can be added to the Login Items.  One such encapsulator is Platypus.
    Note, rather than delete them, if you want to ensure all the specific plists have specific settings, then create a master set of them and copy the master set into the Preferences directory (being careful to observe ownership and permissions settings of course).

  • Accidently deleted user/profile

    *Please help!!!*
    As I wanted to change my profile name (name that appears with the house symbol) today (ctrl and touchpad, then "change name"), apparently my profile got completely deleted. All programmes were empty as on the first day (e.g. not one photo in IPhoto, no account or mails, no keychain, no favorites in Safari, etc.), I have lost all settings of my computer. I was able to retrieve some of the data from the "users" file, but all is completely mixed up.
    Please, does anbody know about this problem and is there a chance to get my data and settings back?
    It is incredible that with one mouseclick and no further asking the system got completey wiped in a split second...that must happen all the time - or am I the only idiot????
    *Thanks for any ideas,*
    Daniela

    Thanks again,
    after applying the solutions of the X-Lab I now have all my pics back in IPhoto and Music back in ITunes...phuuu!! Still missing are all mails in Outlook and computer settings...but well, thats a great success anyway! Thanks again for your help!!!! I will tell the technician in the GRAVIS store, who just told me that it is all gone...:-))
    Best wishes from Germany,
    Daniela

  • Terminal Server User Profile - Delete Permissions

    One frequent problem our help desk encounters is corrupted user profiles on the terminal servers.  Today those tickets are escalated to the server team to have the local user and roaming profiles deleted.  That team wishes to have this task moved
    to the desktop / help desk.
    I've built a script to perform this action, but desktop and help desk AD groups do not have sufficient rights on these servers to delete the user profiles.  NTFS permission changes will allow them the ability to delete the roaming profiles, but I don't
    beleive this would be sufficient to delete the local profiles from the terminal servers (properly).
    The script command I'm using to delete the local profiles is:
    takeown /f $LPath.FullName /r /d y
    I attempted using a service account to run the command within the script but I couldn't find a secure way to nest the password.  Can someone point me to the correct permissions needed for a regular user to properly delete a remote user profile?
    Thanks!
    There's no place like 127.0.0.1

    Hi,
    Thank you for posting in Windows Server Forum.
    What kind of permission is assigned to your help desk users?
    Firstly please check that your help desk users can delete the profile via “System Properties--Advanced tab--User Profiles--Settings button”. By deleting user profiles will delete the corresponding registry entries in addition to the folder under C:\Users
    Apart still if you want to check the registry setting, we can verify and delete under below mention path.
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
    Here need to find the respective SID for the users and the delete that SID and then again ask users to log back in which will create a new user profile.
    Else your help desk user can get the permission for running below script through which they can delete the user profile.
    Remove RDS Profiles
    http://gallery.technet.microsoft.com/scriptcenter/5146833f-dd54-47a8-9941-b0889a456571
    Hope it helps!
    Thanks.
    Dharmesh Solanki

Maybe you are looking for

  • String with embedded single quote

    Hi, all. We're trying to pass a string from one procedure to another, which will then do an EXECUTE IMMEDIATE on it. However, there are single quotes withing the string, and they're driving us nuts! This is what the concatenated string should look li

  • Can someone help me with this Error ?

    When I start up my Thinkpad 600E it shows 301 on the first screen and then it goes to the diagnostic/Test screen. I run a test on the system board and it comes up with this : FRU 0086              22          0010 I know that there is some issue with

  • HT1725 Why can't my movie rental be downloaded? I keep getting "download error" message and I have astrong signal?

    I have tried to download a rented movie but keep getting the "unable to download" at this time message. What's wrong?  This is all new to me.

  • Data Migration Infotype load sequence

    Hi All, I am migrating data from our legacy system to SAP HR infotypes and would like to know what the sequence / dependencies are.  There are two of us doing the work and I was hoping we could load some of them simultaneously but I realise there are

  • Sender not available

    I'm using Nokia 6500. I'm trying to move some messages from Inbox to Sent Messages folder using Nokia PC Suite 6.8.6. However, after I've done so, all the sender number is gone. It just said "not available". Please help!