Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Login Bat file help needed

Posted on 2013-01-22
4
Medium Priority
?
298 Views
Last Modified: 2013-05-09
I need a simple login bat file that can be run on users profiles on our W2K8R2 enviorment. I need to be able to map the S drive which is our Sales share to all users and as a user home directory for each user. Once the drives map they want Hello %username today is %date Have a great day! to be displayed.

I have never written a login script so I am looking for some help. I dont want to do any powershell stuff just a simple bat file that I can pop in the sysvol folder under scripts.
0
Comment
Question by:MXadmin
[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
  • 2
4 Comments
 
LVL 10

Expert Comment

by:ddiazp
ID: 38808337
what's the UNC path to the share?

Just save this as share.bat on your sysvol and point to that file on the logon script on AD for the accounts you want to use this on.

You can either mount the drive through that script, or via the 'Home Drive' fields on the AD user account properties. It would be redundant to do both and will give you an error if you do both:

@ECHO OFF

net use S: \\shareserver\Sales

echo "Hello %USERNAME%, today is %DATE%. Have a great day!"

Open in new window

0
 
LVL 57

Expert Comment

by:Mike Kline
ID: 38808350
also think about using group policy preferences for mapping the drive

 thanks

 mike
0
 

Accepted Solution

by:
MXadmin earned 0 total points
ID: 38808359
That does not work. I already had that type of script done it maps drives but does not display the message.
0
 

Author Closing Comment

by:MXadmin
ID: 39150963
works
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  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

A hard and fast method for reducing Active Directory Administrators members.
For anyone that has accidentally used newSID with Server 2008 R2 (like I did) and hasn't been able to get the server running again because you were unlucky (as I was) and had no backups - I was able to get things working by doing a Registry Hive rec…
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…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

705 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