Solved

simple windows domain login script?

Posted on 2010-11-23
7
548 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
[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
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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

A hard and fast method for reducing Active Directory Administrators members.
After seeing many questions for JRNL_WRAP_ERROR for replication failure, I thought it would be useful to write this article.
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

728 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