This article is designed to describe how to add a machine to an existing Machine Catalog and Delivery Group using PowerShell.
Open PowerShell with "run as administrator" on any DDC, then create AD account name and add it to Machine Catalog by the following commands.
1. Load our snapins
asnp citrix*
2. Create a new account for the machine we want to add "pool name" should match the catalog name
get-brokercatalog | select catalogname, uid
New-AcctADAccount -IdentityPoolName "Pool Name" -count n (if AD accounts haven't created in AD)
Example :-New-AcctADAccount -IdentityPoolName "Desktop-Static-MCS" -count 1
or Add-AcctADAccount -IdentityPoolName "Pool Name" -ADAccountName "Domain\COMPUTERNAME" (if AD accounts have already created in AD)
Example:- Add-AcctADAccount -ADAccountName "TINA\WIN10-MSC002" -IdentityPoolName "Desktop-Static-MCS"
3. Find the provisioning scheme associated with the catalog you want to add the machine to - Get-provscheme | select ProvisioningSchemeName
4. Create VM specifying the provisioning scheme in the above command using New-provVM -ADAccountName "Domain\VDA NetBIOS Name" -ProvisioningSchemeName "poolname"
Example:- New-ProvVM -ADAccountName "TINA\WIN10-MSC003" -ProvisioningSchemeName "Desktop-Static-MCS"
5. Add VM to Machine Catalog using New-brokermachine -CatalogUid n -MachineName "Domain\VDA NetBIOS Name"
Example:- New-BrokerMachine -CatlogUid 2 -MachinenName "TINA\WIN10-MSC002"
6. Add VM to Delivery Group and add user permission using
Example:-
Add-BrokerMachine -MachineName "TINA\WIN10-MSC002" -DesktopGroup "Desktop-Static-MCS"
Add-BrokerUSer -Name "TINA\ghw" -Machine "TINA\WIN10-MSC002"