A comprehensive web-based tool for monitoring Microsoft Teams user activity and detecting retired & inactive users in your business / organization.
- Check individual user's Teams presence and activity status
- Real-time presence detection (Available, Away, Busy, Offline)
- Last activity timestamp tracking
- History of recent lookups
- Export results to clipboard
- Advanced scoring algorithm to identify retired employees.
- Single user or bulk analysis (up to 50 users)
- Multi-factor retirement risk assessment including:
- Account status (enabled/disabled)
- Last sign-in activity
- Teams presence and activity
- License assignments
- Group memberships
- Node.js 14.0+
- Microsoft 365 Organization User with Global Reader permissions OR
- Microsoft Graph API access with appropriate permissions
git clone https://github.com/yourusername/TeamsActivityMonitor.git
cd TeamsActivityMonitornpm install
### 3. Configure Environment Variables
Copy the `.env.example` file to `.env`:
```bash
cp .env.example .envEdit the .env file and add your Microsoft User credentials:
MICROSOFT_CLIENT_ID=your_client_id_here
MICROSOFT_CLIENT_SECRET=your_client_secret_here
MICROSOFT_TENANT_ID=your_tenant_id_herenpm run dev
# or
yarn devOpen http://localhost:3000 in your browser.
Go to admin.microsoft.com and sign in.
Left menu: Show all → Roles.
Search Global Reader, open it → Assigned admins. Look for your name.
Or: Users → Active users → open your user → Account tab → Roles → see Admin center access list for Global Reader.
Tip: If you can’t open the admin center, you likely don’t have any admin role (including Global Reader).
- Go to Azure Portal
- Navigate to Azure Active Directory → App registrations
- Click New registration
- Configure your app:
- Name: Teams Activity Monitor
- Supported account types: Accounts in this organizational directory only
- Redirect URI: Leave blank for now
- Click Register
- In your app registration, go to API permissions
- Click Add a permission → Microsoft Graph
- Choose Application permissions
- Add these permissions:
User.Read.All- Read all users' profilesPresence.Read.All- Read presence informationReports.Read.All- Read usage reportsDirectory.Read.All- Read directory data
- Click Grant admin consent (requires admin privileges)
- Go to Certificates & secrets
- Click New client secret
- Add a description and select expiry period
- Click Add
- Copy the secret value immediately (it won't be shown again)
From the app overview page, copy:
- Application (client) ID →
MICROSOFT_CLIENT_ID - Directory (tenant) ID →
MICROSOFT_TENANT_ID - Your copied secret →
MICROSOFT_CLIENT_SECRET
- Navigate to
/powershell-guide - Follow the step-by-step instructions
- Copy code snippets as needed
- Use for advanced Teams management tasks
The tool uses a weighted scoring system to assess retirement risk:
| Indicator | Weight | Description |
|---|---|---|
| Account Status | 30% | Checks if account is disabled or blocked |
| Last Sign-in | 25% | Days since last authentication |
| Teams Activity | 20% | Recent Teams presence and activity |
| License Status | 15% | Active licenses and usage |
| Group Membership | 10% | Active directory and security groups |
- Frontend: NextJS 14, React 18, TailwindCSS
- API Integration: Microsoft Graph API