+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 17
Scripts Thread, script commands in Coding and Web Development; Hi all, anyone know where i can get a definitive list of all the scripting commands? or tell me how ...
  1. #1
    chalkwellstu's Avatar
    Join Date
    Sep 2007
    Location
    Leigh on Sea
    Posts
    148
    Thank Post
    5
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    script commands

    Hi all, anyone know where i can get a definitive list of all the scripting commands? or tell me how i write ....

    if strusername = abc then filename = xyz

    thanks

  2. #2

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,946
    Thank Post
    3,479
    Thanked 1,095 Times in 1,008 Posts
    Rep Power
    372
    Quote Originally Posted by chalkwellstu View Post
    Hi all, anyone know where i can get a definitive list of all the scripting commands? or tell me how i write ....

    if strusername = abc then filename = xyz

    thanks
    are you wanting the script to write a text file and name it with xyz???
    In vbscript for the username side :

    Code:
    Set WshNetwork = WScript.CreateObject("WScript.Network")
    Dim strUser
     strUser = WshNetwork.UserName
    
    If strUse="Persons_UserName" Then
    file = "xyz"  '<-- put your code here for the file name
    End If

  3. #3
    chalkwellstu's Avatar
    Join Date
    Sep 2007
    Location
    Leigh on Sea
    Posts
    148
    Thank Post
    5
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Quote Originally Posted by gecko View Post
    are you wanting the script to write a text file and name it with xyz???
    In vbscript for the username side :

    Code:
    Set WshNetwork = WScript.CreateObject("WScript.Network")
    Dim strUser
     strUser = WshNetwork.UserName
    
    If strUse="Persons_UserName" Then
    file = "xyz"  '<-- put your code here for the file name
    End If
    thanks Gecko thats the sort of thing i am looking for. i am basically writing a logoff script and want to split the results between staff and student.

  4. #4

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,946
    Thank Post
    3,479
    Thanked 1,095 Times in 1,008 Posts
    Rep Power
    372
    how are you determining if they are a staff member or student member via there username ?

    also what results do you want outputting to this text file and where do you want it stored and what are you going to call this log file ?

  5. #5
    chalkwellstu's Avatar
    Join Date
    Sep 2007
    Location
    Leigh on Sea
    Posts
    148
    Thank Post
    5
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Quote Originally Posted by gecko View Post
    how are you determining if they are a staff member or student member via there username ?

    also what results do you want outputting to this text file and where do you want it stored and what are you going to call this log file ?
    i am playing with a script i got from this forum to write internet history to an htm file. i am trying to teach myself script by making alterations to the program. at present the script dumpsd all output into one folder on the server. i want to split between staff and pupils so thought if i could determine staff(as there is less of them) i could default the rest as students.

  6. #6

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,946
    Thank Post
    3,479
    Thanked 1,095 Times in 1,008 Posts
    Rep Power
    372
    where is the script so I can have a look at it and also need some way of determing staff from students....

  7. #7
    chalkwellstu's Avatar
    Join Date
    Sep 2007
    Location
    Leigh on Sea
    Posts
    148
    Thank Post
    5
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Quote Originally Posted by gecko View Post
    where is the script so I can have a look at it and also need some way of determing staff from students....
    i haven't started on the split stuff yet but feel free to have a look at this.
    Attached Files Attached Files

  8. #8

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,946
    Thank Post
    3,479
    Thanked 1,095 Times in 1,008 Posts
    Rep Power
    372
    how are you going to determine from the username who is a member of staff and who is a student ?

    Am presuming your students have 04, 05, 06, 07 etc somewhere in there username and staff don't ?

    Or what exactly ?

  9. #9
    chalkwellstu's Avatar
    Join Date
    Sep 2007
    Location
    Leigh on Sea
    Posts
    148
    Thank Post
    5
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    not sure at the mo Gecko. all profile names are the student/staff names (legacy policy). as i am learning script as i go with this i am not aware of the all the posibles yet. first thoughts are .... if username = 'a' or 'b' or 'c' .... then goto staff else goto student

    then each nest would peform the functions dumping into staff or student depending on what it had found.

    as i said not quite sure how i am going to handle this yet .....

    Stu

  10. #10

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,946
    Thank Post
    3,479
    Thanked 1,095 Times in 1,008 Posts
    Rep Power
    372
    Need an example of a staff username and an example of a student username so we can decipher some obvious differences between the 2 types of usernames

  11. #11
    chalkwellstu's Avatar
    Join Date
    Sep 2007
    Location
    Leigh on Sea
    Posts
    148
    Thank Post
    5
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Quote Originally Posted by gecko View Post
    Need an example of a staff username and an example of a student username so we can decipher some obvious differences between the 2 types of usernames
    ok, students profiles are both christian and surname together e.g. johnsmith staff profiles are just the christian name e.g. john

    thanks Gecko

  12. #12

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,946
    Thank Post
    3,479
    Thanked 1,095 Times in 1,008 Posts
    Rep Power
    372
    Quote Originally Posted by chalkwellstu View Post
    ok, students profiles are both christian and surname together e.g. johnsmith staff profiles are just the christian name e.g. john

    thanks Gecko
    so aall staff user accounts only use there first name ( ie John ) for the username for logging in where as students have both the first name and last name ie

    johnsmith or markjones

    So to determine if it was a staff member we just need to match the firstname with the username ?

  13. #13

    Join Date
    Jun 2007
    Location
    London
    Posts
    894
    Thank Post
    64
    Thanked 171 Times in 140 Posts
    Rep Power
    55
    Have a look at Kixtart - http://www.kixtart.org/ - you could use a Kixtart logoff script to distinguish between users on basis of AD groups. Might solve your problem?

  14. #14
    chalkwellstu's Avatar
    Join Date
    Sep 2007
    Location
    Leigh on Sea
    Posts
    148
    Thank Post
    5
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    yeah thats right Gecko, and thanks timzim i'll give that a look as well.

    Stu

  15. #15

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,946
    Thank Post
    3,479
    Thanked 1,095 Times in 1,008 Posts
    Rep Power
    372
    Code:
    Dim objUser, objComputer
    
    ComputerName = "server_name" '<<-- alter this to your servers name
    
    Set objComputer = GetObject("WinNT://" & ComputerName)
    
    For each objUser in objComputer
    
    wscript.echo objUser.name  '<-- this line
    
    next
    in the above code where I have commented this line

    Is where you can change it from objUser.name to

    objUser.Description

    OR

    objUser.FullName

    as per the win32_UserAccount class :

    http://msdn2.microsoft.com/en-us/lib...07(VS.85).aspx

    If you could test that and give me a few examples back of each outcome

    ie what you get when you use fullname

    what you get when you use description

    etc

    so that I know if it is returning any useful info ie if it always returns the word student or staff in description

    If thats the case then that may be easier then trying to determine if there last name is outputted as a null string ie nothing to establish that its a staff member and if not then its a student.

    you need to alter the first line to the name of your server ie

    ComputerName = "MyServer" '<<-- alter this to your servers net bios name or i.p address
    Last edited by mac_shinobi; 29th January 2008 at 05:00 PM.

  16. Thanks to mac_shinobi from:

    chalkwellstu (29th January 2008)



SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Server 2003 run commands.
    By starscream in forum Wireless Networks
    Replies: 3
    Last Post: 26th June 2007, 11:49 AM
  2. Running local commands remotely
    By MK-2 in forum Windows
    Replies: 6
    Last Post: 2nd March 2007, 11:31 AM
  3. VLAN Simulator - Commands
    By Nij.UK in forum Wireless Networks
    Replies: 1
    Last Post: 20th February 2007, 02:27 PM
  4. unix and sql commands
    By danIT in forum General Chat
    Replies: 9
    Last Post: 14th February 2007, 02:19 PM
  5. Avantis CDServe shortcut commands
    By WithoutMotive in forum How do you do....it?
    Replies: 2
    Last Post: 18th July 2006, 11:36 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
  •