Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > Re: Drive Mapping in Server 2008

Reply
Thread Tools Display Modes

Re: Drive Mapping in Server 2008

 
 
Richard Mueller [MVP]
Guest
Posts: n/a

 
      03-24-2009

"Dave" <> wrote in message
news:98a2884d-9e54-4ef9-b771-...
>I haven't played with Server since 2000. I'm trying to setup a
> machine for my neighbor and I'd like to map drives to specific shared
> folders. In the past I would do this in a .BAT file. If this is
> still the prefered practice where does the file go now. If not...what
> is the prefered practice, and can you point me to any documentation.
>
> Since time is a factor, and it is a very small outfit, if a batch file
> still works, I'd prefer to do that.
>
>
> Thanks for your help.


This FAQ might help if you mean to use your batch file as a logon script and
you use Active Directory:

http://www.rlmueller.net/LogonScriptFAQ.htm

If you are using local accounts only (no AD domain), you can assign logon
scripts to the local user accounts. The batch file syntax is unchanged to
map drives.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


 
Reply With Quote
 
 
 
 
Richard Mueller [MVP]
Guest
Posts: n/a

 
      03-24-2009
It seems your logon script is not running at all. On the Profile tab of the
user properties in ADUC, for logon script enter simply:

TriR.bat

Should it be:

IF %ComputerName%==TriR2k801 Goto End

Also, it should be unnecessary to synchronize the time. It should happen
when the computer starts. For troubleshooting you might add statements to
log steps in a local text file. For example:

@Echo Off
echo Start Logon Script>c:\LogonLog.log
REM TriR.Bat Version 1.0
REM Exit if user has logged on to the server
IF %ComputerName%==TriR2k801 Goto End
REM Delete pre-existing drive mappings
echo Remove mappings>>c:\LogonLog.log
NET USE F: /DELETE >null
NET USE H: /DELETE >null
NET USE P: /DELETE >null
NET USE S: /DELETE >null
NET USE U: /DELETE >null
REM MAP DRIVES
echo Map drive F:>>c:\LogonLog.log
NET USE F: \\TriR2k801\Finance$ >null
echo Map drive H:>>c:\LogonLog.log
NET USE H: \\TriR2k801\HR$ >null
echo Map drive P:>>c:\LogonLog.log
NET USE P: \\TriR2k801\Projects$ >null
echo Map drive S:>>c:\LogonLog.log
NET USE S: \\TriR2k801\Safety$ >null
echo Map drive U:>>c:\LogonLog.log
NET USE U: \\TriR2k801\Users$\%UserName%

Or, instead of redirecting the output of the NET USE commands to Null,
redirect to the log file. If the log file is not created, you know the logon
script did not run at all. Otherwise, you might find a statement raises an
error.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--

"Dave" <> wrote in message
news:8b5fc1c4-2fc1-4196-a645-...
Thanks Richard!
Still no luck.
This is a 2008 machine that Active Directory has been setup on. I'm
using the following Logon Script path in user profile:

%SystemRoot%\sysvol\sysvol\TriR.Com\scripts\TriR.B at

My batch file is:

@Echo Off
REM TriR.Bat Version 1.0
REM Exit if user has logged on to the server
IF %ComputerName%==TriR2k801. Goto End
REM Delete pre-existing drive mappings
NET USE F: /DELETE >null
NET USE H: /DELETE >null
NET USE P: /DELETE >null
NET USE S: /DELETE >null
NET USE U: /DELETE >null
REM MAP DRIVES
NET USE F: \\TriR2k801\Finance$ >null
NET USE H: \\TriR2k801\HR$ >null
NET USE P: \\TriR2k801\Projects$ >null
NET USE S: \\TriR2k801\Safety$ >null
NET USE U: \\TriR2k801\Users$\%UserName%
REM SYNCHRONIZE TIME WITH SERVER
NET TIME \\TRIR2K801 /SET /YES

When I log in the only drive mapped is U: But that's probably because
I have that declared under Home Folder.




On Mar 24, 11:41 am, "Richard Mueller [MVP]" <rlmueller-
nos...@ameritech.nospam.net> wrote:
> "Dave" <Dave.Burk...@Jacobs.com> wrote in message
>
> news:98a2884d-9e54-4ef9-b771-...
>
> >I haven't played with Server since 2000. I'm trying to setup a
> > machine for my neighbor and I'd like to map drives to specific shared
> > folders. In the past I would do this in a .BAT file. If this is
> > still the prefered practice where does the file go now. If not...what
> > is the prefered practice, and can you point me to any documentation.

