Forum Search:
Forum.Brain-Cluster.com: Brain Cluster Technical Forum
Ultimate forum for Technical Discussions

Home » Microsoft » Windows Server » Active Directory » Drive Mappings based on Computer membership?
Drive Mappings based on Computer membership? [message #159918] Wed, 12 August 2009 12:49 Go to next message
Drew Boillot  is currently offline Drew Boillot  United States
Messages: 21
Registered: August 2009
Junior Member
Hello, I'm looking for a way to map drives based on what group the computer
is a member of, so that anyone who logs in to this PC gets their "home
drive" remapped to another server. ((its going in to a Video and Photo
editing class and for space reasons they need to be mapped differently))

what I have now is everyone has their home drive's mapped to H:\ unc path of
\\servername1\users\%username%

I want to make it h:\ mapped to unc path of
\\videoservername\users\%username%
only for people who log in to these 20 some PCs.

let me know if you need more information.

TIA
Re: Drive Mappings based on Computer membership? [message #159923 is a reply to message #159918] Wed, 12 August 2009 14:07 Go to previous messageGo to next message
rlmueller-nospam  is currently offline rlmueller-nospam  United States
Messages: 292
Registered: July 2009
Senior Member
Drew Boillot wrote:

> Hello, I'm looking for a way to map drives based on what group the
> computer is a member of, so that anyone who logs in to this PC gets their
> "home drive" remapped to another server. ((its going in to a Video and
> Photo editing class and for space reasons they need to be mapped
> differently))
>
> what I have now is everyone has their home drive's mapped to H:\ unc path
> of \\servername1\users\%username%
>
> I want to make it h:\ mapped to unc path of
> \\videoservername\users\%username%
> only for people who log in to these 20 some PCs.
>
> let me know if you need more information.

You don't say, but I assume you have a logon script. If it is a *.bat file,
you cannot test for group membership, except perhaps with a utility called
IfMember that used to be in the Windows NT resource kit, or perhaps using
KiXtart. In both cases they can check user group membership, but may not
have the ability to check computer group membership.

You can check user and computer group membership in a VBScript logon script.
In brief:
========
Option Explicit
Dim objNetwork, objSysInfo, strComputerDN, objComputer
Dim objGroup, strUser

' Retrieve pre-Windows 2000 logon name of current user.
Set objNetwork = CreateObject("Wscript.Network")

' Bind to local computer object.
Set objSysInfo = CreateObject("ADSystemInfo")
strComputerDN = objSysInfo.ComputerName
Set objComputer = GetObject("LDAP://" & strComputerDN)

' Bind to group whose membership will be checked.
Set objGroup = GetObject("LDAP://cn=Engineering,ou=West,dc=MyDomain,dc=com")

' Check if the computer is a member of this group.
If (objGroup.IsMember(objComputer.AdsPath) = True) Then
' Computer is a member of the group.
objNetwork.MapNetworkDrive "H:", "\\servername1\users\" & strUser
Else
' Computer is NOT a member of the group.
objNetwork.MapNetworkDrive "H:", "\\videoservername\users\" & strUser
End If
==========
I may have the shares reversed, whether the computer is in the group or not,
but you get the idea.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--
Re: Drive Mappings based on Computer membership? [message #159925 is a reply to message #159923] Wed, 12 August 2009 14:38 Go to previous messageGo to next message
Drew Boillot  is currently offline Drew Boillot  United States
Messages: 21
Registered: August 2009
Junior Member
Thanks. Right now I do not have any login scripts for the students, what
I've done in the past was to call the VB script from the .cmd file, seemed
to work well.. right now we're just using the built in "home drive" setting
of AD (user profile setting when in AD users & computers)

thanks for the help, I think I have enough of an idea to get started..

"Richard Mueller [MVP]" <rlmueller-nospam@ameritech.nospam.net> wrote in
message news:uEnDCi4GKHA.3888@TK2MSFTNGP03.phx.gbl...
> Drew Boillot wrote:
>
>> Hello, I'm looking for a way to map drives based on what group the
>> computer is a member of, so that anyone who logs in to this PC gets their
>> "home drive" remapped to another server. ((its going in to a Video and
>> Photo editing class and for space reasons they need to be mapped
>> differently))
>>
>> what I have now is everyone has their home drive's mapped to H:\ unc path
>> of \\servername1\users\%username%
>>
>> I want to make it h:\ mapped to unc path of
>> \\videoservername\users\%username%
>> only for people who log in to these 20 some PCs.
>>
>> let me know if you need more information.
>
> You don't say, but I assume you have a logon script. If it is a *.bat
> file, you cannot test for group membership, except perhaps with a utility
> called IfMember that used to be in the Windows NT resource kit, or perhaps
> using KiXtart. In both cases they can check user group membership, but may
> not have the ability to check computer group membership.
>
> You can check user and computer group membership in a VBScript logon
> script. In brief:
> ========
> Option Explicit
> Dim objNetwork, objSysInfo, strComputerDN, objComputer
> Dim objGroup, strUser
>
> ' Retrieve pre-Windows 2000 logon name of current user.
> Set objNetwork = CreateObject("Wscript.Network")
>
> ' Bind to local computer object.
> Set objSysInfo = CreateObject("ADSystemInfo")
> strComputerDN = objSysInfo.ComputerName
> Set objComputer = GetObject("LDAP://" & strComputerDN)
>
> ' Bind to group whose membership will be checked.
> Set objGroup =
> GetObject("LDAP://cn=Engineering,ou=West,dc=MyDomain,dc=com")
>
> ' Check if the computer is a member of this group.
> If (objGroup.IsMember(objComputer.AdsPath) = True) Then
> ' Computer is a member of the group.
> objNetwork.MapNetworkDrive "H:", "\\servername1\users\" & strUser
> Else
> ' Computer is NOT a member of the group.
> objNetwork.MapNetworkDrive "H:", "\\videoservername\users\" & strUser
> End If
> ==========
> I may have the shares reversed, whether the computer is in the group or
> not, but you get the idea.
>
> --
> Richard Mueller
> MVP Directory Services
> Hilltop Lab - http://www.rlmueller.net
> --
>
>
Re: Drive Mappings based on Computer membership? [message #159935 is a reply to message #159925] Wed, 12 August 2009 18:48 Go to previous messageGo to next message
rlmueller-nospam  is currently offline rlmueller-nospam  United States
Messages: 292
Registered: July 2009
Senior Member
This FAQ might be of help:

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

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

"Drew Boillot" <drew@gocmcs.com> wrote in message
news:ei$Bsz4GKHA.2516@TK2MSFTNGP02.phx.gbl...
> Thanks. Right now I do not have any login scripts for the students, what
> I've done in the past was to call the VB script from the .cmd file, seemed
> to work well.. right now we're just using the built in "home drive"
> setting of AD (user profile setting when in AD users & computers)
>
> thanks for the help, I think I have enough of an idea to get started..
>
> "Richard Mueller [MVP]" <rlmueller-nospam@ameritech.nospam.net> wrote in
> message news:uEnDCi4GKHA.3888@TK2MSFTNGP03.phx.gbl...
>> Drew Boillot wrote:
>>
>>> Hello, I'm looking for a way to map drives based on what group the
>>> computer is a member of, so that anyone who logs in to this PC gets
>>> their "home drive" remapped to another server. ((its going in to a Video
>>> and Photo editing class and for space reasons they need to be mapped
>>> differently))
>>>
>>> what I have now is everyone has their home drive's mapped to H:\ unc
>>> path of \\servername1\users\%username%
>>>
>>> I want to make it h:\ mapped to unc path of
>>> \\videoservername\users\%username%
>>> only for people who log in to these 20 some PCs.
>>>
>>> let me know if you need more information.
>>
>> You don't say, but I assume you have a logon script. If it is a *.bat
>> file, you cannot test for group membership, except perhaps with a utility
>> called IfMember that used to be in the Windows NT resource kit, or
>> perhaps using KiXtart. In both cases they can check user group
>> membership, but may not have the ability to check computer group
>> membership.
>>
>> You can check user and computer group membership in a VBScript logon
>> script. In brief:
>> ========
>> Option Explicit
>> Dim objNetwork, objSysInfo, strComputerDN, objComputer
>> Dim objGroup, strUser
>>
>> ' Retrieve pre-Windows 2000 logon name of current user.
>> Set objNetwork = CreateObject("Wscript.Network")
>>
>> ' Bind to local computer object.
>> Set objSysInfo = CreateObject("ADSystemInfo")
>> strComputerDN = objSysInfo.ComputerName
>> Set objComputer = GetObject("LDAP://" & strComputerDN)
>>
>> ' Bind to group whose membership will be checked.
>> Set objGroup =
>> GetObject("LDAP://cn=Engineering,ou=West,dc=MyDomain,dc=com")
>>
>> ' Check if the computer is a member of this group.
>> If (objGroup.IsMember(objComputer.AdsPath) = True) Then
>> ' Computer is a member of the group.
>> objNetwork.MapNetworkDrive "H:", "\\servername1\users\" & strUser
>> Else
>> ' Computer is NOT a member of the group.
>> objNetwork.MapNetworkDrive "H:", "\\videoservername\users\" & strUser
>> End If
>> ==========
>> I may have the shares reversed, whether the computer is in the group or
>> not, but you get the idea.
>>
>> --
>> Richard Mueller
>> MVP Directory Services
>> Hilltop Lab - http://www.rlmueller.net
>> --
>>
>>
Re: Drive Mappings based on Computer membership? [message #160063 is a reply to message #159935] Mon, 17 August 2009 14:26 Go to previous message
Drew Boillot  is currently offline Drew Boillot  United States
Messages: 21
Registered: August 2009
Junior Member
Thanks for the info.
Some of the stuff I knew, some of the stuff I didn't.. I'm going to be
setting up the scripts tomorrow so I'll let you know how it goes!

"Richard Mueller [MVP]" <rlmueller-nospam@ameritech.nospam.net> wrote in
message news:#BQwX$6GKHA.2516@TK2MSFTNGP02.phx.gbl...
> This FAQ might be of help:
>
> http://www.rlmueller.net/LogonScriptFAQ.htm
>
> --
> Richard Mueller
> MVP Directory Services
> Hilltop Lab - http://www.rlmueller.net
> --
>
> "Drew Boillot" <drew@gocmcs.com> wrote in message
> news:ei$Bsz4GKHA.2516@TK2MSFTNGP02.phx.gbl...
>> Thanks. Right now I do not have any login scripts for the students, what
>> I've done in the past was to call the VB script from the .cmd file,
>> seemed to work well.. right now we're just using the built in "home
>> drive" setting of AD (user profile setting when in AD users & computers)
>>
>> thanks for the help, I think I have enough of an idea to get started..
>>
>> "Richard Mueller [MVP]" <rlmueller-nospam@ameritech.nospam.net> wrote in
>> message news:uEnDCi4GKHA.3888@TK2MSFTNGP03.phx.gbl...
>>> Drew Boillot wrote:
>>>
>>>> Hello, I'm looking for a way to map drives based on what group the
>>>> computer is a member of, so that anyone who logs in to this PC gets
>>>> their "home drive" remapped to another server. ((its going in to a
>>>> Video and Photo editing class and for space reasons they need to be
>>>> mapped differently))
>>>>
>>>> what I have now is everyone has their home drive's mapped to H:\ unc
>>>> path of \\servername1\users\%username%
>>>>
>>>> I want to make it h:\ mapped to unc path of
>>>> \\videoservername\users\%username%
>>>> only for people who log in to these 20 some PCs.
>>>>
>>>> let me know if you need more information.
>>>
>>> You don't say, but I assume you have a logon script. If it is a *.bat
>>> file, you cannot test for group membership, except perhaps with a
>>> utility called IfMember that used to be in the Windows NT resource kit,
>>> or perhaps using KiXtart. In both cases they can check user group
>>> membership, but may not have the ability to check computer group
>>> membership.
>>>
>>> You can check user and computer group membership in a VBScript logon
>>> script. In brief:
>>> ========
>>> Option Explicit
>>> Dim objNetwork, objSysInfo, strComputerDN, objComputer
>>> Dim objGroup, strUser
>>>
>>> ' Retrieve pre-Windows 2000 logon name of current user.
>>> Set objNetwork = CreateObject("Wscript.Network")
>>>
>>> ' Bind to local computer object.
>>> Set objSysInfo = CreateObject("ADSystemInfo")
>>> strComputerDN = objSysInfo.ComputerName
>>> Set objComputer = GetObject("LDAP://" & strComputerDN)
>>>
>>> ' Bind to group whose membership will be checked.
>>> Set objGroup =
>>> GetObject("LDAP://cn=Engineering,ou=West,dc=MyDomain,dc=com")
>>>
>>> ' Check if the computer is a member of this group.
>>> If (objGroup.IsMember(objComputer.AdsPath) = True) Then
>>> ' Computer is a member of the group.
>>> objNetwork.MapNetworkDrive "H:", "\\servername1\users\" & strUser
>>> Else
>>> ' Computer is NOT a member of the group.
>>> objNetwork.MapNetworkDrive "H:", "\\videoservername\users\" & strUser
>>> End If
>>> ==========
>>> I may have the shares reversed, whether the computer is in the group or
>>> not, but you get the idea.
>>>
>>> --
>>> Richard Mueller
>>> MVP Directory Services
>>> Hilltop Lab - http://www.rlmueller.net
>>> --
>>>
>>>
>
>
Previous Topic:Query Directory for 32 and 64 Bit OS
Next Topic:DHCP and AD integration?
Goto Forum:
  


Current Time: Tue Jan 16 10:39:00 MST 2018

Total time taken to generate the page: 0.03893 seconds
.:: Contact :: Home ::Sitemap::.

Powered by: FUDforum 3.0.0RC2.
Copyright ©2001-2009 FUDforum Bulletin Board Software