Powershell – Replce Kix script with Powershell

logon-scriptspowershell

We are looking to replace our current Kix scripts with Powershell scripts and I was curious how to test group membership to map network drives. Our current kix script basically just does an if statement on every user group and tests if the user is a part of that group, if they are, it maps a network drive. Here is an example:

If InGroup("ADGROUP")
  Use m: "\\server\share"
EndIf

I doubt this is the most efficient way to do this but I wanted to ask how I can accomplish the same thing in PowerShell and what people recommend for a proper way to map drives and printers for users in Active Directory.

If this information is needed all of our clients are on Windows Vista/7 and we are just now moving to AD 2008.

Best Answer

I would use group policy preferences to map drives in AD. See Using Group Policy Preferences to Map Drives Based on Group Membership for details. I also encourage user education on showing them how to add network locations to their libraries.