Script to add a Windows 365 Cloud PC User – Add-CloudPCUser.ps1

Script prerequisites for Windows PowerShell:

1. A minimum Windows PowerShell version of ‘7.2’ is required to run this script. The script automatically checks for and installs module if needed.

2. Windows 365 Cloud PC Management PowerShell Module must be installed on local machine. The script automatically checks for and installs module if needed.

3. Microsoft Graph PowerShell Module must be installed on local machine. The script automatically checks for and installs module if needed.

4. An Azure AD user that has an admin consent permission, if needed, to approve the following permissions in Microsoft Graph application in Azure AD apps:

CloudPC.ReadWrite.All, DeviceManagementConfiguration.ReadWrite.All, DeviceManagementManagedDevices.ReadWrite.All, Directory.Read.All

.PARAMETER Username

Username to add to Windows 365 Cloud PC

.PARAMETER UsersListPath

CSV file path containing a list of users to add to Windows 365 Cloud PC. Sample file contents:

———- Windows PowerShell Continued

upn

[email protected]

[email protected]

[email protected]

[email protected]

.PARAMETER Group

Azure AD group name to add users to

.EXAMPLE

.\Add-CloudPCUser.ps1 -Username [email protected] -Group IT -Verbose

.EXAMPLE

.\Add-CloudPCUser.ps1 -UsersListPath c:\temp\users.csv -Group Sales -Verbose

Direct link: Add-CloudPCUser.ps1
Github – https://github.com/ThomasMarcussen/assortedScripts/

4 thoughts on “Script to add a Windows 365 Cloud PC User – Add-CloudPCUser.ps1

  1. Pingback: Virtual Desktops Community Newsletter 26th January – 2nd February 2023 – Virtual Desktops Community

  2. Pingback: Intune Newsletter - 3rd February 2023 - Andrew Taylor

  3. Pingback: Windows 365 - W5 Newsletter - 28th January to 3rd of February 2023

  4. Pingback: Weekly Newsletter – 28th January to 3rd of February 2023 - Windows 365 Community

Feel free to comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.