Re: Logon Scripts for Dept. and Printers based on Groups and IP

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



For drive mapping, I have written a good sub you can use at h
ttp://vbscripter.blogspot.com/2008/03/better-drive-mapping.html

For handling group membership, we load all the groups into a
dictionary object. It cuts down on ADSI calls and uses less code than
select case statements. And the best part is that you can set the
compare mode to ignore case. :D If you want an example this code,
let me know.

-Corey


On Apr 29, 10:28 pm, "Al Dunbar" <AlanD...@xxxxxxxxxxxxxxxxxxx> wrote:
"Richard Mueller [MVP]" <rlmueller-nos...@xxxxxxxxxxxxxxxxxxxx> wrote in
messagenews:O9TWxhiqIHA.2292@xxxxxxxxxxxxxxxxxxxxxxx





"Pegasus (MVP)" <I....@xxxxxxxxxx> wrote in message
news:uH33ebhqIHA.2068@xxxxxxxxxxxxxxxxxxxxxxx

<mike...@xxxxxxxxx> wrote in message
news:abbad4b5-d0e8-46e4-88a5-9ea3b6679173@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have a script that was put together by a several different scripts
and some reading I have done on scripting. Anyhow, I've attached a
script located below that will map department shares based on the
users active directory group membership and connected printer(s)
based on their IP address. The script works well until the IP address
part. If anyone can help, that would be great. Feel free to modify
it in any way that would make the script better!

Thanks..
=============

Splitting a string into its components is usually done with the
inbuilt "split" function:

arrOctets = Split(sIP, ".")
'Assuming IP's 172.23.1.0, 172.23.2.0, 172.23.3.0....
if arrOctets(2) = 1 Then Loc = "Floor7"
if arrOctets(2) = 2 Then Loc = "Floor9"
if arrOctets(2) = 3 Then Loc = "Floor10"

Some more comments on the script you posted.

1. I actually feel it is important for users to see error messages in a
logon script. If error messages are suppressed, no one is even aware that
anything went wrong. If someone notices that something isn't right
(missing drive mapping or printer), it could be days later and no one has
a clue where to look or how to troubleshoot. I want my users to see the
error messages and report them to me so I can fix them.

It's not often I get the chance to disagree with Richard!

I do not feel it is important for users to see error messages in a logon
script. In my experience, they usually do not notice them; but if they do,
they do not read them, understand them, write them down, or report them.

If the message is displayed momentarily, they will never see it. If
displayed in a popup they have to click away, they will just click. If this
is a recurring problem such as failing to map a drive they never use, they
will become conditioned to believe that all error messages are pointless.

In the event they have problems later, they just might tell me that "there
was some kind of error, but I don't remember what it said".

Our logon script logs its proceedings and error messages into a file in the
user's %temp% folder. When they report a problem that indicates a logon
script failure, that is the first place I look.

As an aside, logon scripts should be as simple as possible, and designed to
avoid errors. For example, ours has a MAP function that unmaps the drive
letter if already assigned. Having some drives pre-assigned is therefore not
an error.

/Al



.



Relevant Pages

  • Re: MapNetworkDrive not working during first logon
    ... is mapped automatically as part of the users profile. ... if I open a command prompt and switch to one of the mapped drives I ... script runs I get the popup message ... No path is specified for the logon script itself. ...
    (microsoft.public.scripting.vbscript)
  • RE: Drive map issues after SP1
    ... There was never a /persistent:yes in the script - I had to add the ... the logon script will try to map the drive again. ... > before the map drive command to delete all the mapped drives: ...
    (microsoft.public.windows.server.sbs)
  • Re: Need help
    ... According to the description, you want a logon script to map drive letters ... Migration of Novell to MicrosoftTo boil down if you need to ... Scripts/Mapped Drives: Every Novell environment I have ever ... ...
    (microsoft.public.windows.server.migration)
  • Re: User Scripts
    ... users will not have their shared drives, ... dont have any others, try a basic script, maybe adding a printer, to see ... Also one other fix is to reboot the machine 3 ... then add the bat file name to the logon script text field. ...
    (microsoft.public.windows.server.active_directory)
  • Re: MapNetworkDrive not working during first logon
    ... Here is the code that I use to map conditional network drives. ... script runs I get the popup message ... No path is specified for the logon script itself. ...
    (microsoft.public.scripting.vbscript)