+ Post New Thread
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 31
Scripts Thread, My Docs, Class Shared & Shortcut generator in Coding and Web Development; Right.... This is finally something to be happy with.. There's a bit of unexplained behaviour going on (ie: it's trying ...
  1. #16
    contink's Avatar
    Join Date
    Jul 2006
    Location
    South Yorkshire
    Posts
    3,791
    Thank Post
    303
    Thanked 327 Times in 233 Posts
    Rep Power
    118

    Re: My Docs, Class Shared & Shortcut generator

    Right....

    This is finally something to be happy with.. There's a bit of unexplained behaviour going on (ie: it's trying to access the A: drive for some reason) but this now does what it's supposed to..

    Feel free to play around with it and note you'll need the xcacls.vbs

    ... and to place it in the same directory as the actual script (or alter the path to xcacls.vbs)

    I'd appreciate any assistance with the mystery drive A: requests and in getting the error handling to be more specific to ignore the expected errors that might be called (eg: group exists, member exists, etc.. ) and die at those it shouldn't.

    I've also found that the xcacls.vbs calls will result in a pop up saying extended error reporting is turned off and using cscript as part of the wshell.run just gets you a CMD window so it's a choice of evils there...


    Anyway, comments welcome.. preferably good ones ... but hey :P

  2. #17
    contink's Avatar
    Join Date
    Jul 2006
    Location
    South Yorkshire
    Posts
    3,791
    Thank Post
    303
    Thanked 327 Times in 233 Posts
    Rep Power
    118

    Re: My Docs, Class Shared & Shortcut generator

    Right... some of this stuff is untested.. but I figure I'll post up the current structure as it's close to being there.

    I've split the system further so that there's now 3 script files.

    1. usr_fldr_struc_create_man-eg.vbs
    The main script to be run whenever a major update has taken place to student users, classes... and before the new school year starts

    2. usr_fldr_struc_create_login-eg.vbs
    This is part #1 of the login script that deals with any minor updates as part of the login process.. If someone logs in that was added late in the day (ie: joined a class mid term, etc...) then the script will create their individual folders and add them to the relevant security group.

    3. usr_fldr_map_login.vbs
    This is the simplest part of the whole deal and just maps the relevant folders to drive letters as well as redirecting the mydocs to the right place.


    The scripts have notes in them that should explain how it's supposed to work and you'll probably pick bits up from the rest of the thread.

    What definitely works (for me at least) is part #1 which is the meat of the system. The follow up bits are getting tested and debugged tomorrow..

  3. #18
    contink's Avatar
    Join Date
    Jul 2006
    Location
    South Yorkshire
    Posts
    3,791
    Thank Post
    303
    Thanked 327 Times in 233 Posts
    Rep Power
    118

    Re: My Docs, Class Shared & Shortcut generator

    Apologies to anyone who tried the last set of scripts but I'm guessing that lack of replies complete with gnashing of teeth, etc... mean't there were few who tried :P

    There were a few issues with the original set that have since come to light so I spend some time working on them properly using my new VM setup for testing (very useful!).


    Changelog:
    • Fix: containerName (cn) different from sAMusername (account login) failed to create logins
    • Removed: attempt to add users to security group in login script (usr_fldr_create_login.vbs). Relevant permissions not available as users aren't admins.
    • Fix: corrected key => val for my docs and my pictures
    • Fix: missing variable value for shortcut destinations
    • ... plus various other small bug fixes.


    This has been tested on my test LAN so it should now work properly but a few things to be aware of:
    - GPO for pupils needs to be set:
    Computer Configuration/Administrative Templates/System/Scripts/Run logon scripts synchronously - TRUE
    .. otherwise the map_login will clash with the create_login script.

    Before you get ANY children to login you will need to run the:
    usr_fldr_struc_create_man.vbs
    .. script first as an admin on your fileserver. This sets up shared folders, permissions. I've found that for some reason you need to run this twice to get permissions to take (Not sure why).

    In terms of running the scripts.. Set for your pupils OU as login scripts to run in order:
    - usr_fldr_struc_create_login.vbs
    - usr_fldr_map_login.vbs


    Comments, as always, welcome.


    Note: -eg postfix in the scripts is just for my own reference. These have generic directory and AD settings.

  4. #19
    contink's Avatar
    Join Date
    Jul 2006
    Location
    South Yorkshire
    Posts
    3,791
    Thank Post
    303
    Thanked 327 Times in 233 Posts
    Rep Power
    118

    Re: My Docs, Class Shared & Shortcut generator

    Whoops.. found a bug... ACL's to be precise...

    Have written something in to tackle it but need to test before release...

  5. #20
    alonebfg's Avatar
    Join Date
    Aug 2006
    Location
    south west some of the time
    Posts
    834
    Thank Post
    12
    Thanked 34 Times in 21 Posts
    Blog Entries
    5
    Rep Power
    24

    Re: My Docs, Class Shared & Shortcut generator

    I have downloaded all three and it looks really good I do have a problem when i downloaded i cant read two of the scripts.

  6. #21
    contink's Avatar
    Join Date
    Jul 2006
    Location
    South Yorkshire
    Posts
    3,791
    Thank Post
    303
    Thanked 327 Times in 233 Posts
    Rep Power
    118

    Re: My Docs, Class Shared & Shortcut generator

    Quote Originally Posted by alonebfg
    I have downloaded all three and it looks really good I do have a problem when i downloaded i cant read two of the scripts.
    Yeah... think I left them in Nix format...

    I've got some changes to make and re-upload so I'll sort the formatting issue then.

  7. #22
    contink's Avatar
    Join Date
    Jul 2006
    Location
    South Yorkshire
    Posts
    3,791
    Thank Post
    303
    Thanked 327 Times in 233 Posts
    Rep Power
    118

    Re: My Docs, Class Shared & Shortcut generator

    Ok... Yet another release but this one seems to have resolved most of the bugs and mistakes in the earlier versions

    Code:
    '*	$Author: martin $
    '*	$Date: 2007-09-26 08:54:49 +0100 (Wed, 26 Sep 2007) $
    '*	$Revision: 27 $
    Changelog:
    • Permissions using XCACLS.vbs now fixed to interactive mode (more info)
    • XCACLS.vbs only used in the man(ual) script as permissions require an admin
    • Shortcuts now include one to the class share folder
    • Security Group now uses global rather than local to meet requirement for setting ACLs to access shared folders
    • Minor tweaks and bug fixes



    This is what I would call release code as I've now got this up and running in three schools.

    The things to watch out for however are as follow:[list=1][*]You need to run the manual script every time you create a new user (possible scheduled task?)[*]If you do run as a scheduled task you need to be running as an admin[*]The XCACLS.vbs output is annoying with lots of pop up CMD windows but it does avoid the warning boxes re: "not using cscript" that //B mode creates.[*]Time wise the manual script requires approximately 1 minute per class of 25 children so if you have a big school it'll take some time.[/list]


    Beyond that functionality hasn't changed a huge amount.. The three script approach seems to work much better but remember you still need scripts to run asynchronously.
    Attached Files Attached Files

  8. #23
    contink's Avatar
    Join Date
    Jul 2006
    Location
    South Yorkshire
    Posts
    3,791
    Thank Post
    303
    Thanked 327 Times in 233 Posts
    Rep Power
    118
    Been doing a LOT of work on this after I discovered a heap of problems with some of my login scripts in one school.

    It's still very much in development so there's no new code to share until I've finished off the remainder and done a bit more testing but just to share:

    1. Found a useful reference for "including" vbs code How to include a file from within a VBScript script
    2. Use the above to break variables out into a config file and make like a LOT easier for multiple site configs
    3. Resolved a problem with waitforfolder() fn... Somehow a variable was being changed by reference in a rather unexpected way... Redefining the variable after any createflds() calls has fixed that
    4. The use of XCACLs.vbs has been tightened up
    5. Added more class OU's to the list and resolved a precedence issue with class 10/11/12/etc... being put into Class 1 *oops*
    6. Class-Foo accounts (ie: for whole class) now default their home directory to the class shared folder
    7. Script waits for the wshNetwork.UserName to be defined before it tries to do anything avoiding a few errors
    8. Fixed an issue that stopped new OU members from being added to the proper security group for the class.
    9. Now possible to specify an individual to add to the system and relevant class security group without running through EVERY user.



    All, in all it's looking a lot neater and a heck of a lot easier to use than before... I need to sort out the staff version and test a few bits with the mapped login but otherwise... Looking good...

  9. #24
    contink's Avatar
    Join Date
    Jul 2006
    Location
    South Yorkshire
    Posts
    3,791
    Thank Post
    303
    Thanked 327 Times in 233 Posts
    Rep Power
    118
    Right... I finally got the code ready for distribution.

    A couple of additional features are now included:
    • map-drives.setup file included for all drive mapping not already handled by the main script (eg: apps drives, etc..)
    • printer.setup file included. Basically a printer loader and default setup script.. Called right at the end.


    Before you do anything you will need to setup the school.config with the appropriate variables and then run the "usr_fldr_struc_create_man.vbs" file on the server in order to get it to create the relevant folders and set permissions. Expect it to take quite a while.

    Once you've run it first time, you will need to run it again for any new accounts you create that require adding to usergroups, and have folders setup, etc... This is made easier in this version thanks to the new "strIndUser" variable at the top of the -man.vbs file. You specify the username you've added and wish to incorporate into the structure and the script will run through and do the work on just that one user, adding them to the relevant class, security group, etc... It doesn't do groups yet but I may add that functionality in the future.


    Past that the rest is login script.
    In a nutshell the "usr_fldr_map_login.vbs" script ensures that you get all your scripts to run but in a specific order and only requiring you to setup that single script either in the AD > Profile > Logon Script field or as your login script GPO.

    In my case it means I no longer have to run scripts asynchronously so that could be disabled in GPO too if you use it in a similar manner.


    Caveat:
    One thing I have noticed with this script set is that you have to login once successfully, log off and the log in again, in order to get the drive mappings from the map-drives.setup to work properly. Not sure why yet but that's a known "Feature".
    Attached Files Attached Files
    Last edited by contink; 3rd May 2009 at 11:24 PM. Reason: typo

  10. #25

    EduTech's Avatar
    Join Date
    Aug 2007
    Location
    Reading
    Posts
    5,070
    Thank Post
    160
    Thanked 927 Times in 729 Posts
    Blog Entries
    3
    Rep Power
    273
    This looks rather interesting, well done contink

    I'll have a play with this on tuesday and give you some feedback.

    James.

  11. #26
    contink's Avatar
    Join Date
    Jul 2006
    Location
    South Yorkshire
    Posts
    3,791
    Thank Post
    303
    Thanked 327 Times in 233 Posts
    Rep Power
    118
    Quote Originally Posted by EduTech View Post
    This looks rather interesting, well done contink

    I'll have a play with this on tuesday and give you some feedback.

    James.
    Cheers James... I'd recommend reading back from the beginning to get an idea of what it was originally intended to do...

    I'm re-writing the staff code now as that's separate. All in all, it's something I've used for a while albeit with a few bugs I hadn't spotted (as it sort of worked) until last Friday so this new version is vastly improved.

    Feedback welcome though... provided you can provide fixes with any problems

  12. #27

    EduTech's Avatar
    Join Date
    Aug 2007
    Location
    Reading
    Posts
    5,070
    Thank Post
    160
    Thanked 927 Times in 729 Posts
    Blog Entries
    3
    Rep Power
    273
    Quote Originally Posted by contink View Post
    Cheers James... I'd recommend reading back from the beginning to get an idea of what it was originally intended to do...

    I'm re-writing the staff code now as that's separate. All in all, it's something I've used for a while albeit with a few bugs I hadn't spotted (as it sort of worked) until last Friday so this new version is vastly improved.

    Feedback welcome though... provided you can provide fixes with any problems
    Yeah mate i was just having a quick read through, i will have a proper read through this thread tomorrow.

    Ofcourse if i find any bugs, i'll give you a solution also (if i can work it out) i aint that nasty

    James.

  13. #28
    contink's Avatar
    Join Date
    Jul 2006
    Location
    South Yorkshire
    Posts
    3,791
    Thank Post
    303
    Thanked 327 Times in 233 Posts
    Rep Power
    118
    Done a bit more work on it and broken out a few more variables that would doubtless need customising.

    I'll post it up tomorrow when my brain is in gear... Aware that the code is a bit hinky at the moment or more accurately, my thought processes are out of whack so I'll stop for a bit and review tomorrow with fresh head.

  14. #29
    contink's Avatar
    Join Date
    Jul 2006
    Location
    South Yorkshire
    Posts
    3,791
    Thank Post
    303
    Thanked 327 Times in 233 Posts
    Rep Power
    118
    Ok... Final release for this with the following changes:

    • Staff code has now been written and should be working in the same way as the student (usr) code
    • Drive letters to be used in the "home", "share", "childrens work" mappings have been pulled across into the school.config file so you can set your own drive letters


    I've now tested it in the real world and the files are running MUCH better than in the past... The man (Manual) files handle the permissions and folder creation relatively quickly now that I've resolved the issue of the directory being altered by reference in the folder creation function.

    All in all... Much better and the fact that I can configure the variables separately from the main code means I can have custom setups for each school without hashing things up every time...


    I'll rewrite the documentation on this lot properly when I get some time... Comments, bugs, etc... appreciated though.
    Attached Files Attached Files

  15. #30
    contink's Avatar
    Join Date
    Jul 2006
    Location
    South Yorkshire
    Posts
    3,791
    Thank Post
    303
    Thanked 327 Times in 233 Posts
    Rep Power
    118
    Whoops... found a bug...

    Forgot that the LDAP paths were different for staff...

    Fix provided below... just grab the file above and then the fix files and overwrite the originals with the fix files... I'll sort a proper release when I'm back in the office and have updated my SVN repos.
    Attached Files Attached Files

SHARE:
+ Post New Thread
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Educational Jargon Generator
    By beeswax in forum Jokes/Interweb Things
    Replies: 11
    Last Post: 6th January 2008, 05:45 PM
  2. BAD dotNet docs
    By PiqueABoo in forum Coding
    Replies: 1
    Last Post: 10th November 2007, 02:54 PM
  3. My Docs access problem
    By Ste_Harve in forum Windows
    Replies: 2
    Last Post: 30th August 2007, 12:32 PM
  4. Cartoon face generator
    By _Bat_ in forum General Chat
    Replies: 5
    Last Post: 7th February 2007, 12:12 PM
  5. Class Server Authentication and Class Sites
    By dagza in forum Virtual Learning Platforms
    Replies: 2
    Last Post: 15th November 2006, 12:05 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
  •