Bulk User Email Update

Customer Support Tool

CSV-driven automation tool for updating email addresses of multiple New Relic users at scale. The most impactful script built for New Relic Support operations, saving hours of manual work for customers migrating domains or correcting provisioning errors.

Key Features

  • Batch processing from CSV (ID and email columns)
  • New Relic User Management API via GraphQL mutations
  • Input validation with error handling
  • Individual success/failure reporting per user
  • Simple interactive prompts for API key and CSV path
  • File existence and format validation

Tech Stack

Python GraphQL New Relic NerdGraph API CSV Processing

Core Implementation

# Loop through CSV and update each user with open(csv_path, newline='') as csvfile: reader = csv.DictReader(csvfile) for row in reader: user_id = row['ID'] new_email = row['Email'] # GraphQL mutation payload = { "query": """mutation { userManagementUpdateUser( updateUserOptions: { id: "" + user_id + ", email: "" + new_email + " } ) { user { id email } } }""" } response = requests.post(api_url, headers=headers, data=json.dumps(payload)) if "errors" in response.json(): print("Error:", response.json()["errors"]) else: print(f"User {user_id} updated successfully")

Impact

Most impactful script for New Relic Support operations. Regularly used for customer migrations (domain changes, company acquisitions) and fixing bulk provisioning errors. What would take hours of manual UI clicks now completes in minutes. Has been used for customers with hundreds of users requiring email updates.

SCIM User Delete Tool

Interactive CLI

Interactive command-line tool for New Relic SCIM user management. Automates the lookup and deletion workflow with built-in safety confirmations and user-friendly prompts. Critical for Support operations dealing with SCIM-provisioned users.

Key Features

  • Email-based SCIM user lookup via filtering API
  • Interactive confirmation before deletion
  • Continuous workflow (delete multiple users in one session)
  • Friendly error messages and user guidance
  • Authentication domain awareness
  • Invalid input handling with retry prompts

Tech Stack

Python SCIM API REST Bearer Token Auth

Workflow Logic

# Step 1: Lookup user by email response = requests.get( 'https://scim-provisioning.service.newrelic.com/scim/v2/Users', headers={'Authorization': f'Bearer {api_key}'}, params={'filter': f'userName eq "{email}"'} ) user_id = response.json()['Resources'][0]['id'] print(f"User ID: {user_id}") # Step 2: Confirm deletion choice = input("Delete this user? y/n: ").lower() if choice == 'y': # Step 3: Execute deletion delete_response = requests.delete( f'https://scim-provisioning.service.newrelic.com/scim/v2/Users/{user_id}', headers={'Authorization': f'Bearer {api_key}'} ) if delete_response.status_code == 204: print("User deleted successfully!") # Step 4: Continue or exit choice = input("Delete another user? y/n: ")

Impact

Simplifies SCIM user deletion which otherwise requires multiple API calls and manual SCIM ID lookup. Interactive design prevents accidental deletions while maintaining efficiency. Used by Support engineers for offboarding, troubleshooting auth domains, and cleaning up test users. Friendly prompts ("Okie dokie! Until next time!!") make technical operations more approachable.

Out of Office Calendar Bot

Automation

Google Apps Script that automatically detects team members who are out of office by scanning a shared Google Calendar and sends daily notifications to Slack. Filters by keywords, team members, and all-day events for accuracy.

Key Features

  • Automated daily scanning via time-based triggers
  • Keyword detection (OOO, Vacation, PTO, Holiday, etc.)
  • Team member filtering by email address
  • All-day event validation (ignores partial-day events)
  • Individual Slack messages per OOO user via webhooks
  • Resource/group calendar filtering (excludes meeting rooms)
  • Test mode for webhook validation

Tech Stack

Google Apps Script Google Calendar API Slack Webhooks JavaScript

Core Logic

// Fetch today's calendar events const events = Calendar.Events.list(CALENDAR_ID, { timeMin: todayStart.toISOString(), timeMax: todayEnd.toISOString(), singleEvents: true }); // Filter for OOO keywords and all-day events events.items.forEach(event => { const isOoo = OOO_KEYWORDS.some(keyword => event.summary.toLowerCase().includes(keyword) ); const isAllDay = event.start.date && !event.start.dateTime; if (isOoo && isAllDay) { sendSlackMessage(event.creator.email); } });

Impact

Eliminates manual checking of team calendars. Proactively notifies the team channel each morning of who's out, improving work distribution and reducing surprise absences.