Go Back   TechArena Community > Technical Support > Computer Help > Windows Server > Small Business Server
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , ,

Sponsored Links



Group membership login script

Small Business Server


Reply
 
Thread Tools Search this Thread
  #1  
Old 25-02-2007
Mick34
 
Posts: n/a
Group membership login script

I'm interested in mapping drives based on group memberships.

Can I do this using Group Policies, or do I have to use something like
kixtart?

Thanks
Reply With Quote
  #2  
Old 25-02-2007
Les Connor [SBS MVP]
 
Posts: n/a
Re: Group membership login script

Hi Mick,

You could use kixtart, but you also have the sbs_login script to work with.
You can map drives (and more) by group membership in a batch file using
IFMEMBER. You can do this directly in the default sbs_login script, or have
the script call another batch file.

--
Les Connor [SBS MVP]


"Mick34" <Mick34@discussions.microsoft.com> wrote in message
news:6C5C6297-9F1F-4A19-AB62-A106C83FEB55@microsoft.com...
> I'm interested in mapping drives based on group memberships.
>
> Can I do this using Group Policies, or do I have to use something like
> kixtart?
>
> Thanks


Reply With Quote
  #3  
Old 26-02-2007
Claus
 
Posts: n/a
Re: Group membership login script

It's an easy 3 step thing.

First create an easy bat file with the following:
c:
cd\
cscritp MapDrives.vbs

and save it in the same folder as the SBS logon script as "MapDrives.bat"

Second, open the SBS logon script and add the following line to it:
MapDrives.bat

Third, create the following script in NotPad and save it in C:\ as
"MapDrives.vbs"

On Error Resume Next

Set objSysInfo = CreateObject("ADSystemInfo")
Set objNetwork = CreateObject("Wscript.Network")

strUserPath = "LDAP://" & objSysInfo.UserName
Set objUser = GetObject(strUserPath)

For Each strGroup in objUser.MemberOf
strGroupPath = "LDAP://" & strGroup
Set objGroup = GetObject(strGroupPath)
strGroupName = objGroup.CN

Select Case strGroupName
Case "Group1"
objNetwork.MapNetworkDrive "X:", "\\ServerName\Group1share"

Case "Group2"
objNetwork.MapNetworkDrive "X:", "\\ServerName\Group2share"

Case "Group3"
objNetwork.MapNetworkDrive "X:", "\\ServerName\Group3share"

End Select
Next

Note that if users belong to several groups, you need to assign different
drive letters to each share. Also note that the Case condition is case
sensitive (Group1 is not the same as GROUP1).

Hope this helps.

--
Claus
"Mick34" <Mick34@discussions.microsoft.com> wrote in message
news:6C5C6297-9F1F-4A19-AB62-A106C83FEB55@microsoft.com...
> I'm interested in mapping drives based on group memberships.
>
> Can I do this using Group Policies, or do I have to use something like
> kixtart?
>
> Thanks



Reply With Quote
  #4  
Old 26-02-2007
Mick34
 
Posts: n/a
Re: Group membership login script

Thanks a bunch guys.

I will check into it, and if I have problems I will check in.

"Claus" wrote:

