How to style the first login through WinRM

So, I am working on a cook cookbook for Windows, which means that it usually runs on an instance of Windows Server (in this case 2012r2). In particular, I install MSYS2, which uses Cygwin under the hood. I noticed that installing the package was very slow and traced an article showing how, by default, nsswitch.conf in Cygwin uses the slower SAM / AD dynamic integration. For most users, and especially for my test environment, this is not required, so I tried to follow these steps to use only file-based users / groups. This led to significant acceleration (about 6 times).

But there is a strange thing. It works only if I went to the server at least once through RDP. Otherwise, back to slows-ville.

Since this is not very useful for automated testing, I tried to find out what exactly is causing the problem. The most likely candidate is that the first RDP connection (that is, without a WinRM / eyeless session) fills in some part of the user profile, that the headless sessions do not load, but I cannot understand that. I tried calling LoadUserProfile , which should create a profile that it does not exist, but that is not enough.

Any ideas on which part of this I am missing?

+8
windows winapi msys2 cygwin winrm
source share

No one has answered this question yet.

See similar questions:

3
Call win32 CreateProfile () from C # managed code

or similar:

578
How to disable - restart - log out of Windows through the bat file?
66
How to add multiple machines to the list of trusted hosts using winrm
7
Hide user input
4
How to remotely edit text in Windows
2
Conflicts of Cygwin and Windows; using both Windows and cygwin Python
one
Available for Windows: Unable to access a Windows machine through WinRM
one
How to run msysgit from Cygwin?
one
The PHP script executes several times when it is run only once on the command line. Only the output of the first run is sent to stdout
0
Is there a way for a chef's recipe to continue working after a reboot (Windows)?
0
How to execute PowerShell through WinRM

All Articles