2 Ways to Export Windows 365 Cloud PC Names to CSV

In this blog post, we will explore the process of exporting information about Windows 365 Cloud PCs. This includes details such as Cloud PC names, provisioning policies, Azure network connections, and additional information that can assist in managing the Windows 365 inventory.

There are multiple ways to export Cloud PC names, and in this discussion, we’ll explore two of the easiest methods. The first involves using the Intune admin center, while the second utilizes PowerShell. Let’s explore both these methods.

Below are some of the useful Windows 365 Step-by-Step Guides.

How to Setup Windows 365: Step-by-Step Guide

Rename a Windows 365 Cloud PC: Step-by-Step Guide

Step-by-Step Guides

Method 1 – Export Windows 365 Cloud PC Names using Intune admin center

Using the Intune admin center, you can effortlessly export Windows 365 Cloud PC names to a CSV file. Let’s walk through the steps:

  • Sign in to the Intune admin center.
  • Go to Devices > Windows 365 > All Cloud PCs.
  • Click on Export and then click on Download.
Export Windows 365 Cloud PC Names using Intune admin center
Export Windows 365 Cloud PC Names using Intune admin center
  • The pop-up message reads: This will export all data in this view to a comma-separated value (.csv) file. Do you want to continue?. Click on Download to start the Export process.
Export Windows 365 Cloud PC Names using Intune admin center
Export Windows 365 Cloud PC Names using Intune admin center
  • The CSV file will be downloaded to your PC’s default download folder. Open the file to review the exported information about Cloud PCs. The following details are included:
    • Cloud PC Device Name
    • Provisioning Policy Name
    • Image
    • Azure Network connection
    • PC type
    • Status
    • Date Modified
    • Third-Party connector

I have opened the CSV file using Notepad to display all the columns and information that has been exported.

Export Windows 365 Cloud PC Names using Intune admin center
  • If you prefer not to include all the information about Cloud PCs in the CSV file, click on Columns and filter to select only the information you want to export.
Export Windows 365 Cloud PC Names using Intune admin center
Export Windows 365 Cloud PC Names using Intune admin center
  • After filtering the columns, the portal will display only the columns you selected. Click on Export and then Download. This will export only the columns you have selected for the Cloud PCs.

Method 2 – Export Windows 365 Cloud PC Names using Powershell

You can also export Cloud PC information using PowerShell. Follow the steps below and utilize the provided commands to export the data.

Install Microsoft Graph Powershell Module

Install-Module Microsoft.Graph -Scope CurrentUser

After executing the above command to install Microsoft Graph, you may encounter the following prompts: Press Y to proceed with the Installation of the NuGet Provider. You may not get this prompt if the NuGet Provider is already installed on your system.

NuGet provider is required to continue PowerShellGet requires NuGet provider version ‘2.8.5.201’ or newer to interact with NuGet-based repositories. The NuGet provider must be available in ‘C:\Program Files\PackageManagement\ProviderAssemblies’ or ‘C:\Users\jatin\AppData\Local\PackageManagement\ProviderAssemblies’. You can also install the NuGet provider by running ‘Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force’. Do you want PowerShellGet to install and import the NuGet provider now? [Y] Yes [N] No [S] Suspend [?] Help (default is “Y”): Y

The Microsoft Graph module will be downloaded and installed from the PowerShell Gallery. As the PowerShell Gallery is an untrusted repository by default, you will receive another prompt to confirm the installation—Press A or Y on the keyboard.

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its
InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from
'PSGallery'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): A
 Export Windows 365 Cloud PC Names using Powershell
Export Windows 365 Cloud PC Names using Powershell

After installing the Microsoft Graph PowerShell module, run a PowerShell script that exports the names of Cloud PCs into a CSV file. Copy the code below, paste it into Notepad, and save the file as Get-CloudPCNames.ps1. This code is in the Microsoft documentation at the following link: Export Cloud PC names for Windows 365 | Microsoft Learn.

Get-CloudPCNames.ps1

param(
    [Parameter(Mandatory)]
    [string]$Output
)

Select-MgProfile -Name "beta"
Connect-MgGraph -Scopes "CloudPC.Read.All"
$CloudPCs = Get-MgDeviceManagementVirtualEndpointCloudPC -Property "DisplayName"
$DisplayNames = $CloudPCs | Select -ExpandProperty DisplayName
Write-Output $DisplayNames

$Outarray = @()

foreach ( $Name in $DisplayNames )
{
    $Outarray += New-Object PsObject -property @{
    'DisplayName' = $Name
     }
}
$Outarray | Export-Csv -Path $Output -NoTypeInformation
Disconnect-MgGraph

Execute this PowerShell script from the PowerShell console opened as an administrator. The script will prompt you to enter the desired name for the CSV file. Provide any file name with the extension .csv and press Enter. You may be prompted for authentication; complete the authentication process, and CloudPCNames.csv file will be exported.

 Export Windows 365 Cloud PC Names using Powershell
Export Windows 365 Cloud PC Names using Powershell

Leave a Comment