Skip to content

Obito-404/Collecting-computer-information

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🖥️ Collecting computer information

【English | Chinese

A toolset designed to automatically gather hardware and software information from computers in an Active Directory (AD) domain. It is built using PowerShell and Python.

  • AD Group Policy Management deploys scripts that automatically write data into a specified folder path each time a user logs in.
  • Exporting all user information from the AD domain (this step is optional! It's only used for matching users to hostnames and can include additional AD-exported fields such as Display Name, Email, Telephone Number).
  • Python combines the collected computer information and user data, adding or updating it in the database.

📋 Steps

Here are the steps for using this tool:

  1. Create a shared folder accessible to all users and grant Everyone read and write permissions.
  2. Add Computer Information.ps1 to the Group Policy Management Organizational Unit (OU). Whenever a user logs in, their computer will automatically write its hardware and software information in JSON format to the specified path that was created in step 1.

 Out-File -Encoding "UTF8" -FilePath \\保存文件的路径\$env:COMPUTERNAME.json

⚠️ Note: Modify the variables in the script to collect hardware or software information based on your specific requirements.

  1. Schedule the execution of Get ADuser.ps1 to export all domain users to a specified path.
  2. Create a database and match the corresponding fields as follows. Schedule the execution of 'Computer-User.py' to update the information for each computer obtained from 'Get ADuser'.
 query = "UPDATE ComputerInfo SET [User] = ?, OS = ?, OSVersion = ?, IPAddress = ?, DNS = ?, MACAddress = ?, SerialNumber = ?, Admin = ?, CPU = ?, CPUCaption = ?, CPUSocket = ?, MemorySize = ?, Disk = ?, DiskSize = ?, VideoController = ?, Checksoftware = ?, Software = ? , Updatetime =? WHERE Computer = ?"

⚠️ Note: Set up all tasks as scheduled tasks to automatically update computer information and user information to the database every day."

🛠️ Requirements

  • Windows operating system
  • PowerShell
  • Python
  • Pyodbc (Python library for connecting to SQL database)

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

ad域中部署自动收集电脑信息

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published