Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Still confused on scripting..

Status
Not open for further replies.

snootalope

IS-IT--Management
Jun 28, 2001
1,706
0
0
US
We have: 2k domain with AD

I got my login scripts working to an extent. I still need to be able to map a certain drive depending on what groups that person is a member of..
So, let's say I'm a member of the "IT"(in AD) group and only people in the IT group get mapped to the IT share on the server..
How do I do this? With wscript, cscript, or can I do this in a batch file?

Is it if member of "IT" then.. bla bla bla????? (i'm thinking novell)
If anyone has a copy of thier's that would greatly appreciated, even if you only give me that commands!!! Anything would be great!!!!!! "tis better to remain silent and be thought of as a fool..
then open your mouth and remove all doubt" Mark Twain

"I should of been a doctor.." Me
 
A basic way of doing it is to create a logon.bat (or logon.cmd if all 2000 users) for each group. I mean creat a logonit.cmd for it and logonac for accounting. each with specific mappings and such. That is a basic no software needed way. If you are wanting a more robust way then wscript and cscript may be better I think. James Collins
Hardware Engineer
A+ Certified Professional
Network+ Certified Professional
Microsoft Certified Professional

 
Ok.. Thats sounds great and lets say I do it that way.. How do I make the login scripts see the certain groups? How do I asign a group to a certain login script? I have a lot of users and a lot of groups, so asigning user by user is way out of the question.. "tis better to remain silent and be thought of as a fool..
then open your mouth and remove all doubt" Mark Twain

"I should of been a doctor.." Me
 
You could use IFMEMBER (from the Res Kit I think), eg

ifmember Accounts call logon_accounts.cmd
ifmember "System Support" call logon_syssup.cmd

 
I can use that IFMEMBER statement inside of that batch I wrote or does that have to be inside of a different script, like vbs or java? The way I'm understanding it is that you have to call another, more intelligent, script to get that done.. is there a kit or something that I can install on the server that recongnizes those commands? "tis better to remain silent and be thought of as a fool..
then open your mouth and remove all doubt" Mark Twain

"I should of been a doctor.." Me
 
I'm pretty sure you can run it from a straight batch file, the file itself just needs to be in the NETLOGON directory.
 
Yep Bront'y is right. You can use that command in a normal batch file. (You don't need vbs, Java...etc for that). If you want you could just use one large login script, eg

ifmember Accounts goto ACCOUNTS
ifmember "System Support" goto SYSSUP
goto END

:ACCOUNTS
Accounts specific stuff goes here
goto END

:SYSSUP
Systems Support specific stuff goes here
goto END


Of course for this to work you need to have the IFMEMBER.EXE file from the Resource Kit!
 
Here's my experiances
1) the login.bat needs to be in the Netlogon folder
2) unless you want to install ifMember.exe on ALL your computers ifMember.exe must ALSO be in the Netlogon folder.
3) if in a DOMAIN this must be included in the IfMember statement [i.e. \\DC1\Netlogon\IfMember.exe DOMAIN\USER]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top