This PowerShell script collects detailed system information, including OS version, currently running tasks and services, user and group info, domain details, storage information, and generates a report in text format. Optionally, it can compress the report into a ZIP file for easier sharing.
- This script requires you to run PowerShell.
- You may need to run PowerShell as an administrator, especially for system and domain-related queries.
Before running the script, you must set the execution policy for the current session to allow script execution. Open a PowerShell window and execute the following command:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
This command sets the execution policy to RemoteSigned
, allowing you to run scripts that you create locally or scripts that are signed by a trusted publisher.
-
Open PowerShell:
- Press
Win + X
, then selectWindows PowerShell (Admin)
.
- Press
-
Navigate to the Script Directory: Change the directory to where the script is located. For example:
cd "C:\Path\To\Windows-System-Audit\"
-
Run the Script: Execute the script by typing its name:
.\winsysaudit.ps1
-
Follow Prompts: The script will prompt you for the output location for the report. You can either specify a file path or leave it blank to use the default location.
-
Review the Output: After the script executes, it will generate a report with system information, which can be found at the specified output location.
- System Information: Captures OS version and system info using
systeminfo
. - Tasklists and Services: Gathers currently running tasks and associated services.
- User and Group Information: Provides details about local users and administrators.
- Domain Information: If applicable, retrieves domain info and group memberships.
- Storage Information: Lists drives, current SMB shares, and searches for specific file types (e.g., PDF).
- Compression: Optionally compress the report into a ZIP file.
Any errors encountered during the execution of the script will be logged. At the end of the script, a consolidated error log will be added to the output report for review.
- Running the script may require administrative privileges for certain operations.
- Always check the output directory to ensure the report is saved as expected.