Solved

Windows Logon Batch File

Posted on 2011-02-22
8
470 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
  • 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

792 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