Windows Containers


Get-EventLog inside container - InvalidOperationException


Hi,
I have a "Windows Container" (thus, not an Hyper-V one) based on WindowsServerCore, running inside TP5.
I am trying to install MSVCMON.exe there and not succeeding. I am trying to diagnose what went wrong via the Powershell command "Get-EventLog Application", and am getting the following error:
PS C:\> get-eventlog Application
get-eventlog : Cannot open log Application on machine .. Windows has not provided an error code.
At line:1 char:1
+ get-eventlog Application
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-EventLog],
InvalidOperationException
+ FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.PowerShell.Commands.GetEventLogCommand
On some forums I have read that it can be a permissions issue. When I check who is the current user, via "WHOAMI", I get:
PS C:\> whoami
user manager\containeradministrator
The container has other user accounts, but I don't know how to run any command under one of those accounts:
PS C:\> Get-WmiObject -Class Win32_UserAccount -Filter "LocalAccount='True'"
AccountType : 512
Caption : 81B92A246E98\Administrator
Domain : 81B92A246E98
SID : S-1-5-21-688057908-1433419415-1178475910-500
FullName :
Name : Administrator
AccountType : 512
Caption : 81B92A246E98\DefaultAccount
Domain : 81B92A246E98
SID : S-1-5-21-688057908-1433419415-1178475910-503
FullName :
Name : DefaultAccount
AccountType : 512
Caption : 81B92A246E98\Guest
Domain : 81B92A246E98
SID : S-1-5-21-688057908-1433419415-1178475910-501
FullName :
Name : Guest
Does anyone know why Get-EventLog is not working?Does anyone know where the user "user manager\containeradministrator"
is coming from?Does anyone know if it is possible to run commands in the container with different credentials? (Or, what is the password of the Administrator user above?)
Thanks in advance,
Eduardo
Thanks for reporting this issue. I think I may have an idea of what's going on. Can you try adding this step in the Dockerfile you're using to build your container?
RUN powershell.exe -command Set-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\WMI\Autologger\EventLog-Application Start 1
Thanks for reporting this issue. I think I may have an idea of what's going on. Can you try adding this step in the Dockerfile you're using to build your container?
RUN powershell.exe -command Set-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\WMI\Autologger\EventLog-Application Start 1
I had the same issue as the OP, I had reported here https://github.com/Microsoft/Virtualization-Documentation/issues/238
Adding the suggested line solves the problem. Thanks!
Works perfectly, thanks

Related Links

HTTP/2 support in WindowsServerCore image?
PATH Variable Gone
Running ASP .NET Website inside Windows container
Not able to PSRemote into a container (TP4)
TP4 CONTAINER ERROR: failed to initialize: The driver was not loaded because it failed its initialization call. (0x80070287).
Trouble trying to get a ASP .NET Web API project to work on microsoft/iis based docker container.
.NET framework 3.5 or earlier
Is there any tool for Windows Container cluster deployment ? such as : fig / docker compose ...etc on linux platform
Are there known WinNAT issues with container-to-host communication?
Docker microsoft/iis image
Cannot enable printers for windowsservercore container
Docker container - users other than containeradministrator in TP5?
Install-WindowsFeature : The given key was not present in the dictionary.
How to run commands as a specific local user inside Windows Docker container
Docker : error while trying to run first image
DOT NET APPLICATION DEPLOYMENT on WINDOWS 2016 CONTAINERS

Categories

MSDN
Using Forums
Game Development
Apps for Office and Sh...
Dynamics
ScriptJunkie
Project Server
Microsoft Atlas API: D...
Unified Communications
Archived Forums Visual...
In-App Advertising (Ad...
Windows Phone Preview ...
Open source Developmen...
Off-Topic Posts (Do No...
Testing with Visual St...
Dev Center App
Application Compatibil...
Windows Desktop Develo...
Windows Desktop Search...
Outlook for Developers
SharePoint 2013 - Gene...
SharePoint 2013 - Deve...
SharePoint 2010 - Usin...
SharePoint Legacy Vers...
Azure Media Services
Azure BizTalk Services
Azure Scheduler
Azure CDN
Azure DevTest Labs
Windows Presentation F...
Visual Studio Visualiz...
Team Foundation Server...
Visual FoxPro General
Architecture General
BizTalk ESB Toolkit
Microsoft Live Labs Volta
Small Basic
SyncFx - Microsoft Syn...
Visual Studio Smart De...
Visual Studio Smart De...
SQL Server Tools
SQL Server Replication
Microsoft Drivers for ...
Windows Embedded Compa...
SQL Server 2012 Setup ...
SQL Server 2012 Report...
Windows Forms Data Con...
CRM
Bing Maps General
Visio General Question...
Exchange Server Develo...
Getting Started with S...
MVVM / ViewModel Patte...
Expression Web and Sup...
Retired SharePoint Exc...
Archived: Software Tes...
Building Windows Store...
Building Windows Store...
App Producer (archived)
CHESS – Find and Repro...
Commerce Server 2002 a...
Core Coding Experience...
Dryad, DSC, and DryadL...
Feedback for Visual Ba...
Game Technologies: Dir...
LightSwitch in Visual ...
Microsoft Security Dev...
Microsoft "Data Explor...
Project Codename:  Jasper
Search Server: Develop...
Search Server: Frequen...
Silverlight (formerly ...
SQL Server 2014 Data Q...
SQL Server 2014 Analys...
Team Foundation Server...
Visual Basic 2008 (Pre...
Visual Basic IDE
Visual Studio Database...
Visual Studio LightSwi...
Visual Studio Web Perf...
Visual Studio WPF/SL D...
Visual Studio Online "...
Web Gadget Development
Windows CardSpace ('In...
Windows SideShow Devel...
Working with Data and ...
Building Windows Store...
Building Windows Store...
Windows Containers

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile