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

能否在Microsoft Intune(Endpoint Manager)中批量创建100台虚拟设备用于MS Intune Graph API分页测试?

Creating Virtual Devices in Microsoft Intune for Pagination Testing

Absolutely! You can create simulated virtual devices in Microsoft Intune specifically for testing pagination with the Graph API—no physical devices required. Here are the most straightforward methods to pull this off:

Method 1: Batch Create Simulated Devices with PowerShell

This is the fastest way to generate 100+ test devices. You’ll use the Microsoft Graph PowerShell module to automate the creation:

  1. Install the required module (if you haven’t already):

    Install-Module Microsoft.Graph.Intune -Force -AllowClobber
    
  2. Connect to Microsoft Graph with the necessary permissions:

    Connect-MgGraph -Scopes "DeviceManagementManagedDevices.ReadWrite.All"
    

    You’ll need to authenticate with an account that has Intune device creation permissions (e.g., Intune Administrator role).

  3. Run the batch creation script:
    This script will generate 100 devices with sequential names, along with basic OS/device type details:

    # Define a template for your test devices
    $deviceTemplate = @{
        accountEnabled = $true
        displayName = "Test-Virtual-Device-"
        operatingSystem = "Windows"
        operatingSystemVersion = "10.0.19045"
        deviceType = "Desktop"
    }
    
    # Loop to create 100 devices
    for ($i=1; $i -le 100; $i++) {
        $deviceParams = $deviceTemplate.Clone()
        $deviceParams.displayName += $i.ToString("000") # Adds leading zeros for clean numbering
        New-MgDeviceManagementManagedDevice -BodyParameter $deviceParams
    }
    

Key Notes About These Simulated Devices

  • These are non-managed, simulated devices—they won’t actually connect to Intune or require device licenses, but they will appear in your Intune device list and be returned by Graph API queries just like physical devices.
  • They’re perfect for testing pagination: when you query the managedDevices endpoint, Intune will paginate results once you exceed the default page size (usually 100 items), so your 100+ devices will trigger the pagination behavior you need to validate.
  • To clean up later, you can batch delete them with this command:
    Get-MgDeviceManagementManagedDevice -Filter "displayName starts with 'Test-Virtual-Device'" | Remove-MgDeviceManagementManagedDevice
    

Method 2: Direct Graph API Calls (For Custom Workflows)

If you prefer working directly with the Graph API, you can send POST requests to the https://graph.microsoft.com/v1.0/deviceManagement/managedDevices endpoint. You can use tools like Postman to automate bulk requests, or write a script in your preferred language (Python, C#, etc.) to loop through and create the devices. The payload structure matches the parameters used in the PowerShell script above.


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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.01 01:57:28