?
Solved

simple windows domain login script?

Posted on 2010-11-23
7
Medium Priority
?
550 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 2000 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

Problems using Powershell and Active Directory?

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

Here's a look at newsworthy articles and community happenings during the last month.
Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Suggested Courses
Course of the Month14 days, 20 hours left to enroll

771 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