No announcement yet.

Map a network share based on varibles

  • Filter
  • Time
  • Show
Clear All
new posts

  • Map a network share based on varibles

    Hello everyone,
    I am new to the community, I recently stumbled on this sire while looking for good reliable resources using widows server. I found your scripting section and thought I might see if anyone would be able to help with and idea i had.
    Basically I want to create a script to map a network share, but the thing that makes it complex is that I want the script to prompt for windows credenitals when run and then based on the username entered the specific folder is mapped. But it cannot map based on the local user logged in. It needs to be other credentials because the user logged in will only be accessing their files
    To be more clear I need to map the network share for a specific user but the script to ask the user name first because everyone has their own personal share and the location is different for everyone.

    Example :

    1. user runs script;
    2. dialouge box asks for username (Student1)
    3. script then amps share based on username entered (\\server\share\username "from step 2"
    4. Windows prompts for credentials for access to their folder.

    I appreciate any help that can be given with this idea. I honestly don't care what language it is in. As long as it performs.

    Thanks again, I look forward to seeing what ideas people have.
    Last edited by dgarcia15; 11th December 2015, 19:30.

  • #2
    Wouldn't it be easier to set the Home Folder path in AD?


    • #3
      I assume this is for someone to access other users' folders?
      Here's a quick Powershell script to do it:

      $creds = Get-Credential
      $driveLetter = "x"
      New-PSDrive -Name $driveLetter -PSProvider FileSystem -Credential $creds -Root "\server\share\$($creds.UserName)"

      Network Consultant/Engineer
      Baltimore - Washington area and beyond