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
Solved

simple windows domain login script?

Posted on 2010-11-23
7
545 Views
Last Modified: 2012-05-10
I am new to writing login scripts.  I have a Windows domain (DCs are Windows 2008 Ent).
I want to accomplish the following:

1. map each user's R:\ drive to a particular shared folder on one of the local file servers

2. check to see if the correct printer driver is installed for one of our local printers, and if not, install it.  Once the driver is installed, create an instance of that printer under the local user's profile.


I have some familiarity with GP, I think the best way to go is to specify the login script in the GP object.  Can anyone point me to some basic login script examples that demonstrate the basics of accomplishing the above tasks?

Thanks!!
0
Comment
Question by:luchianoduckman
7 Comments
 
LVL 35

Expert Comment

by:Ernie Beek
ID: 34195309
0
 
LVL 4

Expert Comment

by:Kimmyel
ID: 34195325
For mapping user this should do it:
net use r:\\SERVER\homecatalogue\%User% for it to map right loginscript
0
 
LVL 4

Expert Comment

by:Kimmyel
ID: 34195340
For printer this solution might work:
www.experts-exchange.com/...2003/Q_20943033.html
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 1

Expert Comment

by:okassis
ID: 34195391
Ok so i guess you know howto add the batch file to the user account environment in AD

To creat a bat file, just creat a txt file
Example
login.txt

Edit the text filewith the following cammands

NET USE 'drive letter': shared folder location
example
NET USE r: \\share\movies

The above will map the drive letter r to the movie directory on your file server.

the second part of your script.. Network printers

Use the following command, (<ake sure you install the printer on the server and share it)
rundll32 printui.dll,PrintUIEntry /in /n "\\servername\printer name"

Now rename the login.txt to login.bat
the default place to place the login script would be in you netlogon folder share ;)

Let us know how you go.
0
 
LVL 27

Accepted Solution

by:
KenMcF earned 500 total points
ID: 34195668
0
 

Expert Comment

by:faolchu
ID: 34204084
I have a great login script that you might consider. It looks at the users group membership and maps network drives accordingly, it'd be easy enough for you to modify it to add a printer or two.
I use ifmember.exe http://technet.microsoft.com/en-us/library/cc767361.aspx

download ifmember from microsoft and save ifmember.exe to C:\WINNT\SYSVOL\sysvol\domainname\scripts on your DC save you .bat file to the same location then use a group policy or ADUAC to assign teh login script to users.

I've included sample code to teh .bat file


the following includes some info on adding printers with no interaction from users:
http://support.microsoft.com/kb/189105 
@echo on
REM Login Script to map drives depending on group membership
REM Created by Alan laighléis
REM 23 August 2010

:Begin
CLS
REM The Following deletes all existing drive mappings
net use * /delete /yes
echo drives deleted



net use z: \\server\share



REM Checks for group membership

%logonserver%\netlogon\ifmember "domain\group"
if not errorlevel 1 goto 2
net use y: \\server\share





:2
%logonserver%\netlogon\ifmember "domain\group"
if not errorlevel 1 goto 3
net use r: \\server\share
net use v: \\server\share




:3
%logonserver%\netlogon\ifmember "domain\group"
if not errorlevel 1 goto 4
net use t: \\server\share




:4
%logonserver%\netlogon\ifmember "domain\group"
if not errorlevel 1 goto 5
net use p: \\server\share




:5
end

Open in new window

0
 

Author Closing Comment

by:luchianoduckman
ID: 34660086
Thanks!  Group Policy was the way to handle it.
0

Featured Post

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
LOGINSERVER and nltest /dsgetdc 3 38
PC trouble to connect to file server 6 36
Samba 4, Users Permission, 5 44
How can i confirm Password policy is working? 8 15
OfficeMate Freezes on login or does not load after login credentials are input.
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 give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

808 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