Solved

simple windows domain login script?

Posted on 2010-11-23
7
542 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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

Do email signature updates give you a headache?

Do you feel like you are constantly making changes to email signatures? Are the images not formatting how you want them to? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today.

Join & Write a Comment

OfficeMate Freezes on login or does not load after login credentials are input.
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
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 process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

707 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now