Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

login script difficulties

Status
Not open for further replies.

TekkieDave

Technical User
May 22, 2002
98
US
I have a drive mapping login script that works, but I can only get it to go if I type the file name in the login script box under profiles, I can't get it to go as a group policy.

I added it under the default domain group policy in the login script section and I just added the name, not the file path.

What am I missing?
 
To get a script to work as a group policy, open up AD, go into the OU that has all the users that you want to apply this login script to (i wouldnt do it at the default domain policy level because then the servers would map that drive also). Then go into the user config->windows settings->scripts. Double click on logon and click the "show files" button at the bottom and then copy the bat file that you want to apply to that OU into there and then add it from above. I believe that the bat file has to be in that policies folder and placing it in the "show files" will accomplish this for you.

hope this helps.
 
rye9261 has given you the right steps to properly add the script file to your GPO. i want to comment however on not adding it to the domain level. There is no reason not to if you are setting up the security on your GPO properly.

In the GPO list, select your GPO. Click properties. Click the Security tab.

Verify the settings. you will note that the final choice is to Apply of Deny application of this GPO. It is a very good practive to add Administrator or Dimain Admins into the list and choose to DENY application of the GPO.

I suggest you make this a standard practice for all GPOs. This commonly overlooked step is imperative because the last thing you want to do is log in somewhere as admin and suddenly find the PC locked out from making any and all changes, or be restricted from launching MMC etc.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Okay, so I added the script into that folder, but the batch still doesn't go. I looked in gpresult, but there are no errors, and the login policy doesn;t even show up.
 
Make sure that if you created the Policy under a different OU than the default domain policy, that you are logging in with a user that is in that OU. If you are trying to log in with a user that is in the "Users" folder it will not work... they have to belong to an OU.
 
I put all of the users into an OU, for ease of management. This is driving me nuts. I'll be damned if I'm going to put the login info in each user profile.
 
TekkieDave, did you check that the security settings specified to apply to your users as I suggested above?

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Try puting the script on your server in the netlogon folder. Then go to your GPO and edit it. Under computer cofiguration, administative templates, system, logon. You should see "run these programs at user login". Select it and put in the box the path to your script (\\server\netlogon\script.vbs). It will then run when anyone logs into the machines as long as you have the right permissons set. This is how we do our printer scripts were I work so that no matter what user logs in they get the closest printer installed.
 
how do you get the printer script to work....I am looking to do something similiar.
 
You would just do what I desribed above. Make sure the computers your applying it to are in a security group with read and apply GPO policies in the GPO security tab. Then find the entry I descibed. Then enter the path were your script is shared in unc form (\\computer_name\path to vbs\script name (vbs). I chose netlogon as all our users have access to run from there.

If you asking for a script example here is one.

Set WshNetwork = CreateObject("WScript.Network")
PrinterPath = "\\Computer_name\printer share name"
PrinterDriver = "driver" (can get this from a test page)
WshNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver
WshNetwork.SetDefaultPrinter "\\computer_name\printer share"

You need the "" so leave them. What this will do is install the printer share onto the computer and set it as default.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top