?
Solved

VB Login Script

Posted on 2003-02-25
3
Medium Priority
?
318 Views
Last Modified: 2010-03-18
Hi This is my first time posting on the board I am very happy I found it...

I need to creat a login script that reflects the group that the user is in and then determines what script to run without any user interaction.  All the user has to do is logon.

Basically if I have a group called Accounting and they have a mapped network drive for accounting.  How do I make so that when a user logs in that is in the Accounting group that the drive mapping for the accounts comes up automatically with out the user having to run a batch file?

I am almost positive that this needs to be done with a VB script using the IF THEN ELSE syntax and direction would be appreciated.

Thanks Alot

Compgrrrl
0
Comment
Question by:Compgrrrl2000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 4

Accepted Solution

by:
0byte earned 200 total points
ID: 8024673
refer
http://www.experts-exchange.com/Networking/Q_20396279.html


other info
Syntax for NET USE is slightly different between Windows95/98/ME and WindowsNT/2000/XP.
Here is an example of where this comes in handy to meet the requirements of your question and others I've had for myself.

At the top of my Domain Logon Script, I test for 9x vs NT Class workstation and set various environment variables based on their "NET [USE | TIME | CONFIG]" requirements or availability for each of these types of stations (again, 9x vs NT)

Also, don't use Drive Z: for anything. Windows95/98/ME maps this drive letter in order to execute the Domain Logon Script.


good luck

*** START ***

@ECHO OFF
C:
REM Switching to the C: Drive executes faster on NT/2000/XP
REM A Windows95/98/ME station's current drive is initially  Drive "Z:".

IF     [%OS%] == [Windows_NT] GOTO WINNTENV
IF NOT [%OS%] == [Windows_NT] GOTO WIN9XENV

:WINNTENV
SET NETCONFIG=WORKSTATION
SET PERSISTENT=PERSISTENT:
IF EXIST \\%COMPUTERNAME%\ADMIN$\* SET NETTIME=/SET /YES
GOTO ACCESS

:WIN9XENV
SET OS=Windows_9x
SET NETCONFIG=/YES
SET NETTIME=/SET /YES
GOTO ACCESS

:ACCESS
SET DEPT=\\NTSERVER\Reserved
SET MANAGERS=\\NTSERVER\Reserved
SET EXECUTIVE=\\NTSERVER\Reserved

IF EXIST \\NTSERVER\Sales$\* SET DEPT=\\NTSERVER\Sales

IF EXIST \\NTSERVER\Acct$\* SET DEPT=\\NTSERVER\Acct

IF EXIST \\NTSERVER\Managers$\* SET MANAGERS=\\NTSERVER\Managers

NET USE M: /DELETE > NUL
NET USE M: %MANAGERS%$ /%PERSISTENT%YES > NUL
ECHO      M: %MANAGERS%

NET USE O: /DELETE > NUL
NET USE O: %DEPT%$ /%PERSISTENT%YES > NUL
ECHO      O: %DEPT%

REM In the commands below, NT/2000/XP automatically performs the mapping of Drive U: to the User, according to their <Profile> in "User Manager for Domains".  The command "NET USE U: /HOME /YES" is only required for Windows9x Class stations. On WindowsNT/2000/XP, the U: Drive is ALREADY MAPPED and IN-USE and the CURRENT DRIVE\DIRECTORY (however, we did switched it to C: at the top of this Script).  So NT Class stations should not execute it, otherwise your Domain Logon Script will display an error.

IF [%OS%] == [Windows_9x] NET USE U: /HO
0
 
LVL 5

Expert Comment

by:juliancrawford
ID: 9872048
No comment has been added lately, so it's time to clean up this TA.            
I will leave a recommendation in the Cleanup topic area that this question is:            
            
Answered by: 0byte            
      

Please leave any comments here within the next seven days.            

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!            

JulianCrawford            
EE Cleanup Volunteer
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enterprise networks where VoIP phones have been deployed frequently use port configurations that allow both a computer and an IP phone to be plugged into the same switch port but use different VLANs. On Cisco equipment I'm referring to the "native V…
Are you one of those front-line IT Service Desk staff fielding calls, replying to emails, all-the-while working to resolve end-user technological nightmares? I am! That's why I have put together this brief overview of tools and techniques I use in o…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question