> It's an easy 3 step thing.
>
> First create an easy bat file with the following:
> c:
> cd\
> cscritp MapDrives.vbs
>
> and save it in the same folder as the SBS logon script as "MapDrives.bat"
>
> Second, open the SBS logon script and add the following line to it:
> MapDrives.bat
>
> Third, create the following script in NotPad and save it in C:\ as
> "MapDrives.vbs"
>
> On Error Resume Next
>
> Set objSysInfo = CreateObject("ADSystemInfo")
> Set objNetwork = CreateObject("Wscript.Network")
>
> strUserPath = "LDAP://" & objSysInfo.UserName
> Set objUser = GetObject(strUserPath)
>
> For Each strGroup in objUser.MemberOf
> strGroupPath = "LDAP://" & strGroup
> Set objGroup = GetObject(strGroupPath)
> strGroupName = objGroup.CN
>
> Select Case strGroupName
> Case "Group1"
> objNetwork.MapNetworkDrive "X:", "\\ServerName\Group1share"
>
> Case "Group2"
> objNetwork.MapNetworkDrive "X:", "\\ServerName\Group2share"
>
> Case "Group3"
> objNetwork.MapNetworkDrive "X:", "\\ServerName\Group3share"
>
> End Select
> Next
>
> Note that if users belong to several groups, you need to assign different
> drive letters to each share. Also note that the Case condition is case
> sensitive (Group1 is not the same as GROUP1).
>
> Hope this helps.
>
> --
> Claus
> "Mick34" <Mick34@discussions.microsoft.com> wrote in message
> news:6C5C6297-9F1F-4A19-AB62-A106C83FEB55@microsoft.com...
> > I'm interested in mapping drives based on group memberships.
> >
> > Can I do this using Group Policies, or do I have to use something like
> > kixtart?
> >
> > Thanks

>
>
>

Reply With Quote
  #5  
Old 26-02-2007
bass_player
 
Posts: n/a
Re: Group membership login script

Or...you can name your groups in such a way that you can use variables in
assigning the network drives based on group names (just be careful on the use
of the ampersand and double quote symbols - & and " - when using variables).
You can use the StrComp VBScript function to search for the group names
--
MCP MCDBA MCAD MCSD MCT MCTS MCITP:DBA
"Helping people grow and develop their full potential as God has plan for
them"


"Claus" wrote:

> It's an easy 3 step thing.
>
> First create an easy bat file with the following:
> c:
> cd\
> cscritp MapDrives.vbs
>
> and save it in the same folder as the SBS logon script as "MapDrives.bat"
>
> Second, open the SBS logon script and add the following line to it:
> MapDrives.bat
>
> Third, create the following script in NotPad and save it in C:\ as
> "MapDrives.vbs"
>
> On Error Resume Next
>
> Set objSysInfo = CreateObject("ADSystemInfo")
> Set objNetwork = CreateObject("Wscript.Network")
>
> strUserPath = "LDAP://" & objSysInfo.UserName
> Set objUser = GetObject(strUserPath)
>
> For Each strGroup in objUser.MemberOf
> strGroupPath = "LDAP://" & strGroup
> Set objGroup = GetObject(strGroupPath)
> strGroupName = objGroup.CN
>
> Select Case strGroupName
> Case "Group1"
> objNetwork.MapNetworkDrive "X:", "\\ServerName\Group1share"
>
> Case "Group2"
> objNetwork.MapNetworkDrive "X:", "\\ServerName\Group2share"
>
> Case "Group3"
> objNetwork.MapNetworkDrive "X:", "\\ServerName\Group3share"
>
> End Select
> Next
>
> Note that if users belong to several groups, you need to assign different
> drive letters to each share. Also note that the Case condition is case
> sensitive (Group1 is not the same as GROUP1).
>
> Hope this helps.
>
> --
> Claus
> "Mick34" <Mick34@discussions.microsoft.com> wrote in message
> news:6C5C6297-9F1F-4A19-AB62-A106C83FEB55@microsoft.com...
> > I'm interested in mapping drives based on group memberships.
> >
> > Can I do this using Group Policies, or do I have to use something like
> > kixtart?
> >
> > Thanks

>
>
>

Reply With Quote
Reply

  TechArena Community > Technical Support > Computer Help > Windows Server > Small Business Server


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Group membership login script"
Thread Thread Starter Forum Replies Last Post
Group Membership being applied more than once nlldavies Active Directory 8 01-06-2009 10:48 PM
Way for end users to see group membership? £Jim Active Directory 2 07-03-2009 02:59 AM
Export Group membership using script\CSVDE PK Windows Server Help 3 08-10-2007 08:46 PM
Printing Group membership Dave Mackler Active Directory 2 09-02-2007 06:19 PM
List Group membership ZAS Windows Server Help 4 26-09-2006 09:35 PM


All times are GMT +5.5. The time now is 05:29 AM.