moby: Windows Server Container: System.DirectoryServices.AccountManagement.UserPrincipal not working

The FindByIdentity method on the System.DirectoryServices.AccountManagement.UserPrincipal object does not work inside a Windows Server Container. It throws an exception stating that the Server service is not started. Trying to start it also fails with an exception. See reproduction details below.

Is this a bug in the Windows Server 2016 Container feature or is this part of the .Net Framework not supported?

Output of docker version:

Client:
 Version:      1.12.0
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   8eab29e
 Built:        Thu Jul 28 23:54:00 2016
 OS/Arch:      windows/amd64

Server:
 Version:      1.12.0
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   8eab29e
 Built:        Thu Jul 28 23:54:00 2016
 OS/Arch:      windows/amd64

Output of docker info:

Containers: 8
 Running: 0
 Paused: 0
 Stopped: 8
Images: 5
Server Version: 1.12.0
Storage Driver: windowsfilter
 Windows:
Logging Driver: json-file
Plugins:
 Volume: local
 Network: overlay null nat
Swarm: inactive
Security Options:
Kernel Version: 10.0 14300 (14300.1000.amd64fre.rs1_release_svc.160324-1723)
Operating System: Windows Server 2016 Standard Technical Preview 5
OSType: windows
Architecture: x86_64
CPUs: 4
Total Memory: 4 GiB
Name: vm-mh-w2k16
ID: YS7T:BZEP:I3VG:I3NY:KVB7:XH6P:SAJ5:J7SB:IEZC:HHWL:45TC:E2YR
Docker Root Dir: C:\ProgramData\docker
Debug Mode (client): false
Debug Mode (server): false
Username: mh2015
Registry: https://index.docker.io/v1/
Insecure Registries:
 127.0.0.0/8

Additional environment details (AWS, VirtualBox, physical, etc.):

Windows Server 2016 TP5

Steps to reproduce the issue:

  1. clone https://github.com/martinh2011/uperrorrepro
  2. docker build -t uperrorrepro
  3. docker run -it uperrorrepro

Describe the results you received: The System.DirectoryServices.AccountManagement.UserPrincipal.FindByIdentity API call throws an exception

Describe the results you expected: The System.DirectoryServices.AccountManagement.UserPrincipal.FindByIdentity API returns a UserPrincipal object

Additional information you deem important (e.g. issue happens only occasionally): If you do the same API call on a plain Windows Server 2016 Core, i.e. not inside a container this works. Trying to start the server service like this:

  1. docker run -it microsoft/windowsservercore powershell.exe
  2. In powershell inside the container: start-service server

fails with

Failed to start service ‘server (lanmanserver’ Eventlog does not have anything useful, just

The Server service terminated with the following error: %%2

About this issue

  • Original URL
  • State: open
  • Created 8 years ago
  • Reactions: 4
  • Comments: 15 (4 by maintainers)

Most upvoted comments

Has the limitation of not being to run the “server” (LanmanServer) service in Windows Docker containers been documented? Are there any plans to support this service in the near future?