Logon Scripts

G

Guest

Does anyone know if this is possible? I want to map drives using a startup
script. I know it can be easily done with a logon script, but this wont work
because I need to map the drives based on computers, not users. Currently I
am using a batch file on each computer to map drives. This is messy because
I have to reconfigure every desktop if a change is needed. I want to use a
GPO and link it to an OU. I tried using a batch file as a startup script but
it didn't work. I don't know VB. Any suggestions would be much appreciated!
 
R

Ray Costanzo [MVP]

What kind of logic do you want to use to determine the drive mappings? That
is, do you have a list of criteria like:

If computer name starts with "OFFICE3" map L: to \\server3\share
If computer's third IP octet is 212, map Q: to \\someserver\someshare
etc.

I don't think you'll be able to use a startup script (not that I see the
advantage of that over the logon script) since startup scripts run under the
context of the machine's system account.

Ray at home
 
P

Pegasus \(MVP\)

flux blocker said:
Does anyone know if this is possible? I want to map drives using a startup
script. I know it can be easily done with a logon script, but this wont work
because I need to map the drives based on computers, not users. Currently I
am using a batch file on each computer to map drives. This is messy because
I have to reconfigure every desktop if a change is needed. I want to use a
GPO and link it to an OU. I tried using a batch file as a startup script but
it didn't work. I don't know VB. Any suggestions would be much
appreciated!

You can do this with standard logon scripts, with a twist:

Line1 @echo off
Line2 rem Common Shares
Line3 net use s: \\YourServer\YourSectionShare
etc.
Line4 if exist \\YourServer\NetLogon\PCs\%ComputerName%.bat call
\\YourServer\NetLogon\PCs\%ComputerName%.bat

If a particular PC, e.g. PC55, requires its own script then you
place PC55.bat into the folder \\YourServer\NetLogon\PCs.
It might contain a single line such as

net use x: \\Server\Finance

Since all such scripts are located on the netlogon share, you can
manage them centrally. You can even group them if your workstation
names are structured:

Line4 echo %ComputerName% | find /i "Finance" > nul && call
\\YourServer\NetLogon\PCs\Finance.bat
 
G

Guest

Thanks! That sounds like the solution I am looking for. Are you saying I
can use if-then commands in a batch file? The third octet is different on
each site/subnet. For example, let's say one subnet is 192.168.100.0/24 and
computer (workstation) names are WS100011, WS100012, etc. Does this mean I
can use a batch file as a logon script with commands such as "if computer
name starts with "WS100" then map L to \\server3\share", etc.
If I can do this then I guess I just need to learn the syntax of using
if-then commands in a batch file and I can probably figure it out from there.
I think I have some batch files I can refer to for help with that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top