+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
Windows Thread, ex pupils and staff accounts in Technical; Cheers Rob. new to this scripting lark. That worked. 230 orphaned home folders. not too bad i guess. Now to ...
  1. #16

    Join Date
    Jun 2008
    Posts
    142
    Thank Post
    19
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Cheers Rob.

    new to this scripting lark. That worked. 230 orphaned home folders. not too bad i guess.

    Now to delete them manually!

  2. #17

    Join Date
    Nov 2006
    Location
    Kendal
    Posts
    1,555
    Thank Post
    112
    Thanked 177 Times in 144 Posts
    Rep Power
    71
    We delete staff accounts the week after they leave (or in September if they leave over summer) but archive stuff to DVD.

    Students get deleted at the end of the academic year (usually the last week in August) and again are archived to DVD.

    The DVDs are stored until I get round to a clear out but for a min of 3 years in case exam boards want work etc.

  3. #18

    Sylv3r's Avatar
    Join Date
    Jul 2005
    Location
    Co. Durham
    Posts
    3,212
    Thank Post
    372
    Thanked 379 Times in 337 Posts
    Rep Power
    148
    Student accounts are deleted straight away after a backup of all documents.

    Students entering our sixth form do not carry forward their Year 7 - 11 work. I create new accounts for them.

    When staff leave they get a copy of all their work on CD / DVD - floppy disk for some! Their accounts are disabled and deleted after a backup and 6 months have passed.

  4. #19

    Join Date
    Oct 2008
    Location
    Somewhere in the north
    Posts
    351
    Thank Post
    11
    Thanked 14 Times in 12 Posts
    Rep Power
    15
    Immediately staff leave we put them in a "leavers" folder and disable the account. We send out a memo a few weeks before they leave asking them to give files to successors etc. After a while and a backup we delete them. The exception is if they aren't really leaving - a couple of retired teachers do supply work, as does one of the office ladies.

    Students, we're very often not told about (despite the introduction of a ticklist for HOYs to use) until they have been gone some time. I try to do a termly comparison of a list of users against a copy of the school roll. Year 11s/13s we get rid of if they don't come back in September. Keeping all accounts frozen until Christmas and disposing around then (which reminds me I've not done it this year yet!).

  5. #20

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,156
    Thank Post
    116
    Thanked 529 Times in 452 Posts
    Blog Entries
    2
    Rep Power
    124
    Quote Originally Posted by stu1892 View Post
    Cheers Rob.

    new to this scripting lark. That worked. 230 orphaned home folders. not too bad i guess.

    Now to delete them manually!
    Aaaarrrrgh :-)

    You've got this far with the script, just take a bit of time to get the rest of it done!
    The key bit is here:
    Code:
        If strADPres = "Present" Then
            EchoAndLog Date & "," & Time & "," & strUNCStart & "\" & objSubFolder.Name & "," & "Folder/User is ok."
        Else
            EchoAndLog Date & "," & Time & "," & strUNCStart & "\" & objSubFolder.Name & "," & "Folder/User is bad. User Not Found!"
        End If
    This is writing to the log file the good/bad folders so you just want to add something to delete the bad folders - it could be as simple as:
    Code:
    objfso.deletefolder(strUNCStart & "\" & objSubFolder.Name)
    added after the "else" or (to be safer!) you can do
    Code:
    objfso.movefolder strUNCStart & "\" & objSubFolder.Name strUNCStart & "\archive\"
    (make sure you have a folder called archive under the root of the home folders - eg if the server has d:\home\user1, d:\home\user2 etc then make a d:\home\archive)

    This isn't perfect - the next time you run it, it will try and delete the archive folder - but I'm afraid I've not got time to work out how to specify a better location in that script. I'm sure that by the time you need it again your scripting will be good enough :-)

  6. #21

    Join Date
    Jun 2008
    Posts
    142
    Thank Post
    19
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Code:
        If strADPres = "Present" Then
            EchoAndLog Date & "," & Time & "," & strUNCStart & "\" & objSubFolder.Name & "," & "Folder/User is ok."
        Else
            EchoAndLog Date & "," & Time & "," & strUNCStart & "\" & objSubFolder.Name & "," & "Folder/User is bad. User Not Found!"
    	objfso.movefolder strUNCStart & "\" & objSubFolder.Name strUNCStart & "\archive\"
         End If
    Hope i've done that right.

    I'm getting an expected end of statement here, (where the bold starts)

    objfso.movefolder strUNCStart & "\" & objSubFolder.Name strUNCStart & "\archive\"

    I'm guessing the one of the statements need to be in brackets???

  7. #22

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,156
    Thank Post
    116
    Thanked 529 Times in 452 Posts
    Blog Entries
    2
    Rep Power
    124
    sorry; shouldn't type stuff late at night when I can't test the code!

    Code:
    objfso.movefolder strUNCStart & "\" & objSubFolder.Name, strUNCStart & "\archive\"
    I missed a comma missing between the source and destination.

    You don't need brackets with movefolder; you do need them with deletefolder and I don't know why :-(

    These are links to the MSDN item on deletefolder and movefolder - they have examples and docs.

  8. Thanks to srochford from:

    stu1892 (8th January 2009)

  9. #23

    Join Date
    Jun 2008
    Posts
    142
    Thank Post
    19
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Cheers Steve.

    It worked up until the next orphaned folders beginning with 'B'!.

    It looks like it's stopping with the archive folder. I'll need to move where the archive folder is. as it's checking the archive folder as a home directory.

    Thanks to the technicians i inherited these users from, there's a load of users that still exist but their usernames have been changed and home folders left the way they were
    Last edited by stu1892; 8th January 2009 at 09:59 AM.

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

Similar Threads

  1. Laptops for pupils ans staff use
    By markman in forum General Chat
    Replies: 4
    Last Post: 25th September 2008, 08:07 PM
  2. Setting up remote access to staff user accounts
    By firefox_2006 in forum How do you do....it?
    Replies: 9
    Last Post: 19th May 2008, 12:30 PM
  3. Replies: 11
    Last Post: 7th March 2008, 08:37 AM
  4. Replies: 3
    Last Post: 15th February 2008, 12:58 PM
  5. Replies: 3
    Last Post: 1st August 2007, 10:00 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
  •