|
| 1 | +--- |
| 2 | +# required metadata |
| 3 | +title: Export Cloud PC names for Windows 365 |
| 4 | +titleSuffix: |
| 5 | +description: Learn how to export Cloud PC names for Windows 365 |
| 6 | +keywords: |
| 7 | +author: ErikjeMS |
| 8 | +ms.author: erikje |
| 9 | +manager: dougeby |
| 10 | +ms.date: 12/09/2021 |
| 11 | +ms.topic: how-to |
| 12 | +ms.service: cloudpc |
| 13 | +ms.subservice: |
| 14 | +ms.localizationpriority: high |
| 15 | +ms.technology: |
| 16 | +ms.assetid: |
| 17 | + |
| 18 | +# optional metadata |
| 19 | + |
| 20 | +#ROBOTS: |
| 21 | +#audience: |
| 22 | + |
| 23 | +ms.reviewer: naramkri |
| 24 | +ms.suite: ems |
| 25 | +search.appverid: MET150 |
| 26 | +#ms.tgt_pltfrm: |
| 27 | +ms.custom: intune-azure; get-started |
| 28 | +ms.collection: M365-identity-device-management |
| 29 | +--- |
| 30 | + |
| 31 | +# Export Cloud PC names |
| 32 | + |
| 33 | +You can export the Cloud PC name of every Cloud PC on your tenant. |
| 34 | + |
| 35 | +1. Sign in to a Cloud PC with a user who is assigned the Azure Active Directory (Azure AD) Global Administrator role. |
| 36 | +2. Open PowerShell and type ```Install-Module Microsoft.Graph -Scope CurrentUser```. |
| 37 | +3. Enter **Y** in all confirmation dialogs. |
| 38 | +4. Wait for the installation to finish then close PowerShell. |
| 39 | +5. Open a text editor like Visual Studio Code. |
| 40 | +6. In a new file past the following script: |
| 41 | +``` |
| 42 | +param( |
| 43 | + [Parameter(Mandatory)] |
| 44 | + [string]$Output |
| 45 | +) |
| 46 | +
|
| 47 | +Select-MgProfile -Name "beta" |
| 48 | +Connect-MgGraph -Scopes "CloudPC.Read.All" |
| 49 | +$CloudPCs = Get-MgDeviceManagementVirtualEndpointCloudPC -Property "DisplayName" |
| 50 | +$DisplayNames = $CloudPCs | Select -ExpandProperty DisplayName |
| 51 | +Write-Output $DisplayNames |
| 52 | +
|
| 53 | +$Outarray = @() |
| 54 | +
|
| 55 | +foreach ( $Name in $DisplayNames ) |
| 56 | +{ |
| 57 | + $Outarray += New-Object PsObject -property @{ |
| 58 | + 'DisplayName' = $Name |
| 59 | + } |
| 60 | +} |
| 61 | +$Outarray | Export-Csv -Path $Output -NoTypeInformation |
| 62 | +Disconnect-MgGraph |
| 63 | +``` |
| 64 | + |
| 65 | +7. Save the file as “GetCloudPCNames.ps1” in a location of your choice. |
| 66 | +8. In the file explorer navigate to your file location. |
| 67 | +9. Right click on the file and select **Run with PowerShell**. |
| 68 | +10. A PowerShell window will pop up. In the window type “CloudPCNames.csv” and press enter. |
| 69 | +11. When the authentication Window pops up, log in with the same account you used to access the Cloud PC. |
| 70 | + |
| 71 | +When the PowerShell window closes the script has finished running. Go back to the location of your script and there will be a file called “CloudPCNames.csv” which includes the list of all Cloud PC names on your tenant. |
0 commit comments