Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

Windows Server 2003 logon script question


  • Please log in to reply

#1
Rybo

Rybo

    Member

  • Member
  • PipPip
  • 24 posts
I was trying to set up an individual user logon script to map a network drive today and couldn't get it to work. I went off of a group policy exercise I saw in my server 2003 book and tried to cater that to the logon script box in the profile tab in each user's properties. Here's what I did step by step:

1. created a new text file
2. added the command net use x: \\[server name]\[shared folder]
3. saved and renamed the file to logon.bat
4. went into the profile tab of one of the users and created a path to the file in both of the following formats: \\[server name]\[script folder] and \\[server name]\[sript folder]\[script file]

I logged on as that user on another computer, and it didn't map the folder. First of all, is what I'm trying to do even possible? I assume it is, because there is indeed a logon script box in each user's profile tab. What exactly is the correct format to point to the script file? Any help would be appreciated!
  • 0

Advertisements


#2
anzenketh

anzenketh

    BSOD Warrior/Computer Surgeon

  • Technician
  • 2,854 posts
Sure is possible. This is a advanced windows topic right up there with editing the registry.

Here are some links that may help you along the journey.

Link 1 from technet
Link 2 from windows networking
Google Search of login scripts

This is more of a Networking question though then anything else you may get a faster (and more expert response) in the Networking forum
Posting here is fine though. Just to let you know for future reference.
  • 0

#3
dsenette

dsenette

    Je suis Napoléon!

  • Administrator
  • 26,019 posts
  • MVP
i think this actually falls under the windows 2003/xp genre...this isn't so much networking as it is OS manipulation

assuming that you created the batch file correctly...adding it to the login script section of the user account should work....that's how i mapped drives here at work for quite some time untill i found a better sollution
  • 0

#4
anzenketh

anzenketh

    BSOD Warrior/Computer Surgeon

  • Technician
  • 2,854 posts
Nice to know this is a OS issue I guess I would wrongfully post if I were to post this.
  • 0

#5
dsenette

dsenette

    Je suis Napoléon!

  • Administrator
  • 26,019 posts
  • MVP
and i probably would have moved it if you had...it's kind of a both issue...but probably mostly windows related...anywho

...where do you have the login script located? on a file server?

most of the time with login scripts...best practice suggests putting the batch file in the sysvol folder of your domain controller....then in the user's profile..you just put the batch file's name (logon.bat or whatever)...not a full path...since the script is running at logon...the user technically doesn't have access permissions to any file server folders untill the logon process is complete...but the domain user does have access to the domain's sysvol folder during logon...this might make a difference
  • 0

#6
Rybo

Rybo

    Member

  • Topic Starter
  • Member
  • PipPip
  • 24 posts

and i probably would have moved it if you had...it's kind of a both issue...but probably mostly windows related...anywho

...where do you have the login script located? on a file server?

most of the time with login scripts...best practice suggests putting the batch file in the sysvol folder of your domain controller....then in the user's profile..you just put the batch file's name (logon.bat or whatever)...not a full path...since the script is running at logon...the user technically doesn't have access permissions to any file server folders untill the logon process is complete...but the domain user does have access to the domain's sysvol folder during logon...this might make a difference


Thanks for the response. Yes, the logon scripts are going to reside on the domain controller, which is also the file server. I want to have a different script for each user to map their personal shared folder at logon. I just have a few more questions.

1. I attached an example of the text file to be converted to a batch file. Is the script in there written correctly? Like I said, I got it from a group policy logon script exercise, and it worked in group policy when I fooled around with it in vmware. If that worked, I figured it would work, if I just pointed to it from a user's profile tab.

2. I'll probably put the batch files in the sysvol folder as you suggested, but what exactly is the correct format for pointing to a batch file located anywhere on the domain controller especially, if it's buried in a few folders and subfolders?

3. Do I have to name the batch file logon.bat or can I call it whatever I want? I'm going to have to create a different batch file for each user, so it would be easier to give them specific names, especially if I were to put them all in the sysvol folder.

Attached Files


Edited by Rybo, 21 May 2007 - 09:40 AM.

  • 0

#7
dsenette

dsenette

    Je suis Napoléon!

  • Administrator
  • 26,019 posts
  • MVP
1. the batch looks right

2. don't burry the batch file...the sysvol folder on the DC you should have a folder for your domain then one called scripts...put all the login scripts there...then in the user's profile you just put the script's name in the logon script section...so it would be logon.bat not \\server\logon.bat

3. are these folders JUST for each employee? or are they folders that they and everyone else can look at too?
  • 0

#8
Rybo

Rybo

    Member

  • Topic Starter
  • Member
  • PipPip
  • 24 posts

3. are these folders JUST for each employee? or are they folders that they and everyone else can look at too?


I don't quite remember how I set up the share permissions, but each user in addition to the admin(who has full control) does have read and write access to their specific folder and files. I think it's set up so that only each user can open his or her shared folder although the folder can be seen by anyone on the domain. This isn't a very intricate windows server network. It's just a small building with less than 20 domain users.

Edited by Rybo, 21 May 2007 - 09:55 AM.

  • 0

#9
dsenette

dsenette

    Je suis Napoléon!

  • Administrator
  • 26,019 posts
  • MVP
if only the admin's and this user needs to have access to this folder...then you should set the folder as the user's home folder and assign it a letter in the userprofile (underneath the thing where you do the logon script)...i'd use the letter U to signify user drive...but whatever you want....if you set the folder as the user's home folder...then it will automatically be mapped at logon without the need for a logon script to map it..

is this the only drive that's needing to be mapped at logon?
  • 0

#10
Rybo

Rybo

    Member

  • Topic Starter
  • Member
  • PipPip
  • 24 posts

if only the admin's and this user needs to have access to this folder...then you should set the folder as the user's home folder and assign it a letter in the userprofile (underneath the thing where you do the logon script)...i'd use the letter U to signify user drive...but whatever you want....if you set the folder as the user's home folder...then it will automatically be mapped at logon without the need for a logon script to map it..

is this the only drive that's needing to be mapped at logon?


Ah, I didn't think of that. That's something I'll have to look at too. Yes, we only want to map 1 folder for each user right now. Thanks!
  • 0

#11
Rybo

Rybo

    Member

  • Topic Starter
  • Member
  • PipPip
  • 24 posts
Update:

The home folder thing worked fine. I got the script method to work too, but you do apparently have to use the name logon.bat, or else it won't work. Because of that, I couldn't create a different script for each user.
  • 0

#12
bobmad

bobmad

    Member

  • Member
  • PipPipPip
  • 344 posts
I'm using username.bat and have 20+ .bat files in use.

So I could have a jsmith.bat
and a rbrown.bat file

I seem to remember that in the user and computers section (active directories) (user profile login script) you can set a batch file to run for a user....I just point to it there.

If you need 2 batch files to run 1 for each user and 1 for all users, just call the for all users one from the individual user script.
  • 0

#13
dsenette

dsenette

    Je suis Napoléon!

  • Administrator
  • 26,019 posts
  • MVP
you shouldn't have to have the batch file named logon.bat...the ones i was using were not named logon.bat...not sure why yours is doing this
  • 0

#14
bobmad

bobmad

    Member

  • Member
  • PipPipPip
  • 344 posts
If you have a user named jsmith and create a batch file for that user named jsmith.bat, you need to go into the user jsmith to the user profile and type jsmith.bat into the login script box.

Obviously change all instances of jsmith to one of your actual users. Then test.

If you've already done this and it still isn't running, post back with the directory where you store the .bat file, and the name you are using to run the batch file in the login script area.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP