Re: Net use command
From: Ricardo M. Urbano - W2K/NT4 MVP (rmu1_at_columbiaSPAM.SUCKSedu)
Date: 03/09/04
- Next message: Ricardo M. Urbano - W2K/NT4 MVP: "Re: DFS root still exist but not the folder"
- Previous message: scott: "Unable to backup"
- In reply to: Byron Kendrick: "Re: Net use command"
- Next in thread: Byron Kendrick: "Re: Net use command"
- Reply: Byron Kendrick: "Re: Net use command"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 09 Mar 2004 13:59:16 -0500
Byron Kendrick wrote:
>
> Currently we are not using any logon scripts at all. All mapping in the
> past was done on the users local computer. Now we are beginning to have a
> need for users to use different computers at different times and I would
> like to be able to write a script to change the network drives. I can use
> the user manager to assign the H: to their home directory on a server and a
> script to assign each user in a department to a departmentally shared volume
> designated as P:. What I need to be able to do is make these settings over
> ride the locally mapped settings. We are going to start moving everone to a
> new server this month and the old one is going away. I would like to:
>
> Drop or delete the old maps that were set up at the workstation with the
> user logged in.
>
> H:\\oldserver\userhome
> P:\\oldserver\groupshare
>
> and put in
>
> H:\\newserver\userhome (Maybe done through the user manager)
> P:\\newserver\groupshare (done with a script)
>
> This way I can move their home directory and group directory at night and
> when they log on the next morning they won't know they were moved.
>
> Also can I add a network printer (not LPT on or LPT2 as in net use LPT1:
> \\server\printer) through a login script so that it will show up as a
> windows printer.
>
> Am I dreaming? I will be glad to supply any more info.
>
> Thanks
> Byron
>
> "Scott Harding - MS MVP" <scrockel@**NO_SPAM**hotmail.com> wrote in message
> news:eUIxojTBEHA.744@TK2MSFTNGP10.phx.gbl...
> > it really is not too complicated. Here is the output from the command
> line.
> > Simple mappings to drives are very easy to create and the info below
> should
> > get you started. If this doesn't help do you have a specific need we can
> > help with? Here's a website with some help
> >
> > http://www.enterpriseitplanet.com/resources/scripts_win/
> >
> >
> > The syntax of this command is:
> >
> >
> > NET USE
> > [devicename | *] [\\computername\sharename[\volume] [password | *]]
> > [/USER:[domainname\]username]
> > [/USER:[dotted domain name\]username]
> > [/USER:[username@dotted domain name]
> > [/SMARTCARD]
> > [/SAVECRED]
> > [[/DELETE] | [/PERSISTENT:{YES | NO}]]
> >
> > NET USE {devicename | *} [password | *] /HOME
> >
> > NET USE [/PERSISTENT:{YES | NO}]
> >
> > --
> > Scott Harding
> > MCSE, MCSA, A+, Network+
> > Microsoft MVP - Windows NT Server
> >
> > "Byron Kendrick" <bkendrick@austincollege.edu> wrote in message
> > news:ePmccdTBEHA.3416@TK2MSFTNGP10.phx.gbl...
> > > Does any one have a good document explaining the net use commands and
> > login
> > > scripts. Maybe someone can point me to a URL or any good resource.
> > >
> > > Thanks
> > > Byron
> > >
> > >
> >
> >
Byron, as a rule of thumb, you always want to drop a mapping or
substitution before mapping it in case the user did map it to something
else. Let's say for example you want to map drive letter P: to
\\server1\share1, your script would look like this:
net use P: /d
subst P: /d
net use P: \\server1\share1 /persistent:no
You want to drop substitutions also since it is possible to substitute a
drive letter to a network UNC path. This is extremely rare on W2K and
higher since substitutions to UNC paths is slow as molasses, so no one
in their right mind would do it, but it is not uncommon on NT4 clients
since it is the only way to "map" a drive letter to a folder below a
share.
The persistent switch is the same as the "remap at next login" option
through the gui. You don't want your mappings to be persistent for 2
main reasons. If you choose not to use the net use /d before the
mapping for whatever reason, the script will pause at the mapping asking
if you want to overwrite the existing mapping. If you do use the net
use /d, it will run faster since there should in face be nothing to
disconnect. That line is just there in case, so that your script never
fails.
There is a con2prt.exe utility in the NTx resource kit that can connect
to shared printers rather than capture LPT ports.
hth
-- Ricardo M. Urbano Microsoft Windows 2000/NT MVP
- Next message: Ricardo M. Urbano - W2K/NT4 MVP: "Re: DFS root still exist but not the folder"
- Previous message: scott: "Unable to backup"
- In reply to: Byron Kendrick: "Re: Net use command"
- Next in thread: Byron Kendrick: "Re: Net use command"
- Reply: Byron Kendrick: "Re: Net use command"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|