Google-Drive-BULK-Access-remover
Automatically removes specified email addresses from ALL Google Drive files accessible by your account. Because manually removing ex-employees from hundreds of files is not how you want to spend your Friday evening.
AI Summary
Google Drive BULK Access Remover
Bulk removes specified email access from Google Drive files.
Target Users
Intermediate GAS users managing bulk removal of ex-employee access from Drive files.
Problems Solved
Ex-employee emails remain in permissions across hundreds of Drive files, making manual removal time-consuming and error-prone.
Script ID
- In GAS Editor: Click "Libraries +" → Paste into "Script ID" field → Click "Look up"
- "Google-Drive-BULK-Access-remover" will appear in the search results
- Select the latest version (highest number) from "Version" dropdown
- Click "Add"
Tags
Bulk Processing
Processes multiple emails in one run using Drive API queries to find and remove access from shared files.
Auto-Resume
Manages 6-min limit with batches, saves state for auto-resume across multiple script runs.
Reporting
Provides email/file-type reports with success counts, errors, and processed file lists.
Main Functions
| Function | Description |
|---|---|
| startEmailCleanup | Starts bulk email cleanup. |
| runDiagnostics | Runs full system diagnostics. |
| checkStatus | Checks process status. |
Examples
Start Cleanup
/**
* クリーンアップ開始
* ・ターゲットメール設定: const TARGET_EMAILS = ['former.employee@company.com', 'freelancer@example.com'];
* ・診断実行前確認: runDiagnostics();
* ・メイン処理起動: startEmailCleanup();
*/
function startCleanup() {
const TARGET_EMAILS = [
'former.employee@company.com',
'freelancer@example.com'
];
runDiagnostics();
startEmailCleanup();
}Check Status
/**
* 処理状況確認
* ・現在状況表示: checkStatus();
* ・緊急停止: stopProcess();
* ・CONFIG調整例: const CONFIG = { BATCH_SIZE: 15 };
*/
function monitorProgress() {
checkStatus();
// CONFIG = { BATCH_SIZE: 15, MAX_EXECUTION_TIME: 280000 };
// stopProcess(); // if needed
}Run Diagnostics
/**
* 診断テスト
* ・Drive API接続確認: testDriveV3Access();
* ・メール検索テスト: testEmailSearch();
* ・全体診断実行: runDiagnostics();
*/
function testSetup() {
testDriveV3Access();
testEmailSearch();
runDiagnostics();
}