>
> > Since time is a factor, and it is a very small outfit, if a batch file
> > still works, I'd prefer to do that.

>
> > Thanks for your help.

>
> This FAQ might help if you mean to use your batch file as a logon script
> and
> you use Active Directory:
>
> http://www.rlmueller.net/LogonScriptFAQ.htm
>
> If you are using local accounts only (no AD domain), you can assign logon
> scripts to the local user accounts. The batch file syntax is unchanged to
> map drives.
>
> --
> Richard Mueller
> MVP Directory Services
> Hilltop Lab -http://www.rlmueller.net
> --



 
Reply With Quote
 
Richard Mueller [MVP]
Guest
Posts: n/a

 
      03-24-2009
Sounds like perhaps the drives were mapped persistent. I would use:

/persistent:no

in the Net Use statements. Also the user may lack permissions for some of
the shares. I would log in as the user, then run the statements one at a
time at the command prompt to determine which statement raises which error.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--

"Dave" <> wrote in message
news:34d7507e-107f-41c4-a2c7-...
When I log in I'm getting the little popup that says "Could not
reconnect all the network drives. Click Here...". Look at the
command window while it's running it says Access is denied. What
would be causing that?



On Mar 24, 12:58 pm, "Richard Mueller [MVP]" <rlmueller-
nos...@ameritech.nospam.net> wrote:
> It seems your logon script is not running at all. On the Profile tab of
> the
> user properties in ADUC, for logon script enter simply:
>
> TriR.bat
>
> Should it be:
>
> IF %ComputerName%==TriR2k801 Goto End
>
> Also, it should be unnecessary to synchronize the time. It should happen
> when the computer starts. For troubleshooting you might add statements to
> log steps in a local text file. For example:
>
> @Echo Off
> echo Start Logon Script>c:\LogonLog.log
> REM TriR.Bat Version 1.0
> REM Exit if user has logged on to the server
> IF %ComputerName%==TriR2k801 Goto End
> REM Delete pre-existing drive mappings
> echo Remove mappings>>c:\LogonLog.log
> NET USE F: /DELETE >null
> NET USE H: /DELETE >null
> NET USE P: /DELETE >null
> NET USE S: /DELETE >null
> NET USE U: /DELETE >null
> REM MAP DRIVES
> echo Map drive F:>>c:\LogonLog.log
> NET USE F: \\TriR2k801\Finance$ >null
> echo Map drive H:>>c:\LogonLog.log
> NET USE H: \\TriR2k801\HR$ >null
> echo Map drive P:>>c:\LogonLog.log
> NET USE P: \\TriR2k801\Projects$ >null
> echo Map drive S:>>c:\LogonLog.log
> NET USE S: \\TriR2k801\Safety$ >null
> echo Map drive U:>>c:\LogonLog.log
> NET USE U: \\TriR2k801\Users$\%UserName%
>
> Or, instead of redirecting the output of the NET USE commands to Null,
> redirect to the log file. If the log file is not created, you know the
> logon
> script did not run at all. Otherwise, you might find a statement raises an
> error.
>
> --
> Richard Mueller
> MVP Directory Services
> Hilltop Lab -http://www.rlmueller.net
> --
>
> "Dave" <Dave.Burk...@Jacobs.com> wrote in message
>
> news:8b5fc1c4-2fc1-4196-a645-...
> Thanks Richard!
> Still no luck.
> This is a 2008 machine that Active Directory has been setup on. I'm
> using the following Logon Script path in user profile:
>
> %SystemRoot%\sysvol\sysvol\TriR.Com\scripts\TriR.B at
>
> My batch file is:
>
> @Echo Off
> REM TriR.Bat Version 1.0
> REM Exit if user has logged on to the server
> IF %ComputerName%==TriR2k801. Goto End
> REM Delete pre-existing drive mappings
> NET USE F: /DELETE >null
> NET USE H: /DELETE >null
> NET USE P: /DELETE >null
> NET USE S: /DELETE >null
> NET USE U: /DELETE >null
> REM MAP DRIVES
> NET USE F: \\TriR2k801\Finance$ >null
> NET USE H: \\TriR2k801\HR$ >null
> NET USE P: \\TriR2k801\Projects$ >null
> NET USE S: \\TriR2k801\Safety$ >null
> NET USE U: \\TriR2k801\Users$\%UserName%
> REM SYNCHRONIZE TIME WITH SERVER
> NET TIME \\TRIR2K801 /SET /YES
>
> When I log in the only drive mapped is U: But that's probably because
> I have that declared under Home Folder.
>
> On Mar 24, 11:41 am, "Richard Mueller [MVP]" <rlmueller-
>
>
>
> nos...@ameritech.nospam.net> wrote:
> > "Dave" <Dave.Burk...@Jacobs.com> wrote in message

