Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing Mapped Drive based off of Group Membership

Status
Not open for further replies.

ALLM

Technical User
Aug 11, 2009
14
US
Question:
I'm mapping network drives based off of their Group Membership in Active Directory. I have that working fine, but I now need to add a statement that if they are a member of group "XYZ" then DELETE Mapped Drive P:\ and map the following drives.

Any help would be appreciated.
Thanks!
 
If you are already mapping of group membership, what are you having problems with in deleting and mapping a new drive(s)?

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
In my login scripts, I use
Code:
grpFinancial = false
grpSales = false
grpMarketing = false

set objUser = GetObject("LDAP://" & strUserName & "")
set tblUserGroups = objUser.Groups

for each objGroup in tblUserGroups
	select case lcase(objGroup.CN)
		case "finance"   : grpFinancial = true
		case "sales"     : grpSales = true
		case "marketing" : grpMarketing = true
	end select
next

if (grpFinancial) then mapDrive "X:" "\\fileshare\finance"
if (grpSales) then mapDrive "X:" "\\fileshare\sales"
if (grpMarketing) then 
   removeMapDrive "X:"
   mapDrive "X:" "\\fileshare\marketing"
end if

-Geates
 
DM4EVER - I'm dissecting a customers Novell Login so it can be converted for the Windows environment. Some of these groups in Novell overlap and need to map the same drive letter to different "UNC" paths.

I should probably step back and look at this from a different angle. Most likely some better logic that can be used.

Geates - Thanks for the working example. Let me see if I can use that for my purposes.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top