Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

simple windows domain login script?

Posted on 2010-11-23
7
Medium Priority
?
552 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure 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 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

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
Here's a look at newsworthy articles and community happenings during the last month.
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Suggested Courses

610 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