troubleshooting Question

SBS login script taking 3 attempts to complete all tasks successfully

Avatar of devon-lad
devon-lad asked on
SBS
15 Comments1 Solution392 ViewsLast Modified:
Hi there,

I have a client with four sites.  SBS at site1, W2003 server at the other 3 as domain controllers.  Connected together via VPN.

I use the login script below to achieve the following things:

1.  Run the SBS client setup to configure Outlook and the network printers (Outlook 2003 is already installed on all PCs)

2.  Set the default printer for the client computer based on its subnet (and hence location).

3.  Copy desktop shortcuts to the user's desktop - I've specifically chosen to copy from the local server's netlogon folder just in case the VPN link is down.

4.  Finally map a drive to a DFS root


Here's what happens - you can assume that no user action is taken between each login.

1st time a user logs into a PC
--------------
Outlook not configured properly
Printers not installed
Shortcuts ok
Network drive ok

2nd time the user logs into same PC
---------------
Outlook configured properly
Printers installed but default printer not set

3rd time the user logs in
---------------
Default printer set


Anybody shed some light on why this is happening?




-----script start


\\SERVER1\Clients\Setup\setup.exe /s SERVER1


for /f "tokens=2 delims=:" %%a in ('ipconfig ^| find /i "IP Address"') do set IP=%%a

for /f "tokens=1-3 delims=. " %%a in ("%IP%") do set Subnet=%%a.%%b.%%c

if "%Subnet%"=="192.168.0" goto Site1
if "%Subnet%"=="192.168.1" goto Site2
if "%Subnet%"=="192.168.2" goto Site3
if "%Subnet%"=="192.168.3" goto Site4
goto end_setup



:Site1

rundll32 printui.dll,PrintUIEntry /y /n \\\Laser-Site1
xcopy \\server1\netlogon\desktop\* "c:\documents and settings\%username%\desktop" /d /r /y

goto end_setup

:Site2

rundll32 printui.dll,PrintUIEntry /y /n \\\Laser-Site2
xcopy \\server2\netlogon\desktop\* "c:\documents and settings\%username%\desktop" /d /r /y

goto end_setup

:Site3

rundll32 printui.dll,PrintUIEntry /y /n \\\Laser-Site3
xcopy \\server3\netlogon\desktop\* "c:\documents and settings\%username%\desktop" /d /r /y

goto end_setup

:Site4

rundll32 printui.dll,PrintUIEntry /y /n \\\Laser-Site4
xcopy \\server4\netlogon\desktop\* "c:\documents and settings\%username%\desktop" /d /r /y

goto end_setup

:end_setup

net use v: "\\domain.local\user documents"

-----script end
ASKER CERTIFIED SOLUTION
DarthMod

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 15 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 15 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros