Solved

Windows Logon Batch File

Posted on 2011-02-22
8
472 Views
Last Modified: 2012-05-11
i have just switched from a windows 2000 to windows 2008sb server.

on a couple of laptops i had a log on script batch file which ran on start up - it prompted the user for username/password on the 2000 server.............it reads as follows:

@echo off
net time \\server10 /set /yes
net use J: \\server10\Usershares2`      
net use I: \\server10\Setup
net use x: \\server10\hotel
net use w: \\server10\Artwork

When i try to point the same script (changing the server10 name) at the new server the script does not work.

does the script need to be modified for windows 2008 server?
0
Comment
Question by:VSFLYER
[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
  • 4
  • 3
8 Comments
 
LVL 37

Expert Comment

by:Neil Russell
ID: 34951653
Have you created all those shares on the new server and given access rights to all the users that need them?

Your Net Time command is not needed, time will be taken from your domain.
0
 
LVL 84

Expert Comment

by:oBdA
ID: 34951669
First, forget about "net time"; it's deprecated, users don't have permissions to change the time, and all Windows OSs since W2k have a time service that automatically syncs the time in a domain.
Then you might have to delete the old mappings, depending on whether the existing mappings are persistent or not.

@echo off
net use J: /delete >NUL 2>&1
net use J: \\server10\Usershares2`      
net use I: /delete >NUL 2>&1
net use I: \\server10\Setup
net use X: /delete >NUL 2>&1
net use x: \\server10\hotel
net use W: /delete >NUL 2>&1
net use w: \\server10\Artwork

Open in new window

0
 

Author Comment

by:VSFLYER
ID: 34951680
shares are all set up on the new server

the batch file should ask the user to enter username and password and allow access based on those entries.

linked to the new server, the batch file is no longer requesting a username/password and simply connecting the users to the drives which everyone has access to.
0
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 
LVL 84

Accepted Solution

by:
oBdA earned 500 total points
ID: 34951743
Any specific reason why user name and password need to be specified explicitly?
Here's a rough draft:
@echo off
setlocal
set Server=Server10
set /p UserID=Please enter the user name to access %Server%: 
for %%a in (I J W X) do (
  net use %%a: /delete >NUL 2>&1
)
net use J: "\\%Server%\Usershares2" * /user:"%UserID%"
net use I: \\%Server%\Setup
net use X: \\%Server%\hotel
net use W: \\%Server%\Artwork

Open in new window

0
 

Author Comment

by:VSFLYER
ID: 34951817
the name and password need to be specified explicitly as that is what identifys what folders to allow access to.
0
 
LVL 84

Expert Comment

by:oBdA
ID: 34951862
Are the users logging on to local accounts on the laptops instead of domain accounts?
0
 

Author Comment

by:VSFLYER
ID: 34951927
set up is as follows we had a server SERVER02 - some laptop users used the log-on batch file orginally noted above - this prompted them for a username and password, once the username and apssword were entered the script closed and the users we able to access their directories on the server.

i have now got a new server SERVER10 - i attempted to use the same log-on batch file however the script does not prompt for the username, just connects to the drives and allows only access to those folders marked on the server for everybody acccess.
0
 
LVL 84

Expert Comment

by:oBdA
ID: 34951954
Try the script in http:#a34951743 then. If it works, the error handling can be enhanced.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I was supporting a handful of Windows 2008 (non-R2) 2 node clusters with shared quorum disks. Some had SQL 2008 installed and some were just a vendor application that we supported. For the purposes of this article it doesn’t really matter which so w…
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

734 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