Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Server 2003 logon script - how can I find name and group of current user?

Author
Message
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 7th Aug 2007 21:18
Hi,
As some of you know already, this week I have my ICT exam.
The exam lasts for 5 days, starting on Monday and ending on Friday.
Any help is allowed, as long as I write references and stuff.

I have setup the server and clients, and everything is working ok.
In Active Directory I have three groups: "Lead Doctors", "Doctors" and "Nurses".
I have successfully written logon scripts, like "Add Default printer" and "map H: to home folder on server".
But in the task it also says that "Doctors" and "Nurses" must have a shared folder on the server.

So I was thinking that I could map this to G: on login as well.

after some thought I found that if I could get the username and group the user is currectly logged on to, i could run an IF statement and if the user is in the right group, map the G: to the shared folder. So..

How can I get the username and usergroup of the current user that is trying to log in on a client, And how can I check if this user is a member of the correct group?

My pseudo code:
Quote: "
strGroup1 = "Doctors"
strGroup2 = "Nurses"

strUsername = %username%
strUserGroup = getUserGroup( username )

If strUserGroup = strGroup1 || strUserGroup = strGroup2 Then
net use G: \\server\sharedfolder$
End If
"


I'm not sure if this should be done in java script, batch or vb script?
After some searches online I found a vb script which I couldn't really make out, so my last resort is to come here and ask.

If I can't get this figured out, I'll have to drop it and get some minus points :/ but I'd rather not.

Thanks for your time.

Login to post a reply

Server time is: 2024-11-19 01:41:25
Your offset time is: 2024-11-19 01:41:25