{"product_id":"automate-entra-b2b-guest-cleanup-with-n8n-ms-graph","title":"Automate Entra B2B Guest Cleanup with n8n \u0026 MS Graph","description":"\u003ch3\u003eStreamline B2B Guest Account Management with n8n \u0026amp; Microsoft Graph\u003c\/h3\u003e\n\u003cp\u003eEffortlessly keep your Entra ID (Azure AD) clean by automating the inactivity cleanup of B2B guest accounts using the robust capabilities of n8n and Microsoft Graph. This meticulously designed workflow operates weekly to identify and manage dormant accounts, ensuring your directory remains secure and clutter-free.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eTriggers every Monday at 08:00 (server time) to scan Entra ID for B2B guest accounts using Microsoft Graph.\u003c\/li\u003e\n  \u003cli\u003eRetrieves all guest user accounts, complete with sign-in activity metadata through pagination.\u003c\/li\u003e\n  \u003cli\u003eFilters for guest accounts whose last sign-in or creation date surpasses a predefined inactivity threshold.\u003c\/li\u003e\n  \u003cli\u003eIf no inactive accounts are detected, it sends a completion update to a Microsoft Teams channel and halts further actions.\u003c\/li\u003e\n  \u003cli\u003eUpon identifying inactive accounts, the workflow notifies each account's sponsor in Microsoft Teams, tagging their information for transparency.\u003c\/li\u003e\n  \u003cli\u003eAfter a 72-hour grace period, it diligently deletes the inactive accounts via Microsoft Graph.\u003c\/li\u003e\n  \u003cli\u003eLogs each successful deletion to a SharePoint list and alerts Microsoft Teams if any deletions fail, ensuring continuous processing of other accounts.\u003c\/li\u003e\n  \u003cli\u003eConcludes with a comprehensive run summary posted to Microsoft Teams, enhancing oversight and control.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eOptimize security by automatically purging inactive guest accounts, reducing risks associated with unused access permissions.\u003c\/li\u003e\n  \u003cli\u003eFacilitate seamless guest account management for organizations frequently collaborating with external partners and clients.\u003c\/li\u003e\n  \u003cli\u003eEnhance operational efficiency by automating routine directory maintenance tasks, freeing up time for more strategic IT initiatives.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eIntegrations\/Nodex used:\u003c\/strong\u003e Microsoft Graph (OAuth2 credentials), Microsoft Teams, SharePoint\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003en8n nodes implemented:\u003c\/strong\u003e If, Set, Code, No Op, Wait, Merge\u003c\/li\u003e\n  \u003cli\u003eEnsure comprehensive permissions are established for reading user data, sign-in activity, user management, user deletion, and audit logging to SharePoint.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45558504161459,"sku":"N8N-16118","price":30.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/ptN1OKlFKEs9fuHelb2U_51fe0a045b41435c9039c70249e43085.jpg?v=1780650534","url":"https:\/\/buyflowscripts.com\/products\/automate-entra-b2b-guest-cleanup-with-n8n-ms-graph","provider":"N8N Commerce","version":"1.0","type":"link"}