question

matitdob-1938 avatar image
0 Votes"
matitdob-1938 asked DanielZhang-MSFT edited

C# EventLogSession Local Admin

I have a problem how to use the code below for the admin of the local remote computer. Typing ".", "" Or "computer name" as domain doesn't help. The omission results in a syntax error.


EventLogSession session = new EventLogSession(
"ComputerName", // Remote Computer
"Domain", //Domain
"Admin", // Username
pw,
SessionAuthentication.Default);


dotnet-csharp
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

DanielZhang-MSFT avatar image
0 Votes"
DanielZhang-MSFT answered DanielZhang-MSFT edited

Hi matitdob-1938,
If you query events from a remote computer, you need to specify the name and domain of the remote computer, as well as the user name and password used to connect to the remote computer. Instead of Typing ".", "" Or "computer name" as Domain.
More details you can refer to this document.
In addition, you need to be ensure that the specified user has local administrator rights on the PC queried by EventLogSession.
Best Regards,
Daniel Zhang


If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.