Login Hook stops working once I've changed the username

Hello. I need to change the usernames for a number of local accounts on a 10.5.8 mac. The accounts were set up by someone else who is no longer working at this education insitution and hasn't left any documentation. Currently when each user logs on, a script runs that does the following
#!/usr/bin/env bash
# iMac logon script
# get our user
theUser=$1
# get the users home directory
#theUsersHome=$HOME
# Copy the dock plist file for the user
cp /Library/Scripts/GHS/Docks/${theUser}/com.apple.dock.plist /Users/${theUser}/Library/Preferences
# Create a ScreenCaptures folder on the desktop, give it permissions and redirect the screen captures
# Unlock the Desktop folder first in case it is locked
sudo chflags nouchg /Users/${theUser}/Desktop
mkdir /Users/${theUser}/Desktop/ScreenCaptures
sudo chown ${theUser}:staff /Users/${theUser}/Desktop/ScreenCaptures
defaults write com.apple.screencapture location /Users/${theUser}/Desktop/ScreenCaptures
# Create a VideoWork folder on the Desktop and give it permissions
# Unlock the Desktop folder first in case it is locked
sudo chflags nouchg /Users/${theUser}/Desktop
# Remove the old Video Work folder in case it exists
rmdir /Users/${theUser}/Desktop/Video\ Work
mkdir /Users/${theUser}/Desktop/VideoWork
sudo chown ${theUser}:staff /Users/${theUser}/Desktop/VideoWork
# Lock the Desktop, Documents, Movies, Music and Pictures folders
sudo chflags uchg /Users/${theUser}/Desktop
sudo chflags uchg /Users/${theUser}/Documents
sudo chflags uchg /Users/${theUser}/Movies
sudo chflags uchg /Users/${theUser}/Music
sudo chflags uchg /Users/${theUser}/Pictures
However, once I change the users account name, the script doesn't seem to run correctly as the screen captures fail due to not having write permission in the intended destination.
I rename the UserName the ShortName, the HomeDirectory and the folder here /Library/Scripts/GHS/Docks/UserName
The idea is, once I've updated this one mac with all the new accounts, I will then duplicate the image across all the others that we have
I'm very new to this and I'm not sure how much of this works
Thank you very much for any help and I apologise if I've missed out any essential information.

Hi John, not certain I can help here, but...
Add a user from the OS X command line, works with Leopard!
http://osxdaily.com/2007/10/29/how-to-add-a-user-from-the-os-x-command-line-work s-with-leopard/
More...
http://osxdaily.com/2011/05/20/change-short-name-user-mac-os-x/
http://www.macworld.com/article/132693/2008/03/changeshortusername.html

