Mapping drives based on group membership under TS

B

brian

My objective is to map a drive for users of a specific
group in Active Directory. The drive should only be
mapped under terminal services sessions.

The usrlogon.cmd currently calls a script (e.g.
logon1.bat) on our domain controller and that works fine.

I've modified a VBS supplied by Microsoft (below). I've
attempted to call this script (e.g. call script1.vbs)
within the usrlogon.cmd file and logon1.bat file but it
doesn't appear to be executing.

Const Test_Group = "cn=TestGroup1"
Set wshNetwork = CreateObject("WScript.Network")
Set ADSysInfo = CreateObject("ADSystemInfo")

Set CurrentUser = GetObject("LDAP://" &
ADSysInfo.UserName)
strGroups = LCase(Join(CurrentUser.MemberOf))

If InStr(strGroups, Test_Group) Then
wshNetwork.MapNetworkDrive "i:", "\\servername\share"
End If

Any help greatly appreciated.

B
email: blilly(removethispart)@crh.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top