Jump to content
Welcome to our new Citrix community!
  • 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

  • 0

Fix your first for each loop ($Machine in $MachineName) as a starting point, then you’ll need to alter your new-brokermachine to reference the $Machine.MachineName

 

why the two files, that’s going to need validation and lookups/matching… can’t just pull into one and reference accordingly?

Link to comment

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...