A Python script to connect to an SMB share, traverse its directories, and generate a CSV report of empty folders and files exceeding 500MB.
- Python 3.6+
- pysmb
- Clone this repository
- Create and Activate a Virtual Environment
Windows:
python -m venv venv
venv\Scripts\activateLinux/macOS:
python -m venv venv
source venv/bin/activateThen install dependencies:
pip install -r requirements.txtRun the script from the command line with the required arguments:
python main.py --username <USERNAME> --password <PASSWORD> --ip <SMB_SERVER_IP> --machine_name <CLIENT_MACHINE_NAME> --server_name <SMB_SERVER_NAME> --share <SHARE_NAME>After execution, results will be saved to output.csv and printed to the console.
--username(required): SMB username.--password(required): SMB password.--ip(required): IP address of the SMB server.--machine_name(required): Client machine name.--server_name(required): SMB server name.--share(required): Share name on the server.