+ Post New Thread
Results 1 to 3 of 3
Mac Thread, Create Default OS X home dir via AD in Technical; Our Macs (10.5) are bound to an AD Server (2003) and OS X Server (10.5). All the home folders are ...
  1. #1

    Join Date
    Jun 2008
    Thank Post
    Thanked 0 Times in 0 Posts
    Rep Power

    Create Default OS X home dir via AD

    Our Macs (10.5) are bound to an AD Server (2003) and OS X Server (10.5).

    All the home folders are stored on the AD.

    When a user logs into a Mac the default mac folders aren't created. Is there a way to create or push these folders out, similar to how it would work if the home folders were stored on the OS X Server?


  2. #2
    gaz350's Avatar
    Join Date
    Jul 2007
    Rutland, east.leicestershire :P
    Thank Post
    Thanked 49 Times in 41 Posts
    Rep Power
    we use a program called ihook to run login scripts at login with a fancey UI with a progress bar. just set scriptname.ihook to run at login and hey presto.

    Research Systems Unix Group: iHook

    following code is to give you an idea of 1 of our old login scripts. fairly simple stuff.
    note the very useful line to clear printing from previous users incase the printer was out of paper or there was a problem with printing when the last user tried printing etc etc!!! (cancel -a)

    aim of this was to redirect a few network items to local tmp folder to stop the network drivers being hammered by cache files oh and block users own widget folder to stop them installing widgets.

    echo %BACKGROUND /path/to/background.png
    echo %0
    echo %TITLE
    echo ' PLEASE WAIT.'
    sleep 5
    echo %5
    echo $CONSOLE_USER 
    echo %10
    mkdir ~/library/Widgets/
    chmod 777 ~/library/Widgets/
    echo %15
    rm -r ~/library/Widgets/
    mkdir ~/library/Widgets/
    chmod 000 ~/library/Widgets/
    echo %20
    # echo 'setting cache redirect to local drive'
    echo ' PLEASE WAIT..'
    echo %30
    rm -R /tmp/$CONSOLE_USER
    rm ~/Library/Caches
    mkdir /tmp/$CONSOLE_USER
    chmod 700 /tmp/$CONSOLE_USER
    echo %40
    echo ' PLEASE WAIT...'
    # echo 'Removing Cache Folder from users home folder...'
    rm -R ~/Library/Caches
    echo %60
    echo ' PLEASE WAIT....'
    # echo 'Creating alias....'
    ln -s /tmp/$CONSOLE_USER ~/Library/Caches
    ln -s /tmp/$CONSOLE_USER ~/Library/fonts
    echo ' PLEASE WAIT......'
    echo %70
    rm -R ~/Documents/ClickView/SchoolBag
    rm -R ~/Documents/ClickView/CoverImages
    rm -R ~/Documents/ClickView/Files
    rm -R ~/Documents/ClickView/DataFiles
    rm -R /tmp/clickview/SchoolBag
    rm -R /tmp/clickview/Files
    rm -R /tmp/clickview/CoverImages
    rm -R /tmp/clickview/DataFiles
    echo %80
    echo ' PLEASE WAIT.......'
    mkdir /tmp/clickview
    mkdir ~/Documents/ClickView
    mkdir /tmp/clickview/SchoolBag
    mkdir /tmp/clickview/Files
    mkdir /tmp/clickview/CoverImages
    mkdir /tmp/clickview/DataFiles
    sleep 2
    echo ' PLEASE WAIT........'
    ln -s /tmp/clickview/SchoolBag ~/Documents/ClickView/SchoolBag
    ln -s /tmp/clickview/Files ~/Documents/ClickView/Files
    ln -s /tmp/clickview/CoverImages ~/Documents/ClickView/CoverImages
    ln -s /tmp/clickview/DataFiles ~/Documents/ClickView/DataFiles
    echo %90
    sleep 2
    echo ' PLEASE WAIT.........'
    # echo 'Changing temp tmp privs'
    chmod 777 /private/tmp
    sleep 2
    echo ' PLEASE WAIT..........'
    echo %95
    # echo 'Changing temp clickview privs'
    chmod -R 777 /private/tmp/clickview
    sleep 2
    echo ' PLEASE WAIT...........'
    # echo 'Changing temp clickview ownership'
    chown -R $CONSOLE_USER /private/tmp/clickview
    sleep 2
    cancel -a
    echo %100
    echo Hi $CONSOLE_USER Printing has been Cleared - Login Complete!
    sleep 7
    exit 0
    cant remember if i put the sleeps in because of error or i put them in there for my sanity so that i could see the script executing. This is a fairly my old version of the scripts we run so might be some errors or old ways of doing things :P

    also not sure what will and what wont work in these scripts when storing files on smb

    Disclaimer: you run these at your own risk!
    Last edited by gaz350; 11th June 2008 at 02:58 PM.

  3. #3

    Join Date
    Jun 2008
    Thank Post
    Thanked 0 Times in 0 Posts
    Rep Power
    Thanks for the tip.

    iHook looks like it could be a life save.


+ Post New Thread

Similar Threads

  1. Create a hidden share for home directories
    By originofsymmetry in forum Scripts
    Replies: 5
    Last Post: 2nd May 2008, 04:13 PM
  2. Default TS Web Access as Default Site in IIS7
    By darknova in forum Windows Server 2008
    Replies: 1
    Last Post: 13th March 2008, 03:57 PM
  3. XP Home Printer Sharing to Vista Home Premium
    By link470 in forum Windows
    Replies: 1
    Last Post: 19th December 2007, 09:36 AM
  4. Create PDF
    By thom in forum Educational Software
    Replies: 6
    Last Post: 19th September 2006, 10:14 AM

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