+ Post New Thread
Results 1 to 8 of 8
Scripts Thread, making passwords help in Coding and Web Development; for the newyear 7 i have a csv file, but this year it has nothing in i want to use ...
  1. #1
    browolf's Avatar
    Join Date
    Jun 2005
    Location
    Mars
    Posts
    1,527
    Thank Post
    107
    Thanked 89 Times in 75 Posts
    Blog Entries
    46
    Rep Power
    40

    making passwords help

    for the newyear 7 i have a csv file, but this year it has nothing in i want to use as passwords. i made a vbscript to append paswords onto the file but it doesnt work properly. i mean it works but the output isnt right. only the first two items in each array are used in generating the password.

    what have i done wrong?

    Code:
    wordbank1 = Array("red","green","blue","yellow","pink","orange","purple","blue","black","white","angry","scary","sporty","posh","lazy","big","crazy","dizzy","dull","funny","great","gigantic","jolly","kind","mighty","new","nice","odd","quaint","quick","rare","roasted","round","sad","short","silly","strange","tricky","tough","wonderful","zany","striped","itchy")
    
    wordbank2= Array("elephant","donkey","wolf","rabbit","rat","hamster","mouse","cat","dog","sparrow","magpie","alligator","bison","condor","fox","eagle","swan","duck","owl","snake","hedgehog","kinkajou","bear","shark","llama","frog","lemur","hawk","tiger","lion","boar")
    
    
    Const ForReading = 1, ForWriting = 2
    
    inputfile="2005admissions.csv"
    
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set MyFile = fso.OpenTextFile(inputfile, ForReading)
    
    Do While MyFile.AtEndOfStream <> True
          retstring = MyFile.ReadLine
    	  password = wordbank1(rnd(ubound(wordbank1))) & wordbank2(rnd(ubound(wordbank2)))
    	  wscript.echo retstring & "," & password
    	  
    
    Loop
    MyFile.Close

  2. #2
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    5,013
    Thank Post
    120
    Thanked 283 Times in 261 Posts
    Rep Power
    108

    Re: making passwords help

    At a quick glimpse I think you need to use the lbound and ubound functions to read completely through an array. eg

    Code:
    For i =  LBound(ArrBadStudents) to UBound(ArrBadStudents)
    A word of advice to all when generating passwords, do not use the date of birth!!!! I used the first two digits and initials last year only to find if a certain form hadnt been returned then they are made up and are wrong in SIMS!!!!

  3. #3
    tosca925's Avatar
    Join Date
    Aug 2005
    Location
    Midlands
    Posts
    1,547
    Thank Post
    4
    Thanked 4 Times in 4 Posts
    Rep Power
    22

    Re: making passwords help

    I got stung last year as well. We used dates of birth from Sims and then found the admin staff had made up over 80 DOB just to get them on the system before they broke up for the summer holidays.

    We just generated random numbers in our .csv file in excell this year.

  4. #4

    GrumbleDook's Avatar
    Join Date
    Jul 2005
    Location
    Gosport, Hampshire
    Posts
    9,950
    Thank Post
    1,345
    Thanked 1,799 Times in 1,117 Posts
    Blog Entries
    19
    Rep Power
    597

    Re: making passwords help

    We use a standard password for all new year 7's but we are running an extra induction day for them this year ... on 31st August when they will have the ICT Induction and the ICT Teachers will talk them through logging on, changing passwords, access email, saving work etc.

    The accounts of those students that attend will only be enabled after a register is read.

  5. #5
    tarquel's Avatar
    Join Date
    Jun 2005
    Location
    Powys, Mid-Wales, UK
    Posts
    1,740
    Thank Post
    13
    Thanked 45 Times in 35 Posts
    Rep Power
    29

    Re: making passwords help

    @GrumbleDook:

    Same here with the standard initial password for new first year - also is the same to new student users too.

    They then *have* to change it during the first logon

    Works fine on the XP machines but the 98 pc's seem to either do the process or fail on that process. Used to work fine with the NT 4 Server & 98 PC setup, but not now with the 2003 server.

    Still, not too bigger problem really - theres now plenty of xp pc's to do it on lol

    Regards,
    Nath

  6. #6
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    34

    Re: making passwords help

    Browolf,

    You are using the RND function incorrecty (check the MS reference for details). Basically, to generate a random number between X and Y,

    RandomNumber = INT(((Y-X) * RND) + X + 0.5)

    You should also initialise the random number generator at the beginning of your code with the RANDOMIZE statement. This will use the system timer as a seed.

    So, try the following to replace your 'password =...' line

    Code:
    Rnd1 = int(((ubound(wordbank1)-lbound(wordbank1)) * rnd) + lbound(wordbank1) + 0.5)
    Rnd2 = int(((ubound(wordbank2)-lbound(wordbank2)) * rnd) + lbound(wordbank2) + 0.5)
    password = wordbank1(Rnd1) & wordbank2(Rnd2)

  7. #7
    browolf's Avatar
    Join Date
    Jun 2005
    Location
    Mars
    Posts
    1,527
    Thank Post
    107
    Thanked 89 Times in 75 Posts
    Blog Entries
    46
    Rep Power
    40

    Re: making passwords help

    thx. got it working using

    password = wordbank1(cint(ubound(wordbank1) * rnd)) & wordbank2(cint(ubound(wordbank2) * rnd))

    although having created userareas an IT teacher thinks year 7 may have difficulty spelling such long passwords. apparently its common for them not to know there are 52 weeks in a year. oh dear!

    one slight problem I had that i'm pretty sure wasnt a problem last year. i've added the userareas as \\server\share$\username. this is the format i've used when manually adding users throughtout the year and win2k maps straight to the last folder. when i've tried these automatic created users users it doesnt do that for no apparent reason their userarea maps to \\server\share$ instead.

  8. #8

    Dos_Box's Avatar
    Join Date
    Jun 2005
    Location
    Preston, Lancashire
    Posts
    10,486
    Thank Post
    613
    Thanked 2,194 Times in 1,006 Posts
    Blog Entries
    23
    Rep Power
    634

    Re: making passwords help

    Have you created a default user for each group (teacher, pupils, admin etc)? Once created you simply insert the following line into home folder path \\servername\users\%username% the username variable will then automatically create a username with their folder and correct permissions.

SHARE:
+ Post New Thread

Similar Threads

  1. Making an online community ?
    By callumtuckey in forum General Chat
    Replies: 5
    Last Post: 16th November 2007, 10:02 PM
  2. Making my home PC raid
    By ranj in forum Hardware
    Replies: 4
    Last Post: 17th June 2007, 06:21 PM
  3. VLE, making the right choise.
    By maniac in forum Virtual Learning Platforms
    Replies: 5
    Last Post: 8th February 2007, 09:04 AM
  4. Making RDP more secure
    By mattx in forum Windows
    Replies: 2
    Last Post: 7th February 2007, 01:52 PM
  5. Making Up DVDs for Drama etc
    By mark in forum Recommended Suppliers
    Replies: 4
    Last Post: 4th May 2006, 11:12 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
  •