>
> >news:98a2884d-9e54-4ef9-b771-...

>
> > >I haven't played with Server since 2000. I'm trying to setup a
> > > machine for my neighbor and I'd like to map drives to specific shared
> > > folders. In the past I would do this in a .BAT file. If this is
> > > still the prefered practice where does the file go now. If not...what
> > > is the prefered practice, and can you point me to any documentation.

>
> > > Since time is a factor, and it is a very small outfit, if a batch file
> > > still works, I'd prefer to do that.

>
> > > Thanks for your help.

>
> > This FAQ might help if you mean to use your batch file as a logon script
> > and
> > you use Active Directory:

>
> >http://www.rlmueller.net/LogonScriptFAQ.htm

>
> > If you are using local accounts only (no AD domain), you can assign
> > logon
> > scripts to the local user accounts. The batch file syntax is unchanged
> > to
> > map drives.

>
> > --
> > Richard Mueller
> > MVP Directory Services
> > Hilltop Lab -http://www.rlmueller.net
> > --- Hide quoted text -

>
> - Show quoted text -



 
Reply With Quote
 
Al Dunbar
Guest
Posts: n/a

 
      03-24-2009

"Dave" <> wrote in message
news:8b5fc1c4-2fc1-4196-a645-...
Thanks Richard!
Still no luck.
This is a 2008 machine that Active Directory has been setup on. I'm
using the following Logon Script path in user profile:

%SystemRoot%\sysvol\sysvol\TriR.Com\scripts\TriR.B at

My batch file is:

@Echo Off
REM TriR.Bat Version 1.0
REM Exit if user has logged on to the server
IF %ComputerName%==TriR2k801. Goto End

===> suggest: IF /i "%computername%" EQU "TriR2k801" goto:eof
your script had no ":end" label, whereas ":eof" automatically refers to the
end of the file

REM Delete pre-existing drive mappings
NET USE F: /DELETE >null

===> use >nul, as "null" would be an actual file.

/Al

NET USE H: /DELETE >null
NET USE P: /DELETE >null
NET USE S: /DELETE >null
NET USE U: /DELETE >null
REM MAP DRIVES
NET USE F: \\TriR2k801\Finance$ >null
NET USE H: \\TriR2k801\HR$ >null
NET USE P: \\TriR2k801\Projects$ >null
NET USE S: \\TriR2k801\Safety$ >null
NET USE U: \\TriR2k801\Users$\%UserName%
REM SYNCHRONIZE TIME WITH SERVER
NET TIME \\TRIR2K801 /SET /YES

When I log in the only drive mapped is U: But that's probably because
I have that declared under Home Folder.




On Mar 24, 11:41 am, "Richard Mueller [MVP]" <rlmueller-
nos...@ameritech.nospam.net> wrote:
> "Dave" <Dave.Burk...@Jacobs.com> wrote in message
>
> news:98a2884d-9e54-4ef9-b771-...
>
> >I haven't played with Server since 2000. I'm trying to setup a
> > machine for my neighbor and I'd like to map drives to specific shared
> > folders. In the past I would do this in a .BAT file. If this is
> > still the prefered practice where does the file go now. If not...what
> > is the prefered practice, and can you point me to any documentation.

>
> > Since time is a factor, and it is a very small outfit, if a batch file
> > still works, I'd prefer to do that.

>
> > Thanks for your help.

>
> This FAQ might help if you mean to use your batch file as a logon script
> and
> you use Active Directory:
>
> http://www.rlmueller.net/LogonScriptFAQ.htm
>
> If you are using local accounts only (no AD domain), you can assign logon
> scripts to the local user accounts. The batch file syntax is unchanged to
> map drives.
>
> --
> Richard Mueller
> MVP Directory Services
> Hilltop Lab -http://www.rlmueller.net
> --



 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vista drive mapping to 2008 Server rogerdunn56 Windows Vista Networking 17 10-22-2008 12:00 AM
Mapping Terminal Server Drive Somchai Server Networking 3 04-08-2008 02:29 AM
Changing server name in drive mapping txroda Active Directory 7 02-14-2006 06:55 PM
mapping a drive to my server - help novice in dc Windows Server 2 10-24-2005 05:25 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59