1

I am hoping someone can assist me with this since I can't seem to find out what the issue is. We are currently using Windows 10 and I have tried it several ways, but they all result in the same way.

I created a .vbs to map network drives. I created a .exe out of a .ps1 file to map the network drives. They both will map the network drives perfectly fine, but they don't show up right away when you open "Computer". They eventually show up, but it takes a couple of minutes to show.

When I launch PowerShell and I type "get-psdrive"...I can see the drives are mapped, but again...it takes a couple of minutes for them to show up right away.

Am I missing something or something that can be enabled in the registry that would allow them to be seen right away? It seems like a simple issue, but I can't find an answer to the issue.

Jonas Turner
  • 11
  • 1
  • 2
  • Why don't you use Group Policy Preferences to map the drives instead? – joeqwerty Aug 29 '16 at 23:41
  • The backend is used by Samba. The goal was to be able to change the scripts on the profile, so that when a student would log in...the changes would then be replicated to that profile. The scripts were placed in the startup folder and can be modified at any time. The labs aren't managed by an AD environment. – Jonas Turner Aug 29 '16 at 23:46
  • So..just an fyi...I was able to find a solution that actually might work out well for me. I used the local group policy that can be added to make this work for our machines. Since we don't use AD to manage group policies, they would have be done locally. Either way, I was able to see the mapped drives perfectly this way before the user logged in and it didn't cause any issues with login times. – Jonas Turner Aug 31 '16 at 13:58

2 Answers2

1

By default, logon scripts are delayed five minutes.

This may be configured using the following policy setting:

Computer > Administrative Templates > System > Group Policy  
Setting: Configure Logon Script Delay  

enter image description here

Greg Askew
  • 35,880
  • 5
  • 54
  • 82
0

 Copy script to the following location: o C:\Windows\System32\GroupPolicy\User\Scripts\Logon  Open group policy  Computer Configuration > Administrative Templates > System > Scripts o Modify "Run logon scripts synchronously" and click "Enabled"  User Configuration > Windows Settings > Scripts (Logon/Logoff) o Modify "Logon" o Click second tab called "PowerShell Scripts" o Click "Add" o Click "Browse" o Select the script that was copied there earlier o Click "OK" o Click on dropdown box and select "Run Windows PowerShell scripts first" o Click "Apply" and then "OK"  Restart

Jonas Turner
  • 11
  • 1
  • 2