Jump to content
Welcome to our new Citrix community!
  • 0

Put Multiple Desktop Delivery Groups in Maintenance Mode


Jitendra Kumar

Question

Hi All,

 

I have a requirement to put multiple desktop delivery group in maintenance mode. I am using the command  Set-BrokerDesktopGroup "Desktop Group1" -InMaintenanceMode $true , and its works fine. Now I wanted to achieve to put multiple Desktop delivery groups in maintenance mode so I try to use the below command but its not working. I have Desktop deliver groups name in .txt file but its through error. Can someone please help me to achieve this.

 

$DesktopGroups = Get-Content C:\Temp\Group_Name.txt

foreach ($DesktopGroup in $DesktopGroups) {Set-BrokerDesktopGroup -InMaintenanceMode -InputObject $DesktopGroup $true}

Link to comment

11 answers to this question

Recommended Posts

  • 0

Getting this error when I use as per your suggestion

 

PS C:\Windows\system32> foreach ($DesktopGroup in $DesktopGroups) {Set-BrokerDesktopGroup -Name $DesktopGroup -InMaintenanceMode $true}
Set-BrokerDesktopGroup : No items match the supplied pattern
At line:1 char:44
+ ... topGroups) {Set-BrokerDesktopGroup -Name $DesktopGroup -InMaintenance ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Set-BrokerDesktopGroup], SdkOperationException
    + FullyQualifiedErrorId : Citrix.XDPowerShell.Broker.NoMatchingItems,Citrix.Broker.Admin.SDK.SetBrokerDesktopGroupCommand
 
Set-BrokerDesktopGroup : No items match the supplied pattern
At line:1 char:44
+ ... topGroups) {Set-BrokerDesktopGroup -Name $DesktopGroup -InMaintenance ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Set-BrokerDesktopGroup], SdkOperationException
    + FullyQualifiedErrorId : Citrix.XDPowerShell.Broker.NoMatchingItems,Citrix.Broker.Admin.SDK.SetBrokerDesktopGroupCommand
 
Set-BrokerDesktopGroup : No items match the supplied pattern
At line:1 char:44
+ ... topGroups) {Set-BrokerDesktopGroup -Name $DesktopGroup -InMaintenance ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Set-BrokerDesktopGroup], SdkOperationException
    + FullyQualifiedErrorId : Citrix.XDPowerShell.Broker.NoMatchingItems,Citrix.Broker.Admin.SDK.SetBrokerDesktopGroupCommand

Link to comment
  • 0

Maybe something like this:

Get-BrokerDesktopGroup  | Select DesktopGroupName,InMaintenanceMode,Enabled | Out-File C:\temp\deliverygroups.txt

This exports alle deliverygroups with name, maintenancemode status and whether the deliverygroup is enabled or dissabled

Get-BrokerDesktopGroup | Select DesktopGroupName,InMaintenanceMode,Enabled | Export-Csv -Delimiter ";" -NoClobber -NoTypeInformation -Path c:\temp\deliverygroups.csv

This does the same as the one above, but instead of exporting to a txt file, it exports to a CSV file which can be opened in Excel or another CSV viewer.

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