Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 320
  • Last Modified:

VB Login Script

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
Compgrrrl2000
Asked:
Compgrrrl2000
1 Solution
 
0byteCommented:
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
 
juliancrawfordCommented:
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 your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now