Re: Logon Script

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Al Dunbar [MS-MVP] (alan-no-drub-spam_at_hotmail.com)
Date: 12/31/04


Date: Fri, 31 Dec 2004 10:21:13 -0700


"Andrew Austen" <aausten@bigpond.net.au> wrote in message
news:OvJA6Eu7EHA.3836@tk2msftngp13.phx.gbl...
> Hi Jaime,
>
> I use the following, which you will need to customise for your own
> environment of course.
>
> Dim UserName
> Dim Domain
>
> on error resume next
> Set wshShell = WScript.CreateObject("WScript.Shell")
> on error resume next
> Set WSHNetwork = WScript.CreateObject("WScript.Network")
> on error resume next
> Set WSHEnv = wshShell.Environment
>
>
> Username = ""
> While UserName = ""
> on error resume next
> UserName = UCASE(WSHNetwork.UserName)
> WEnd
>
> Set UserObj = GetObject("WinNT://DOMAINNAME/"& username)
> ' Set Home Directory
> MapDrive "x:", "\\servername\" & username & "$"
> ' Map Drives by Group
> For Each GroupObj In UserObj.Groups
> select case groupobj.name
> case "Domain Admins" MapDrive "z:", "\\servername\c$"
> MapDrive "y:",
> "\\servername\share2$"
> case "HelpDesk" MapDrive "y:", "\\servername\share2$"
> end select
> Next
>
>
>
'###########################################################################
###########
> '
> ' End Map Network Drives
> '
>
'###########################################################################
###########
>
> Sub MapDrive (driveletter, UNCString)
> On Error Resume Next
> WSHNetwork.RemoveNetworkDrive driveletter
> WSHNetwork.MapNetworkDrive driveletter, Uncstring
> End sub

An interesting approach. Unfortunately, this will test only direct
membership, and not membership that is inherited through group nesting in an
Active Directory environment.

/Al

>
>
>
> Cheers
>
> Andrew
>
>
> "Jaime" <Jaime@discussions.microsoft.com> wrote in message
> news:25C81D56-1C9A-4A0D-B92C-983E9C312221@microsoft.com...
> >I am looking for a script that users can run at logon that will map
drives
> > and printers. I would like for it to check what group the users belong
to
> > (global group.."Accounting", "Finance") and then map the corresponding
> > drives. We are currently using batch files that are for specific groups
> > and
> > I would like to consolidate them into one file for easy maintenance. We
> > have
> > no need to keep batch files. We are open to any scripting language.
> >
> >
> > Jaime
> >
>
>



Relevant Pages

  • Re: [SMS] DB2 Table/IndexSpace managed placement vs. StorClas MSR attributes
    ... type for your production environment, so the drives will all perform the ... same no matter what storage class attributes are assigned. ... I've been storage managing all DB2 regions except production for 2-3 ...
    (bit.listserv.ibm-main)
  • Re: Recommend a good IDE drive for 24*7 use?
    ... IME, for 24*7, in a suitable environment*, drives from all manufacturers are likely to be swapped out for something bigger, before drive longevity becomes an issue. ... *Kept cool, isolated from vibration, with stable supplies and in a temperature and humidity controlled environment. ... I've got drives from all the main manufacturers that have been running in such an environment for years, with statistically insignificant differences in failure rates between them. ...
    (uk.comp.homebuilt)
  • Re: Performance problem
    ... >> process some physical changes were made to our environment. ... >> result is that our batch job now takes twice the amount of time to ... Disk layouts were changed to make use of the larger drives ... The NIC cards may not make any different. ...
    (comp.databases.oracle.server)
  • Re: DOS Woes
    ... >off the network so I can transfer it into a new XP environment? ... even tried the novel clients. ... You don't have to install any new software, ... failure swapping drives in and out, etc, etc, etc. ...
    (microsoft.public.windowsxp.general)
  • Re: Fishing for stocked fish.
    ... Is to mke sure that my own personal environment - family included- is a s ... I have unfortunately had occasion to throw people off of my land I suspect ... I do not mean to say here that Fortenberry is one of the toxix ones ... But if he drives you nuts- ...
    (rec.outdoors.fishing.fly)