microsoft / Microsoft365DSC

Manages, configures, extracts and monitors Microsoft 365 tenant configurations
https://aka.ms/M365DSC
MIT License
1.62k stars 501 forks source link

Missing M365DSC Event Log Journal #3734

Open icedkopi4me opened 1 year ago

icedkopi4me commented 1 year ago

Hi, I've completed the steps for deploying the configuration and I would like to monitor for drifts. However, following the guide, I was unable to find M365DSC log journal under the Event Viewer. Please kindly advise. Thanks!

andikrueger commented 1 year ago

Could you try to call into Add-M365DSCEvent manually and check, if there are any exceptions thrown?

https://github.com/microsoft/Microsoft365DSC/blob/57abaff4143860fb4ceb375b840b1ce7283d99b7/Modules/Microsoft365DSC/Modules/M365DSCLogEngine.psm1#L159C10-L159C26

Please use the Verbose switch for the function to get further information.

dhuntingopr commented 5 months ago

I can confirm this issue. Using v1.24.515.2. I ran the command as suggested by @andikrueger and nothing shows up in the event viewer. I will also add that there were no exceptions thrown

andikrueger commented 5 months ago

Could you please share details about your environment? Thanks!

dhuntingopr commented 5 months ago

Actually, I just rebooted my machine and now see the event logs I added using the cmdlet. I am running Windows 10 Enterprise in a virtual machine on KVM. I see the test events that I added but haven't yet seen the configuration drift as expected. Since I just rebooted, it might take 15-30 minutes for DSC to query the changes

dhuntingopr commented 5 months ago

Also, I am running this against a GCC G5 tenant if that is helpful. My configuration is a simple test with a single AADAdministrativeUnit in order to perform a POC of the functionality

dhuntingopr commented 5 months ago

Running the command "Get-DscConfiguration" returns this: Get-DscConfiguration : The PowerShell DSC resource returned results that are not valid from Get-TargetResource. The Verbose key is not a valid property in the corresponding DSC resource schema file. The results from Get-TargetResource must be in a Hashtable format. The keys in the Hashtable must be the same as the properties in the corresponding DSC resource schema file. At line:1 char:1

ricmestre commented 5 months ago

That looks like Verbose parameter needs to be removed from some of the resources you have in your blueprint, this sometimes causes problems so could you please share a redacted blueprint in order to troubleshoot it?

If we can identify which resource is causing this then it would be just a matter of removing Verbose from Get/Set/Test just like it was already done for other resource were it caused the same problem.

dhuntingopr commented 5 months ago

Everything is working as expected now. Probably just user error :) Thanks for your support!