+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 29 of 29
Mac Thread, New Mac network - is this possible? in Technical; Originally Posted by HodgeHi I like the look of this script but unsure as to how to pass usernames into ...
  1. #16
    DMcCoy's Avatar
    Join Date
    Oct 2005
    Location
    Isle of Wight
    Posts
    3,491
    Thank Post
    10
    Thanked 502 Times in 442 Posts
    Rep Power
    114
    Quote Originally Posted by HodgeHi View Post
    I like the look of this script but unsure as to how to pass usernames into the script itself. I am looking for a script that will create the home dirs for the users in the AD and then set the permissions on the folders. How would i be able to do this? I have already created a profile template and copied it into place. But when i try to create the users profiles using WGM it fails.

    TIA for any help you can shed.
    The script just loops through a list of usernames in the filename specified "script.sh 06 tempfile". So an example tempfile for me would contain:

    Code:
    A10001
    A10002
    etc.

    If you are managing AD users then you can't create the home dirs etc with WGM - this script is just for using on an OS X server if it is the one with the user home folders on it.

    After the summer I will have retired my utterly useless XRAID and Xserve controlling it to menial tasks (xraid will be moved to a x86 server running openfiler, at least I hope so). The apple users and windows users will all have files served over smb from a windows server instead. This gets me back filetype filtering and quotas again.

  2. Thanks to DMcCoy from:

    HodgeHi (12th August 2008)

  3. #17

    Join Date
    May 2006
    Location
    West Bromwich
    Posts
    2,192
    Thank Post
    300
    Thanked 215 Times in 185 Posts
    Rep Power
    57
    Thanks for the reply. I understand what you mean by the XRaid although i have yet to really push it. We are a primary school after all. I have decided to place most of the shares on there mainly for speed. With only a max of around 60 concurrent connections it should be quick enough. Well, we'll see after the 6 weeks.

    The AD-OD sandbox paper i posted had a script to create the home dirs for the users in AD (it runs on the AD server, VBScript). I used this to create the users dirs but now need to copy the os x template into their home dirs too. This is the bit i am unsure about.

    I will post an update if i can work out how to do it.

  4. #18
    DMcCoy's Avatar
    Join Date
    Oct 2005
    Location
    Isle of Wight
    Posts
    3,491
    Thank Post
    10
    Thanked 502 Times in 442 Posts
    Rep Power
    114
    It's not the xraid itself that's the issue so much that os x is such a bad file server. 10.5 has mostly been a disaster from that point of view with crashing issues with both afp and smb. I've even had corruption with nfs!

    I will just have one xserve doing OD and the other netboot/netinstall.

  5. #19

    Join Date
    Jul 2006
    Location
    London
    Posts
    2,963
    Thank Post
    160
    Thanked 153 Times in 117 Posts
    Rep Power
    50
    Quote Originally Posted by DMcCoy View Post
    It's not the xraid itself that's the issue so much that os x is such a bad file server. 10.5 has mostly been a disaster from that point of view with crashing issues with both afp and smb. I've even had corruption with nfs!
    Oh thanks, now you tell me!

    I'm still a bit confused about that script. I take it 'tempfile' needs to be in the same directory as the script. What format does it have to be in? And whats the 06 for?

    sorry for the really dumb questions

  6. #20
    DMcCoy's Avatar
    Join Date
    Oct 2005
    Location
    Isle of Wight
    Posts
    3,491
    Thank Post
    10
    Thanked 502 Times in 442 Posts
    Rep Power
    114
    the file is just a list of usernames to loop through, one after another with a line break. It just reads it from the directory the script is in.

    The 06 is take as an input for the year group. I have each year group as a sharepoint so 06, 05, 04 etc

    /Volumes/RAIDA/Users/Students/$1/$i

    The sharepoint for users strating in 06 would be

    /Volumes/RAIDA/Users/Students/06 (on the network as server\06) so all the script does is replace the $1 with the first variable passed to the script. Use 07 tempfile and it gets created in the 07 folder

    I had high hopes for 10.5 as I had managed to get 10.4 stable (after around 10.4.8) but it's just got worse and worse. I'm looking to merge my mac and windows home folders back together and sharing them from a windows server!

  7. #21

    Join Date
    Jul 2006
    Location
    London
    Posts
    2,963
    Thank Post
    160
    Thanked 153 Times in 117 Posts
    Rep Power
    50
    Thanks

    Still a bit stuck though.
    Ive edited the script to reflect my folder structure and changed MEDINA - I assume I need to put the name of my domain in there?

    Anyway, I run it as "sudo sh script.sh year10 tempfile"
    And I get:

    'cript.sh: line 4: syntax error near unexpected token 'do
    'cript.sh: line 4: 'do

    Dont really understand what that means...I really have no idea with bash scripts, sorry.
    I copied the script into notepad (since I can only get on edugeek on an xp VM) and then opened the .txt file in OSX and saved as .sh. That wouldnt have broken some formatting would it? It all looks fine

  8. #22
    DMcCoy's Avatar
    Join Date
    Oct 2005
    Location
    Isle of Wight
    Posts
    3,491
    Thank Post
    10
    Thanked 502 Times in 442 Posts
    Rep Power
    114
    It may have broken the line endings, you could ssh to the server with putty and paste it into a new nano file and then save, hopefully that won't mess up the formatting.

  9. #23

    Join Date
    Jul 2006
    Location
    London
    Posts
    2,963
    Thank Post
    160
    Thanked 153 Times in 117 Posts
    Rep Power
    50
    OK now got a problem, for no obvious reason, where when users log in, the documents, downloads etc folders arnt created, when they were before.

    Nothing at all has changed, permissions are set right, it doesnt make sense.
    They are still given their network folder, but the documents shortcut in the dock shows a question mark and theres only library and a few other folders created

  10. #24
    DMcCoy's Avatar
    Join Date
    Oct 2005
    Location
    Isle of Wight
    Posts
    3,491
    Thank Post
    10
    Thanked 502 Times in 442 Posts
    Rep Power
    114
    OS X will not create the folders for AD users afaik. Thats why I was running the script to copy the template to their home folder.

  11. #25

    Join Date
    Jul 2006
    Location
    London
    Posts
    2,963
    Thank Post
    160
    Thanked 153 Times in 117 Posts
    Rep Power
    50
    Oh right, didnt see the template bit

    Weird though, because the first 2 test users I tried, it created all the folders automatically

  12. #26
    DMcCoy's Avatar
    Join Date
    Oct 2005
    Location
    Isle of Wight
    Posts
    3,491
    Thank Post
    10
    Thanked 502 Times in 442 Posts
    Rep Power
    114
    Some are create by os x when it finds they are not there, you will know if it's copied the template as the ichat icons will be in the Pictures folder.

  13. #27

    Join Date
    Jul 2006
    Location
    London
    Posts
    2,963
    Thank Post
    160
    Thanked 153 Times in 117 Posts
    Rep Power
    50
    Well I just couldnt use that script at all, I corrected whatever spaces had been put in at line 4, but then it had trouble with the 'else' at the end, and hours of changing and retyping it later it still wouldnt run.

    So in the end, I turned on SMB, and created the folders and set the permissions with a windows script. Obviously I'm missing the template this way, but it creates the desktop, downloads and library folders, and ive created the Documents folders with a script.
    Seems to work well enough.

    Not perfect but I was rapidly running out of time and have a lot of other things to do.

    Thanks for all your help dmccoy, and sorry for all the stupid questions.
    Theres still little bits to sort, the printers via managed prefs is one of them, but all the user creation and authentication bits are done so I'm happy

  14. #28

    Join Date
    May 2006
    Location
    West Bromwich
    Posts
    2,192
    Thank Post
    300
    Thanked 215 Times in 185 Posts
    Rep Power
    57
    how many users do you have? I only had around three hundred or so and decided to manually copy the template profile into each home dir. Once I had edited the template by logging in as a user and then copying that template into the english.lproj template folder using the template app found on the apple-scripts site. I then copied the template onto the desktop. I then copied them manually into each user dir. With the acls propergating through the folders the permissions were created as the files copied in as expected. The only issue I saw was the drop box but we don't use them anyway. I would like to use the script method and will look into it when I have more time.

    For converting line endings I found textwrangler really good as you have the option at the save prompt to choose which type of carriage returns to use.

    Good luck with your adventures. I've yet to find out if mines gonna hold up to the task. That day is Monday.

  15. #29

    Join Date
    Jul 2006
    Location
    London
    Posts
    2,963
    Thank Post
    160
    Thanked 153 Times in 117 Posts
    Rep Power
    50
    Ive got about 300 in each year, and years 10, 11, 12 and 13 use the Macs so thats 1200...bit too many to do manually lol
    But yeah I do find that doing things manually sometimes is quicker than fiddling for hours trying to get the 'quick' way working.

    Good luck for Monday. I've got till Wednesday, will be glad when its survived a day in 'action'



SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Connecting a Windows network to an RM managed Network
    By Scruff in forum Wireless Networks
    Replies: 4
    Last Post: 9th February 2010, 12:53 AM
  2. Comptia Network+ 2005 or Network+ 2007
    By atfnet in forum Courses and Training
    Replies: 5
    Last Post: 20th August 2009, 12:45 PM
  3. Replies: 2
    Last Post: 15th February 2008, 05:22 PM
  4. Map network drives on wireless network
    By woody in forum Windows
    Replies: 24
    Last Post: 1st December 2007, 07:27 PM
  5. terminating CAT5E network cables in network cabinets
    By broc in forum Network and Classroom Management
    Replies: 7
    Last Post: 10th July 2007, 12:54 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
  •