'Windows new profile loading over 1 minute
Im using windows10 Enterprise template on vcenter and im creating users on vm using this powershell script:
I have a powershell script that creates new users on new vm that has windows10 Enterprise, This is the script:
param (
[Parameter(Mandatory=$True)]
[string]$pass,
[Parameter(Mandatory=$True)]
[string]$user,
[Parameter(Mandatory=$True)]
[string]$gr
)
$Password = ConvertTo-SecureString -AsPlainText $pass -Force
New-LocalUser $user -Password $Password -PasswordNeverExpires
Add-LocalGroupMember -Group $gr -Member $user
If i create new user through admin user the new user profile loads in 20 sec
Is there a way to speed up user profile first log in using this script? Thanks
Solution 1:[1]
This is pretty normal for windows. New-LocalUser does not create the profile, (home directory, user settings, registry, etc.) so you need an additional step to get windows to complete the first-time setup.
This answer about using the windows CreateProfile API to create a user-profile on-demand is probably what you're looking for.
A simpler way is to just do part of the profile creation ahead of time by starting a process as that user. This skips processing some desktop items like Theme setup, but may speed up the profile creation enough for what you need:
Start-Process notepad -Credential $myUserCreds
And when using templates, Microsoft also recommends customizing the Default user profile to speed up new user profile creation. This lets windows just copy most things from the default profile rather than generate entirely new settings. It should be done as you sysprep your VM for templating:
Create an Unattend.xml file that contains the Copy Profile parameter (
Microsoft-Windows-Shell-Setup\CopyProfile). By using this Copy Profile parameter, the settings of the user who is currently logged on are copied to the default user profile.Example sysprep command:
%systemroot%\system32\sysprep\sysprep.exe /oobe /shutdown /generalize /unattend:c:\answerfile\unattend.xml
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Cpt.Whale |
