Welcome to Sign in | Join | Help
in
Home Blog Forums

*Newb Alert*

Last post 05-13-2008, 11:38 AM by chris23ll. 6 replies.

Sort Posts: Previous Next
  •  05-07-2008, 12:40 PM 1948

    *Newb Alert*

    Okay, so I just got DFS up and running in the lab, and I want to map a specific drive based on security groups.  I was wondering if I can do this using logon scripts?  Don't beat me up too bad, im a brand new script writer...so any help at this point would be lovely.

     

    Thanks :)

     


    Keeping it real!!
  •  05-07-2008, 4:12 PM 1950 in reply to 1948

    Re: *Newb Alert*

    I have this in my notes, looking at it, its pretty self explanitory, I'd have to go through it thoroughly to understand it 

     

    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 "Finance Users"
                objNetwork.MapNetworkDrive "X:", "\\TESTSVR01\finance"
           
            Case "Human Resource Users"
                objNetwork.MapNetworkDrive "X:", "\\TESTSVR01\hr"

            Case "Manufacturing Users"
                objNetwork.MapNetworkDrive "X:", "\\TESTSVR01\manufacturing"

            Case "Shipping and Receiving Users"
                objNetwork.MapNetworkDrive "X:", "\\TESTSVR01\shipping"
        End Select
    Next

  •  05-08-2008, 4:42 PM 1953 in reply to 1950

    Re: *Newb Alert*

    Perfect!

     

    Thank you!


    Keeping it real!!
  •  05-08-2008, 5:41 PM 1954 in reply to 1953

    Re: *Newb Alert*

    no prob, glad to have helped :)
  •  05-12-2008, 12:47 PM 1961 in reply to 1954

    Re: *Newb Alert*

    Okay, I may be pressing my luck...but what about the same thing to map printers? 

     

    Thanks in advance!!


    Keeping it real!!
  •  05-12-2008, 3:25 PM 1964 in reply to 1961

    Re: *Newb Alert*

    Looks like unless you want to use a vb script, you will have to base it off computer OU, rather than user group - but I could be wrong, maybe you can look at this and tweak

     This is a MS Script page

  •  05-13-2008, 11:38 AM 1967 in reply to 1964

    Re: *Newb Alert*

    That worked perfectly! 

     

    Thanks again!


    Keeping it real!!
View as RSS news feed in XML


All postings are provided "AS IS" with no warranties, and confer no rights.
Microsoft product screen shot(s) reprinted with permission from Microsoft Corporation.