Jump to content
  • 0

Bulk Adding Machines To Catalog


Nishant Joshi

Question

Need to add multiple machines to Citrix Catalog using Powershell , How do I do it ?

I know the command but how do I run for multiple machine using loop and get content from two files 

I tried this way , but didn't worked - Its adding only the first one (looks like I am not doing right loop for two variables )

The command I am doing is correct but need help  with PS script for adding multiple machines using loops. 

 

 

---------------------

$MachineName = Get-Content "c:\temp\MachineName.txt"

$HostID =Get-Content "c:\temp\HostID.txt"

foreach ($MachineName in $MachineName)

{

foreach ($HostID in $HostID)

{

New-BrokerMachine -MachineName $MachineName -HostedMachineId $HostID  -CatalogUid 9 -HypervisorConnectionUid 2

}

}

 

Link to comment

1 answer to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...