Group Policy Powershell Script
Votes from Connect: 28
Original Date Submitted: 9/29/2014 7:28:00 PM
Handle: Axel B. Andersen
Site Name: PowerShell
Feedback ID: 984532
Frequency: Always Happens
Regression: Yes, this happens in all previous versions
When running Powershell Logon or Logoff Scrips in GPO's the -NoProfile switch is not included in the command. This results in very long logon/logoff times, if users have filled their Powershell Profile with a lot of modules. It can take up to 10 minutes, if the profile needs user input to load.
Product Studio item created by Connect Synchronizer due to creation of feedback ID 984532 (http://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=984532).
Create a powershell profile with just this one line:
read-host "Please type something"
Create a logon script with this content:
start-transcript c:\temp\test.txt # Make sure the folder exists before running the script.
Create a GPO and configure the User Logon Powershell Script above.
Link the GPO to the OU where the testuser with the profile resides.
Log on with the test user.
The logon process will wait for the Powershell Script to time out. It will halt at Read-Host, which can be seen in the c:\temp\test.txt file after logon.
Internal BugId: 11025