This guide describes how to collect a machine inventory from AD using PowerShell.
Requirements:
PowerShell is really a game-changer to automate repetitive or time-consuming processes, isn't it? We have a PowerShell script to generate a report on SharePoint content database size growth – Storage Report; we used to run it on the first day of every month on the SharePoint server to generate the report. Combining the flexibility of PowerShell with the scheduling capabilities of Task Scheduler opens up a world of possibilities for automating repetitive tasks and running maintenance scripts. You can automate PowerShell scripts with the Windows task scheduler.
To schedule a SharePoint PowerShell script to run in Task Scheduler, ensure you have the necessary PowerShell modules, such as “Microsoft.SharePoint.PowerShell” or PnP.PowerShell is installed on the machine first. Then proceed with the below steps to create a scheduled task for the SharePoint PowerShell script: Task Scheduler is a built-in utility in Windows that allows you to create and manage automated tasks. These tasks can be triggered based on various criteria, such as a specific time, system startup, or even a particular event. Here is how to run a PowerShell script in the task scheduler:
Important: You must specify a value for the Start-in field, even though it's optional. This is because if no value is specified, PowerShell exports the output in the “C:\Windows\System32” directory.
The output of the inventory will be formatted yo JSON and appended to the active responses log file in the agent.
The Wazuh manager already has detection rules to classify these events.
Grafana, under the EDR Dashboards section, “EDR – AD INVENTORY”, will display the inventory collected.
Was this article helpfu?
Thank you for voting
You are related to multiple companies. Please select the company you wish to login as.