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

DFS Share & Windows Login Script

Background information


We have two sites, SITE A and SITE B. I have a fully functioning DFS Share with replicated folders in each site. This is working wonderfully.
Each site is running a Windows 2003 R2 x64 Domain Controller and a separate Windows 2003 R2 X64 File server.

I have created a Name space for my share and published the replicated folders.

Now that I have this share published, Id like to use it in the login script instead of the server names. This way the users are using DFS and not the directly the server in each location. So that if a user travels between sites, they can get the files quickly by accessing them locally.

Here is our current Login Script.

@ECHO OFF
If "%OS%" == "Windows_NT" goto WINNT
GOTO OUT

:WINNT
NET TIME \\ORL-DC01 /SET /YES
NET USE N: \\orl-file01\public /PERSISTENT:NO

GOTO OUT

:OUT

This login script is the one we have been using for years.
 
I want to change it to
@ECHO OFF
If "%OS%" == "Windows_NT" goto WINNT
GOTO OUT

:WINNT
NET TIME \\ORL-DC01 /SET /YES
NET USE N: \\corp.mycompany.com\Company\Files\Public Files\Public /PERSISTENT:NO

GOTO OUT

:OUT

Now when I do this I get an error in the script.
C:\>test.bat
Current time at \\ORL-DC01 is 2/17/2009 8:32 AM

The command completed successfully. (Net time)

System error 86 has occurred.

The specified network password is not correct. (The DFS Share)


Now I did some testing and can browse to this exact path \\corp.mycompany.com\Company\Files\Public Files\Public without any issues what so ever. I can even it add it into my Active Directory Users and Computers Home Folder  and that maps ok.

Further testing lets me use this script
@ECHO OFF
If "%OS%" == "Windows_NT" goto WINNT
GOTO OUT

:WINNT
NET TIME \\ORL-DC01 /SET /YES
NET USE N: \\corp.mycompany.com\Company  /PERSISTENT:NO

GOTO OUT

:OUT

However I do not want to give my user access to the Root of the share.

Any help would be appreciated.

Thank you

0
GibbsSupport
Asked:
GibbsSupport
1 Solution
 
oBdACommented:
You're using a path with a space in it, so the path has to be enclosed in quotes. Currently it's trying to send "Files\Public" as password:
NET USE N: "\\corp.mycompany.com\Company\Files\Public Files\Public" /PERSISTENT:NO

And you can drop the "net time" command. Apart from the fact that regular users are not allowed to change the time anyway, all AD domain members running W2k or later will *by* *default* sync their time using the domain hierarchy.
0
 
GibbsSupportAuthor Commented:
Thanks! scripting was never my thing.
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.

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