Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker connecting to Exchange PowerShell operations is extremely slow #21532

Open
5 tasks done
DSWANG5566 opened this issue Apr 25, 2024 · 0 comments
Open
5 tasks done
Labels
Needs-Triage The issue is new and needs to be triaged by a work group.

Comments

@DSWANG5566
Copy link

DSWANG5566 commented Apr 25, 2024

Prerequisites

Steps to reproduce

I have tested
1.Windows PowerShell speed is OK.
2.Windows PowerShell Core speed is OK.
3.The speed of Docker Container PowerShell Core is slow, and every operation after connecting to Exchange is slow as well. Each response takes more than 3 seconds to wait.
The source is an official image from mcr.microsoft.com/powershell, or it can be installed manually into the container. Below is the Dockerfile:
`
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
RUN apt-get update
&& apt-get install -y wget gnupg apt-transport-https curl
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-bullseye-prod bullseye main" > /etc/apt/sources.list.d/microsoft.list'
RUN apt update && apt install -y powershell netbase
RUN sh -c "yes | pwsh -Command 'Install-Module -Name PSWSMan'"
RUN pwsh -Command 'Install-WSMan'
RUN cp /opt/microsoft/powershell/7/libpsrpclient.so /opt/microsoft/powershell/7/libmi.so /usr/lib
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["NuGet.config", "."]
COPY ["/IdentityManagerUI/IdentityManagerUI.csproj", "IdentityManagerUI/"]
COPY ["/CommonClassLibrary/CommonClassLibrary.csproj", "CommonClassLibrary/"]
COPY ["Management/Management.csproj", "Management/"]
RUN dotnet restore "Management/Management.csproj"
COPY . .
WORKDIR "/src/Management"
RUN dotnet build "Management.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Management.csproj" -c Release -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Management.dll"]
`

Expected behavior

PS /> $sec_password = ConvertTo-SecureString "xxxxxx" -AsPlainText -Force;
PS />  $credential = New-Object System.Management.Automation.PSCredential("xxxx@xxxxxx.COM",$sec_password);
PS /> enter-pssession -Credential $credential -ConfigurationName Microsoft.Exchange -Authentication Kerberos -ConnectionUri http://xxxxxx.xxxx.com/PowerShell/
[xxxxxx.xxxx.com]: PS>Get-mailbox xxxx   <=== It starts to slow down from here.

Name                      Alias                ServerName       ProhibitSendQuota
----                      -----                ----------       -----------------
xxxx                   xxxx              xxxx          190 MB (199,229,440 bytes)


[xxxxxx.xxxx.com]: PS>

Actual behavior

N/A

Error details

No response

Environment data

Name                           Value
----                           -----
PSVersion                      7.4.2
PSEdition                      Core
GitCommitId                    7.4.2
OS                             Ubuntu 22.04.4 LTS
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

@DSWANG5566 DSWANG5566 added the Needs-Triage The issue is new and needs to be triaged by a work group. label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Triage The issue is new and needs to be triaged by a work group.
Projects
None yet
Development

No branches or pull requests

1 participant