Similar Messages

  • HT4623 My iPhone has suddenly stopped working. It now says the battery is dying and to charge it. After charging it for over an hour, there is no change. The power won't come on, and I am left with a blank screen advising me to plug my phone into the char

    My iPhone has suddenly stopped working. It now says the battery is dying and to charge it. After charging it for over an hour, there is no change. The power won't come on, and I am left with a blank screen advising me to plug my phone into the charger.

    Try different USB Cable, try different Charger. Clean iPhone charging port with clean dry toothbrush. If still problem and you have Warranty or AppleCare, make Genius reservation and take iPhone to Apple for resolution. If no coverage, most likely it could be battery or charging port assembly that need replacement.

  • Project stops working when attempting to change working times

    Project stops working when attempting to change working times.  I'm running a 1000+ task project, fully resource loaded with multiple resource calendars.  After two months of normal operation, it now appears that Project has deleted (or corrupted)
    one of the base calendars that several of the resources use.  Now, when attempting to change working time for a resource, sometimes I can get as far as a blank space where the base calendar name should be and an error message stating that there is a problem
    with the resource; other times the program just stops working and shuts down.  Any ideas on how to restore the file?  

    I agree with John. Save the file as XML and reopen it. Also, if you have backup of the file, use Organizer to copy the base calendar from the backup. To use organizer, open both the files in Project.
    1. In Project 2007 or earlier versions, select Tools > Organizer. In Project 2010 and later, select File, Info > Organizer. 
    2. Click Calendars tab.
    3. Change the Calendars available in: drop down on the right to current file, and other drop down to backup. This will list all the base calendars in each file.
    4. Select the base calendar in the backup. Click the "Copy >>" to restore the base calendar.
    Sai PMP, PMI-SP, MCTS Project, MVP Project

  • Hello  My system version 10.5.8  I have installed Safari update - 5.0.6 and the browser stopped working. At openingit shows the following icon:   "Safari has suddenly finished working. Possible problem is in the action of the plugin "TastyAppsAVPlugin".

    Hello
    My system version 10.5.8
    I have installed Safari update - 5.0.6 and the browser stopped working. At openingit shows the following icon:
    "Safari has suddenly finished working. Possible problem is in the action of the plugin "TastyAppsAVPlugin".
    After deleting all plugins from the folder "Internet Plugin", Safari worked again no problem, BUT all sites with flash content (e.g.YouTube) did not work.
    I then tried the following experimental steps:
    a) Moved all plugins from the folder "Internet Plugin" into a temporary folder.
    b) Downloaded and istalled Adobe Flash Player version 10.3.181.34
    c) Started Safari and it did not work ( same message"TastyAppsAVPlugin")
    d) Deleted Adobe Flash Player from the folder "Internet Plugin". Safari worked.
    e) Moved back all plugins, except Adobe Flash Player, from the temporary folder to "Internet Plugin" folder. Safari works... But Flash won't work!!! Before update to Safari 5.0.6 , ev erything worked perfectly well.
    Guys, please solve the problem
    Regards
    Ruslan Reed
    [email protected]

    MayaMa --
    There are many threads on this.  I typed "Uninstalling TastyApps" in the Google search, and came up with these:
    http://www.google.com/search?client=safari&rls=en&q=Uninstalling+tastyapps&ie=UT F-8&oe=UTF-8
    I do not know which of the many TastyApps haxies you have.  Perhaps it would be better to contact them directly, once you know which of their products you have.

  • I keep getting this message:  Adobe Photoshop CC 2014 has stopped working.  A problem caused the program to stop working correctly.  Then it shuts down the program.

    I keep getting this message when I try to open my new Adobe Photoshop.  The main screen comes on and a box for the tutorials then this.  "Adobe Photoshop CC 2014 has stopped working.  A problem caused the program to stop working correctly."  When I say Okay to the message, it shuts down the program.

    Refer below link once
    Photoshop: Basic Troubleshooting steps to fix most issues

  • I have a fairly new iPod touch and the touch screen has stopes working in certain places like the bottom row of apps and things on keyboard I have updated it and restored it multiple times it makes no difference please help!?

    I have a fairly new iPod touch and the touch screen has suddenly stopped working..... Like the bottom row of apps has stopped working and certain buttons on the keypad are not working at all what so ever I have taken it to the apple store once before they told me to update it I did so and it didn't get better I have also restored it multiple times still nothing I really would like a working I pod please help!!!

    If you restored to factory settings/new iPod and still have the problem that indicates a hardware problem.
    Make an appointment at the Genius Bar of an Apple store..
    Apple Retail Store - Genius Bar

  • My Ipad stop working and is just showing the apple logo and right after that the ITunes logo , I connected it to my PC but it ask me to restore it. Is there any trick to do not loose all my pictures if I restore it?

    My Ipad stop working and is just showing the apple logo and right after that the ITunes logo , I connected it to my PC but it ask me to restore it. Is there any trick to do not loose all my pictures if I restore it?

    Once the Device is in Recovery Mode... it is too late to save anything...
    To minimise loss... after the successful Recovery... Restore from the most recent Backup...
    See Restore from Backup here
    http://support.apple.com/kb/ht1766

  • Hi Team, Showing Yellow icons after every 15 to 20 Min and internet stop working.when we enable- disbale the network connection then will internet start working fine.Some time network connection is disable but when we renable that connection it will st

    Hi Team,
    Showing Yellow icons after every 15 to 20 Min and internet stop working.when we enable- disbale the network connection then will internet start working fine.Some time network connection is disable but when we renable that connection it will stuck on enabling
    and will not renable till i am not restart that machine. I have 350 Machine in network but facing this issue in 25 machines. Kindly help me on this issue .
    Regards
    Sahil bhateja

    Hi,
    So switch a LAN card fix this issue...seems a compatibility issue or maybe some packs or programs you installed recently cause this issue.
    Have you manually check the network adapter driver from the PC's manufacture website? sometimes, it will be a time delay before Microsoft push out the driver update.
    Check if issue exists in safemode with network, this mode will launch Windows with limited sets of files and drivers. 
    if you have a restore point, restore the pc to a previous point at which the pc is functioning fine.
    Yolanda Zhu
    TechNet Community Support

  • Problem with iTunes. I have Windows 8 on a new laptop. Installed latest version of iTunes. Can play music in My Library but when I click on Itunes Store I get the message "iTunes has stopped working. A problem caused the program to stop working correctly.

    I have a new laptop with Windows 8 as operating system. Installed latest version of iTunes ontop computer. I can play music in My Library but when I click on iTunes, I get the message " iTunes has stopped working. A problem caused the program to stop working correctly. Windows will close the program and notify if a solution is available."
    Anyone know what is the cause and if there is a resolution? Have tried to re-installing iTunes and have also tried restoring laptop to an earlier date.

    iPad not appearing in iTunes
    http://www.apple.com/support/ipad/assistant/itunes/
    iOS: Device not recognized in iTunes for Mac OS X
    http://support.apple.com/kb/TS1591
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    iTunes for Windows: Device Sync Tests
    http://support.apple.com/kb/HT4235
    IOS: Syncing with iTunes
    http://support.apple.com/kb/HT1386
    Apple - Support - iPad - Syncing
    http://www.apple.com/support/ipad/syncing/
    iTunes 10.5 and later: Troubleshooting iTunes Wi-Fi Syncing
    http://support.apple.com/kb/ts4062
    The Complete Guide to Using the iTunes Store
    http://www.ilounge.com/index.php/articles/comments/the-complete-guide-to-using-t he-itunes-store/
    iTunes Store: Associating a device or computer to your Apple ID
    http://support.apple.com/kb/ht4627
    Can't connect to the iTunes Store
    http://support.apple.com/kb/TS1368
    iTunes: Advanced iTunes Store troubleshooting
    http://support.apple.com/kb/TS3297
    Best Fixes for ‘Cannot Connect to iTunes Store’ Errors
    http://ipadinsight.com/ipad-tips-tricks/best-fixes-for-cannot-connect-to-itunes- store-errors/
    Try this first - Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
    This works for some users. Not sure why.
    Go to Settings>General>Date and Time> Set Automatically>Off. Set the date ahead by about a year.Then see if you can connect to the store.
     Cheers, Tom

  • I have iTunes 11.4 and Windows 7. Using iTunes on Windows 7, I get message that iTunes has stopped working and Windows will close the program and notify me if a solution is available. Same message for last two days. Anyone else getting this?

    I have iPad 2, iPhone 5s, both with iOS 7.1.2. I use PC with Windows 7 and hard wire internet service and iTunes to update apple products; no wi-fi. I updated iTunes to v11.4 on 09/11/14. I ran Windows update on 09/10/14. I did not try to open iTunes on my PC until yesterday 09/16/14. I got the message: "iTunes has stopped working. A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available."  I got the same message today.  Does anyone know if this is a Windows problem and if a solution is coming or an iTunes problem?  I can get iTunes on iPad and iPhone.  All other programs PC are working correctly.  I use Norton Internet Service on PC.  I ran virus scans and repair/reinstall iTunes yesterday on PC.

    Hello notime4,
    The article linked below details some useful troubleshooting steps that can help stabilize iTunes on your computer.
    iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues
    http://support.apple.com/kb/TS1717
    Cheers,
    Allen

  • I can't open Itunes on my laptop. "Itunes has stopped working. A problem causes the program to stop working correctly. windows will close the program and notify you if a solution is available" is the message. what is the problem here?

    I can't open my Itunes program in my laptop computer with windows 8. the message is "Itunes has stopped working. A problem causess the program to stop working properly. windows will close the program and notify you if a solution is available". I reboot  the machine, Uninstall and re install the  Itune program, stilll the same message pops up.

    The first thing to try is System Restore to take you back to a point in time when it did work. If that is not successful, create a new user on the computer. log in with that and see if ID will start. This will tell us if the problem is in the system/program or the user account.
    If it works in a new user account, see Replace Your Preferences and in addition to replacing the prefs, empty the InDesign Recovery folder that will be in the same location and the InDesign SavedData file.

  • "iTunes has stopped working.  A problem caused the program to stop working correctly.   Windows will close the program and notify you if a solution is available."

    Whenever I connect to the iTunes store i receive an error message "iTunes has stopped working.  A problem caused the program to stop working correctly.   Windows will close the program and notify you if a solution is available."    This causes iTunes to close.  I am using iTunes version 10.5.0.142 on a Windows Vista (64) PC.  I have reinstalled iTunes selecting the "repair" option and also uninstalled and reinstalled iTunes.  Any help will be deeply appreciated.  Thank you.  Below is the result of the diagnositc.
    Microsoft Windows 7 x64 Home Premium Edition Service Pack 1 (Build 7601)
    HP-Pavilion BN474AV-ABA HPE-150t
    iTunes 10.5.0.142
    QuickTime not available
    FairPlay 1.13.35
    Apple Application Support 2.1.5
    iPod Updater Library 10.0d2
    CD Driver 2.2.0.1
    CD Driver DLL 2.1.1.1
    Apple Mobile Device 4.0.0.96
    Apple Mobile Device Driver 1.57.0.0
    Bonjour 3.0.0.10 (333.10)
    Gracenote SDK 1.9.3.494
    Gracenote MusicID 1.9.3.106
    Gracenote Submit 1.9.3.136
    Gracenote DSP 1.9.3.44
    iTunes Serial Number 002FAD94098CD0E0
    Current user is not an administrator.
    The current local date and time is 2011-11-13 22:08:54.
    iTunes is not running in safe mode.
    WebKit accelerated compositing is enabled.
    HDCP is not supported.
    Core Media is supported.
    Video Display Information
    NVIDIA, NVIDIA GeForce GT 220
    **** External Plug-ins Information ****
    No external plug-ins installed.
    Genius ID: 2cb3fff3fa771d265b0f8ffdcca13b55
    **** Network Connectivity Tests ****
    Network Adapter Information
    Adapter Name: {F4A2029C-16AA-4BDF-8DB7-9EC2A75B5991}
    Description: Realtek PCIe GBE Family Controller
    IP Address: 192.168.1.6
    Subnet Mask: 255.255.255.0
    Default Gateway: 192.168.1.1
    DHCP Enabled: Yes
    DHCP Server: 192.168.1.1
    Lease Obtained: Sun Nov 13 21:09:29 2011
    Lease Expires: Mon Nov 14 21:09:29 2011
    DNS Servers: 192.168.1.1
    Active Connection: LAN Connection
    Connected: Yes
    Online: Yes
    Using Modem: No
    Using LAN: Yes
    Using Proxy: No
    SSL 3.0 Support: Enabled
    TLS 1.0 Support: Disabled
    Firewall Information
    Windows Firewall is on.
    iTunes is NOT enabled in Windows Firewall.
    Connection attempt to Apple web site was successful.
    Connection attempt to browsing iTunes Store was successful.
    Connection attempt to purchasing from iTunes Store was successful.
    Connection attempt to iPhone activation server was successful.
    Connection attempt to firmware update server was successful.
    Connection attempt to Gracenote server was successful.
    Last successful iTunes Store access was 2011-11-13 22:02:08.
    **** CD/DVD Drive Tests ****
    LowerFilters: PxHlpa64 (2.0.0.0),
    UpperFilters: GEARAspiWDM (2.2.0.1),
    E: hp DVD A DH16ABLH, Rev 3HD9
    Data or MP3 CD in drive.
    Found 1 songs on CD, playing time 15:40 on CDROM media.
    Track 1, start time 00:02:00
    Get drive speed succeeded.
    The drive CDR speeds are: 8 16 24 32.
    The drive CDRW speeds are: 8.
    The drive DVDR speeds are: 8.
    The drive DVDRW speeds are: 8.
    The last failed audio CD burn had error code 4251(0x0000109b). It happened on drive E: hp CDDVDW TS-H653R on CDR media at speed 24X.
    **** Device Connectivity Tests ****
    iPodService 10.5.0.142 (x64) is currently running.
    iTunesHelper 10.5.0.142 is currently running.
    Apple Mobile Device service 3.3.0.0 is currently running.
    Universal Serial Bus Controllers:
    Intel(R) 5 Series/3400 Series Chipset Family USB Enhanced Host Controller - 3B34. Device is working properly.
    Intel(R) 5 Series/3400 Series Chipset Family USB Enhanced Host Controller - 3B3C. Device is working properly.
    FireWire (IEEE 1394) Host Controllers:
    VIA 1394 OHCI Compliant Host Controller. Device is working properly.
    Connected Device Information:
    Bruce's iTouch, iPod touch (2nd generation) running firmware version 4.2.1
    Serial Number: 1C9053CC201
    **** Device Sync Tests ****
    Sync tests completed successfully.

    Same exact thing with me.  And no help from apple.  Just dropped nearly $600 and cannot get a decent working setup.
    Apple's only suggestion was to uninstall iTunes and Quicktime, and re-install... of course (the I.T. Crowd tactic).
    The crash happens only on iTunes store access.

  • TS1424 HELLO! whenever i try to access the itunes store from the itunes on my laptop i get this message: ITUNES HAS STOPPED WORKING a problem caused the program to stop working correctly. windows will close the program and notify if a solution is availabl

    for a few weeks i have not been able to access the itunes store from the itunes on my laptop. every time i click on it it tells me it cannot access the store...not sure why. and says this: ITUNES HAS STOPPED WORKING a problem caused the program to stop working correctly. windows will close the program and notify if a solution is available.

    I had this exact same problem.  I found this fix and it worked for me. 
    Step 1:
    Browse to C:\Program Files (x86)\Common Files\Apple\Apple Application Support and copy the filen named QTMovieWin.dll. 
    Step 2:
    Browse and past that file into C:\Program Files (x86)\iTunes.
    Hope this helps you.  I wish I could remember where I saw this originally so I could thank them.
    Good Luck.
    Anthony

  • A magazine's app on my iPad has stopped working.  When I open the Newsstand folder and click on the app, the screen dims briefly, then returns to the Newsstand folder. The other app in my Newsstand folder (Wall Street Journal) opens without any problem.

    A magazine's app on my iPad has stopped working.  When I open the Newsstand folder and click on the app, the screen dims briefly, then returns to the Newsstand folder. The other app in my Newsstand folder (Wall Street Journal) opens without any problem, and this magazine's app opens just fine on my wife's iPad.
    I have deleted the app and reinstalled it from the Apple store and that makes no difference.  I have also done a hard reboot on my iPad with no result.
    Any thoughts about what might be wrong? 

    Hey everyone in Apple world!
    I figured out how to fix the flashing yellow screen problem that I've been having on my MBP!  Yessssss!!!
    I found this super handy website with the golden answer: http://support.apple.com/kb/HT1379
    I followed the instructions on this page and here's what I did:
    Resetting NVRAM / PRAM
    Shut down your Mac.
    Locate the following keys on the keyboard: Command (⌘), Option, P, and R. You will need to hold these keys down simultaneously in step 4.
    Turn on the computer.
    Press and hold the Command-Option-P-R keys before the gray screen appears.
    Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    Release the keys.
    I went through the 6 steps above twice, just to make sure I got rid of whatever stuff was holding up my bootup process.  Since I did that, my MBP boots up just like normal.  No flashing yellow screen anymore!!   
    (Note that I arrived at this solution when I first saw this page: http://support.apple.com/kb/TS2570?viewlocale=en_US)
    Let me know if this works for you!
    Elaine

  • I got an error message: 'iTunes has stopped working. A problem caused the program to stop working correctly. The solution asked me to load latest version which I did many times and still not working... HELP!

    [Window Title]
    Microsoft Windows
    [Main Instruction]
    iTunes has stopped working
    [Content]
    A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.
    [Close program]
    This is what I got... sorry, not very tech savvy to copy the error message onto here...
    Have tried uninstalled and re-installed iTune, updated the new version of 10.6... many times over still not working!!!
    I share the frustrations of many here. HELP!!!!!

    Hi there Nok Saensanoh,
    I would recommend taking a look at the troubleshooting steps found in the article below.
    iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues
    http://support.apple.com/kb/ts1717
    -Griff W.

Maybe you are looking for

  • My siri is not working for a few days now..?

    pls help me , my siri has not been working for a few days now ... pls advice

  • Problem with USB External Hard Disk Drive

    I have similar problem with hard disk MK6025GAS in Sweex casing connected via USB as Raistlfiren in this post but I am not sure if it has something to do with kernel. The problem is that when I plug the hard disk via USB it is not even shown with in

  • Payment advise format

    Dear All, Can someone please tell me what is the transaction code for maintaining the payment advise forms which accompanies the cheque payment to vendor. Regards Suresh

  • Is the option to change font sizes in the Mail message list broken?

    I can change the font and font size in the messages themselves, but not in the column that lists the messages. Weird. A Google search didn't turn up any references to the problem. Using OS X Mountain Lion 10.8.2 on a 2012 MacBook Air.

  • ECC - 6.0 INSTALLATION GUIDES

    Hi All         Anybody give me a installation guides for ECC - 6.0 , Kindly send to me . Regards Selvan .SP