• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 841
  • Last Modified:

Windows SBS 2008 - Login Script Not Working

Hi Experts,

I have a brand new network setup with Windows SBS 2008 and all windows 7 workstations. We are pushing down login scripts via GPO.

The GPO is working as the clients are getting mapped drives like they are suppose to, however they are not getting the printers from the login script.

If I manually run the scripts from the workstation it works just fine. I have also disabled UAC on all windows 7 workstations.

I have run the gpresults /h report and it shows the script ran just fine.

Here are the scripts

@echo off

set local

      title Processing login Script.. DO NOT INTERUPT.

      :: Logging Feature
      set LOGFILE=%SystemDrive%\Login_Script.log
      echo -------------------------------------------------------------->> %LOGFILE%
      echo [%DATE% %TIME:~0,8%] LOGIN script: %~dp0%~nx0>> %LOGFILE%
      echo [%DATE% %TIME:~0,8%] User: %USERNAME%>> %LOGFILE%
      echo [%DATE% %TIME:~0,8%] Logon Domain: %USERDOMAIN%>> %LOGFILE%
      echo [%DATE% %TIME:~0,8%] Logon Server: %LOGONSERVER%>> %LOGFILE%

      :: Assign Home Directory
      set USERHOMEDIR=\\servers\UserShares\%USERNAME%

push %~dp0

      :: Synch system clock with Domain Controller
      net time %LOGONSERVER% /set /yet > nul

      :: Map Network Drives
      net use Z: \\servers\Company

      :: Connect to NETWORK PRINTER SHAREs
      cscript login.vbs



Dim objNet
Set objNet = CreateObject("Wscript.Network")

      objNet.AddWindowsPrinterConnection "\\server\FrontOffice"
      objNet.AddWindowsPrinterConnection "\\server\BackOffice"

Set objNet = Nothing

1 Solution
Try to include LOGIN.VBS in your LOGIN.CMD.

At bottom of the LOGIN.CMD insert:

start \\server\scripts\LOGIN.VBS
Cliff GaliherCommented:
How login scripts are processed has changed significantly. Specifically, they run in a non-user context, so things like drive map ins don't work withoutbserious retooling. Looking at what your script does, everything can be replaced with group policy preferences, and would be the recommended solutionin your case.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now