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
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
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.
where is the script so I can have a look at it and also need some way of determing staff from students....
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 ?
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
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
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 ?
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?
yeah thats right Gecko, and thanks timzim i'll give that a look as well.
Stu
in the above code where I have commented this lineCode: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
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.
chalkwellstu (29th January 2008)
There are currently 1 users browsing this thread. (0 members and 1 guests)