Group drive mapping.......login scripts
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
Group drive mapping.......login scripts

 
Post new topic   Reply to topic    Windows Server Forum Index -> Programming
Author Message
Zeno
Guest





Posted: Fri Jan 07, 2005 9:21 am    Post subject: Group drive mapping.......login scripts Reply with quote

Hi..........

I'm in the process of configuring a login in script for our AD
network.......what I want to do is create a series of groups with users in
them and based on the users group membership map their required drives and
printers........

I've seen it been done in some companies where the Global Groups are defined
and in the Global Groups description box the groups drive mapping path is
defined ie. [F:\\ASIHKDFNP01\apps] and from there the script automatically
maps the drive.....for the user

Anyone have experience on how this is done or where should I start........

Any repsonse much appreciated...........

Zeno
Back to top
Torgeir Bakken (MVP)
Guest





Posted: Fri Jan 07, 2005 5:55 pm    Post subject: Re: Group drive mapping.......login scripts Reply with quote

Zeno wrote:

Quote:
Hi..........

I'm in the process of configuring a login in script for our AD
network.......what I want to do is create a series of groups with users in
them and based on the users group membership map their required drives and
printers........

I've seen it been done in some companies where the Global Groups are defined
and in the Global Groups description box the groups drive mapping path is
defined ie. [F:\\ASIHKDFNP01\apps] and from there the script automatically
maps the drive.....for the user

Anyone have experience on how this is done or where should I start........

Any repsonse much appreciated...........
Hi


For some VBScript examples on group membership testing, take a look
under "Group Membership Tests" and "Logon Scripts" under "Free
VBScript Code" at
http://www.rlmueller.net/

You will also find logon script examples with group testing etc. at
http://cwashington.netreach.net as well.

E.g. here:
http://cwashington.netreach.net/depo/default.asp?topic=repository&ScriptType=vbscript&SubType=LogonScripts


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
Back to top
SubnetJO
Guest





Posted: Fri Jan 07, 2005 6:31 pm    Post subject: RE: Group drive mapping.......login scripts Reply with quote

The sample logon script below mapps file-shares and printer-shares from any
server on a user "group belonging" criteria.

Replace the sample names included in the "<...>" brachets with your domain
name, group names, server names, share names...

It should be close what you need.

The script is a portion I wrote for my network, rewrited to work "stand
alone" and to translate into english.
I tested it against my enviroment and works fine.
Enviroment IS NOT AD domain, is NT4 domain, but is you use the NetbiosName
of domain it should work well.
If not, just modify the line to "attach" the domain...

[script starts here]
DomNBTname="<Domain Name>"

set obj_UBG_Dictionary=CreateObject("Scripting.Dictionary")
Set WshNetwork = CreateObject("WScript.Network")

DomPrefixBytes= Len(DomNBTname) + 2
Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colComputer = objWMIService.ExecQuery ("Select * from
Win32_ComputerSystem")

For Each objComputer in colComputer
cu = Mid(objComputer.UserName,DomPrefixBytes)
Next

dim groupcouter
groupcounter = 1
set objDomain = GetObject("WinNT://" & DomNBTname)
objDomain.Filter = Array("group")
For Each objGroup In objDOmain
For Each objUser in objGroup.Members
If objUser.name = cu Then
obj_UBG_Dictionary.Add groupcounter, objGroup.Name
wscript.echo obj_UBG_Dictionary.Item(groupcounter)
groupcounter = groupcounter + 1
End If
Next
Next

for i = 1 to obj_UBG_Dictionary.Count
select case obj_UBG_Dictionary.Item(i)

case "<SampleGroup1>"
WshNetwork.MapNetworkDrive "<letter>:",
"\\<FileServerName>\<FileShareName>"
WshNetwork.AddWindowsPrinterConnection
"\\<PrinterServerName>\<PrinterShareName>"

case "<SampleGroup2>"
WshNetwork.MapNetworkDrive "<letter>:",
"\\<FileServerName>\<FileShareName>"
WshNetwork.AddWindowsPrinterConnection
"\\<PrinterServerName>\<PrinterShareName>"

case "<SampleGroup3>"
WshNetwork.MapNetworkDrive "<letter>:",
"\\<FileServerName>\<FileShareName>"
WshNetwork.AddWindowsPrinterConnection
"\\<PrinterServerName>\<PrinterShareName>"

End select

[end of script]

I hope this can help.
Bye,
SubnetJO
Italy
Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> Programming All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB