You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求助:能否通过MS Teams、Azure、OneDrive获取状态?无需终端额外软件

Solutions to Retrieve User Status via Microsoft Services (No Endpoint Software Required)

Hey Thorsten, sorry to hear you've hit roadblocks with basic Microsoft Graph queries for login records and token status. Let's break down viable alternatives using Teams, Azure, OneDrive, and other cloud-native Microsoft services that fit your broader business scenarios—no extra software installs needed on end-user devices.

Azure AD-Based Options

  • Azure AD Sign-in Logs: This is your go-to for tracking user activity across nearly all Microsoft cloud services (Teams, OneDrive, Azure Portal, etc.). You can access these via:
    • The Microsoft Graph API with the GET /auditLogs/signIns endpoint (double-check you have the AuditLog.Read.All application or delegated permission enabled—this is likely why your earlier attempts failed if permissions were missing).
    • The Azure Portal's Azure Active Directory > Monitoring > Sign-ins section, where you can filter logs by user, service, or date range.
  • Azure Monitor Logs: If you need to correlate activity across multiple Azure resources (e.g., VM logins, Azure function access) and Microsoft 365 services, set up diagnostic settings to route logs to a Log Analytics workspace. You can then run Kusto queries like:
    SigninLogs
    | where UserPrincipalName == "user@domain.com"
    | sort by TimeGenerated desc
    | take 10
    
    to pull recent sign-ins or cross-service activity.

Teams-Specific Status Tracking

  • Real-Time Presence Status: If you need to know if a user is actively available in Teams, use the Microsoft Graph GET /users/{user-id}/presence endpoint. This returns statuses like Available, Away, or DoNotDisturb in real time. You'll need the Presence.Read.All application permission for this, and it works entirely via cloud APIs—no client-side setup required.
  • Teams Activity Reports: In the Microsoft Teams Admin Center, navigate to Analytics & reports > Usage reports to access aggregated data on user activity (e.g., last time a user sent a message, joined a meeting). These pre-built reports require no extra configuration.

OneDrive & File Access Status

  • OneDrive Last Access & Activity: Use the Microsoft Graph API to check a user's OneDrive activity:
    • Get the last modified time of their root folder with GET /users/{user-id}/drive/root (look for the lastModifiedDateTime field).
    • Query directory audit logs via GET /auditLogs/directoryAudits to filter for OneDrive-specific actions (e.g., file access, modifications).
  • OneDrive Usage Reports: The Microsoft 365 Admin Center's Reports > Usage > OneDrive section shows when users last accessed their OneDrive, storage usage, and other key metrics—all cloud-based.

Quick Troubleshooting Tip

If your earlier Graph attempts failed, it's almost certainly a permission issue. Make sure your app registration has the correct application-level permissions (not just delegated) and that you've granted admin consent for them.

内容的提问来源于stack exchange,提问作者Thorsten

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 10:23:37