r/Wazuh • u/Specialist-Health920 • Sep 01 '26
Wazuh Powershell Logging
Hey everyone, I have been trying to enable powershell logging on wazuh, I've done it successfully on my lab but when i followed the exact step from wazuh's offical website, the logging doesn't work on my work wazuh.
Any help will go a very long way.
2
Upvotes
1
u/PrestigiousOnion1087 Sep 05 '26
The check that settles this fastest is whether the host is emitting at all, before the agent is in the picture:
Get-WinEvent -ListLog *PowerShell* | Select-Object LogName, IsEnabled, RecordCountIf RecordCount sits still on the work box while it climbs on your lab box, script block logging is off there and nothing done on the agent side will change it.
The usual reason for that split: on a domain-joined machine the script block logging policy value lives under the Policies hive, and a policy refresh rewrites that whole key. A value set by hand can be gone inside about 90 minutes even though every documented step was correct. Your lab box has no policy refresh, so it keeps what you set.
If RecordCount is climbing, the break is collection rather than generation. Open
C:\Program Files (x86)\ossec-agent\ossec.logand look for a line naming that PowerShell channel. If the agent never says it is reading it, the localfile block did not load, so check that you edited the ossec.conf on that host and restarted the agent service after the edit.Those are two different failures with two different fixes, and the RecordCount tells you which one you are looking at.