12 replies
by broadwaytech Accepted solution
by bfilmfan Accepted solution
by broadwaytech Accepted solution
by bfilmfan Accepted solution
You will need to make LDAP calls to get the Memberof attribute to determine security grou membership.
by broadwaytech Accepted solution
by ic-it Accepted solution
have folders with different permissions.
Or have labelled folders according to security groups.
by broadwaytech Accepted solution
I have to stick with vb.. here is my script:
Option Explicit
'Declare variables
Dim objNetwork, objUser, CurrentUser
Dim strGroup
' Initialize Groups with Const
Const Accounting_Group = "cn=Accounting"
Const Private_Group = "cn=SM_Private"
Const Public_Group = "cn=SM_Public"
Const Technology_Group = "cn=SM_Technology"
Const Corporate_Group = "cn=SM_Corporate"
' Create objects and extract strGroup values
Set objNetwork = CreateObject("WScript.Network")
Set objUser = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & objUser.UserName)
objNetwork.MapNetworkDrive "Q:", "\\server\Data"
objNetwork.MapNetworkDrive "I:", "\\server\Common"
strGroup = LCase(Join(CurrentUser.MemberOf))
' If logic testing strGroup for the values in Const groups
If InStr(strGroup, lcase(Corporate_Group)) Then
objNetwork.MapNetworkDrive "J:", "\\server\Corporate"
objNetwork.AddWindowsPrinterConnection "\\server\Executive-Suite"
objNetwork.SetDefaultPrinter "\\server\Executive-Suite"
ElseIf InStr(strGroup, lcase(Accounting_Group)) Then
objNetwork.MapNetworkDrive "K:", "\\server\Accounting"
objNetwork.AddWindowsPrinterConnection "\\server\Dell1815dn02"
objNetwork.AddWindowsPrinterConnection "\\server\XeroxWC7345"
objNetwork.SetDefaultPrinter "\\server\Dell1815dn02"
ElseIf InStr(strGroup, lcase(Public_Group)) Then
objNetwork.MapNetworkDrive "M:", "\\server\Public_Equity_Market"
objNetwork.AddWindowsPrinterConnection "\\server\1815dn"
objNetwork.AddWindowsPrinterConnection "\\server\XeroxWC4150"
objNetwork.SetDefaultPrinter "\\server\1815dn(trade)"
ElseIf InStr(strGroup, lcase(Private_Group)) Then
objNetwork.MapNetworkDrive "N:", "\\server\Private_Company_Market"
objNetwork.AddWindowsPrinterConnection "\\server\1815dn(trade)"
objNetwork.AddWindowsPrinterConnection "\\server\1815dn(trade)"
objNetwork.SetDefaultPrinter "\\server\1815dn(trade)"
ElseIf InStr(strGroup, lcase(Technology_Group)) Then
objNetwork.MapNetworkDrive "T:", "\\server\Tech"
objNetwork.AddWindowsPrinterConnection "\\server\Technology"
objNetwork.AddWindowsPrinterConnection "\\server\Dell3110"
objNetwork.SetDefaultPrinter "\\server\Technology"
End If
WScript.Quit
so two questions: the lcase or join statement gives me an error if the user is not in at least two security groups.
other question: is it possible to within script map a folder like the above script does. But within that folder have either shortcuts or somehow map other mapped drives inside of it? the reason for this is that some users have a lot of access to resources and all of the drive letters get used up. No I don't want to create a root share above all of these folders, i do not want to use dfs, or anything but the above script. I've heard that such a thing is possible using commands like sust, junctions, or something along that nature.. suggestions?
by larryd4 Accepted solution
We just created a network share that have folders for each division. We put shortcuts to all of the shares needed in their for each division.
We then put a shortcut to the share for that divsion on the desktop with a simple script that test what division they are in.
by broadwaytech Accepted solution
Really? Can I see how you do the security group checking and how you make these shortcuts? so you don't have to map them?
by larryd4 Accepted solution
The logon script itself is a VB Script that tests the user logging in to see what divsion they are in based on what Groups the belong to, such as IT, HR etc.
Then it simply puts a short cut called IT shortcuts on the desk top that points to that divisions folder on the share.
Then you just drop whatever shortcuts you want for that division or dept, in to that specific folder.
This the bind in VBS to connect to the AD schema
Set objSystemInfo = CreateObject("ADSystemInfo")
Then you have to test for which group
For Each Group In ObjUser.MemberOf
If Group = "CN=Company USB" & sGroups Then
USB = "Yes"
End If
If Group = "CN=IT" & sGroups Then
Call ITO()
End If
If Group = "CN=Executive Team" & sGroups Then
Call Exec()
End If
If Group = "CN=HR" & sGroups Then
Call HR()
End If
Then in each division sub call
you would have say for HR
'Set Shell = CreateObject("Wscript.shell")
Set oMyShortcut = WSHShell.CreateShortcut("HR Shortcuts")
oMyShortcut.WindowStyle = 3 '&&Maximized 7=Minimized 4=Normal
oMyShortcut.TargetPath = "\\\\HR"
oMyShortCut.Save
Its a bit crude cause I had to leave a lot of stuff out for security reasons but thats the gist of it.
by broadwaytech Accepted solution
by broadwaytech Accepted solution
So I see you are UNCing the maps.. no need for the letters.. very cool.. How would I direct it to the desktop?
This discussion is closed to new replies.
Trending Networks posts
Sort by Trending