Citrix.Broker.Admin.V1

http://support.citrix.com/proddocs/topic/xenapp-xendesktop-76/cds-sdk-admin-model.html
The PowerShell modules for Xenapp/XenDesktop 7.6 can be found here:
C:\Program Files\Citrix\XenDesktopPoshSdk\Module











We have the following list of modules that we can use:
Citrix.AdIdentity.Admin.V2
Citrix.AppV.Admin.V1
Citrix.Broker.Admin.V2
Citrix.Configuration.Admin.V2
Citrix.ConfigurationLogging.Admin.V1
Citrix.DelegatedAdmin.Admin.V1
Citrix.EnvTest.Admin.V1
Citrix.Host.Admin.V2
Citrix.MachineCreation.Admin.V2
Citrix.Monitor.Admin.V1
Citrix.Storefront.Admin.V1
Let’s check how many cmdlets can we use in our awesome scripts :)
As you see above we have 718 cmdlets for our use which is quite impressive number. If you would like to read more about the cmdlets you can visit the E-docs page:
http://support.citrix.com/proddocs/topic/xenapp-xendesktop-76/xad-commands.html
or you can just get that help from PowerShell console.
As you see you get very detailed explanation of what that cmdlet can do for you as well as a few examples that will show you how to use that cmdlet to get some relevant information.
The other thing that I just simply love in XenApp/XenDesktop 7.6 is a Script Generator. If you would like to automate some thing that you do quite often in Citrix Studio you can now use
instead Powershell script. And what is even better Citrix Studio will generate it for you. Isn’t that great? No more hours spent on developing Powershell scripts. They are now on your hand
– just grab it and use as you want :) You will have more time to learn other things about XenApp/XenDesktop.
Where to find those generated scripts? Launch Citrix Studio. Do what you would like to do and then navigate to the main window of console. You may notice there a tab called PowerShell.
Click it and you will find PowerShell script ready for use. Excelllent :)
As you see it is very easy. But still I encourage you to try on your own. Write some simple script and check how it works. The best way to learn something is by doing something.
That’s all I wanted to show you regarding PowerShell in XenApp/XenDesktop 7.6. Apparently we get to the final of our First Series. In the next post I will do a summary of our whole
series. Hope you like it!
* Citrix ADIdentity Admin V1
* Citrix Broker Admin V1
* Citrix Common Commands
* Citrix Configuration Admin V1
* Citrix Host Admin V1
* Citrix MachineCreation Admin V1
* Citrix MachineIdentity Admin V1
Citrix ADIdentity Admin V1
About Topics


about_AcctADIdentityServiceSnapin
about_Acctfiltering
Cmdlets



























Update-AcctADAccount
New-AcctADAccount
Remove-AcctADAccount
Unlock-AcctADAccount
Repair-AcctADAccount
Add-AcctADAccount
Get-AcctADAccount
Get-AcctAdministrator
New-AcctAdministrator
Remove-AcctAdministrator
Get-AcctAdminPermission
Set-AcctDBConnection
Get-AcctDBConnection
Get-AcctDBSchema
Get-AcctDBVersionChangeScript
Get-AcctIdentityPool
Rename-AcctIdentityPool
Remove-AcctIdentityPool
Unlock-AcctIdentityPool
Set-AcctIdentityPool
New-AcctIdentityPool
Get-AcctInstalledDBVersion
Get-AcctService
Get-AcctServiceAddedCapability
Reset-AcctServiceGroupMembership
Get-AcctServiceInstance
Get-AcctServiceStatus






Switch-AcctTask
Stop-AcctTask
Get-AcctTask
Remove-AcctTask
Remove-AcctTaskMetadata
Add-AcctTaskMetadata
Citrix.Broker.Admin.V1
About Topics














about_Broker_AccessPolicy
about_Broker_Applications
about_Broker_AssignmentPolicy
about_Broker_Concepts
about_Broker_ControllerDiscovery
about_Broker_Desktops
about_Broker_EntitlementPolicy
about_Broker_ErrorHandling
about_Broker_Licensing
about_Broker_Machines
about_Broker_Policies
about_Broker_PostInstallPreConfiguration
about_Broker_PowerManagement
about_Xfiltering
Cmdlets

















Get-BrokerAccessPolicyRule
Rename-BrokerAccessPolicyRule
Set-BrokerAccessPolicyRule
Remove-BrokerAccessPolicyRule
New-BrokerAccessPolicyRule
Get-BrokerAdministrator
Remove-BrokerAdministrator
Set-BrokerAdministrator
Add-BrokerAdministrator
New-BrokerAdministrator
Get-BrokerAdminPermission
New-BrokerApp
Set-BrokerApplication
Remove-BrokerApplication
Copy-BrokerApplication
Rename-BrokerApplication
Get-BrokerApplication














































Add-BrokerApplication
New-BrokerApplication
New-BrokerApplicationFolder
Rename-BrokerApplicationFolder
Remove-BrokerApplicationFolder
Set-BrokerApplicationFolder
Get-BrokerApplicationFolder
Get-BrokerApplicationInstance
Remove-BrokerAssignmentPolicyRule
Rename-BrokerAssignmentPolicyRule
Get-BrokerAssignmentPolicyRule
New-BrokerAssignmentPolicyRule
Set-BrokerAssignmentPolicyRule
Rename-BrokerCatalog
New-BrokerCatalog
Remove-BrokerCatalog
Set-BrokerCatalog
Get-BrokerCatalog
Start-BrokerCatalogPvdImagePrepare
New-BrokerConfiguredFTA
Get-BrokerConfiguredFTA
Remove-BrokerConfiguredFTA
Get-BrokerConnectionLog
Get-BrokerController
Set-BrokerDBConnection
Get-BrokerDBConnection
Get-BrokerDBSchema
Get-BrokerDBVersionChangeScript
Remove-BrokerDelayedHostingPowerAction
Get-BrokerDelayedHostingPowerAction
New-BrokerDelayedHostingPowerAction
Get-BrokerDesktop
Group-BrokerDesktop
Set-BrokerDesktopGroup
Rename-BrokerDesktopGroup
New-BrokerDesktopGroup
Remove-BrokerDesktopGroup
Get-BrokerDesktopGroup
Export-BrokerDesktopPolicy
Import-BrokerDesktopPolicy
Get-BrokerDesktopUsage
Rename-BrokerEntitlementPolicyRule
New-BrokerEntitlementPolicyRule
Get-BrokerEntitlementPolicyRule
Remove-BrokerEntitlementPolicyRule
Set-BrokerEntitlementPolicyRule














































Remove-BrokerHostingPowerAction
Get-BrokerHostingPowerAction
Set-BrokerHostingPowerAction
New-BrokerHostingPowerAction
Get-BrokerHypervisorAlert
Get-BrokerHypervisorConnection
Remove-BrokerHypervisorConnection
New-BrokerHypervisorConnection
Set-BrokerHypervisorConnection
Remove-BrokerIcon
New-BrokerIcon
Get-BrokerIcon
Update-BrokerImportedFTA
Get-BrokerImportedFTA
Remove-BrokerImportedFTA
Get-BrokerInstalledDbVersion
Test-BrokerLicenseServer
Reset-BrokerLicensingConnection
Remove-BrokerMachine
New-BrokerMachine
Set-BrokerMachine
Add-BrokerMachine
Get-BrokerMachine
Start-BrokerMachinePvdImagePrepare
Add-BrokerMachinesToDesktopGroup
Update-BrokerNameCache
Rename-BrokerPowerTimeScheme
Remove-BrokerPowerTimeScheme
New-BrokerPowerTimeScheme
Get-BrokerPowerTimeScheme
Set-BrokerPowerTimeScheme
Get-BrokerPrivateAppDesktop
Set-BrokerPrivateAppDesktop
Set-BrokerPrivateDesktop
Get-BrokerPrivateDesktop
Get-BrokerResource
Get-BrokerServiceAddedCapability
Reset-BrokerServiceGroupMembership
Get-BrokerServiceInstance
Get-BrokerServiceStatus
Disconnect-BrokerSession
Stop-BrokerSession
Get-BrokerSession
Send-BrokerSessionMessage
Get-BrokerSessionSharingIncompatibleApplication
Get-BrokerSharedAppDesktop
















Set-BrokerSharedAppDesktop
Get-BrokerSharedDesktop
Set-BrokerSharedDesktop
Set-BrokerSite
Get-BrokerSite
New-BrokerTag
Rename-BrokerTag
Add-BrokerTag
Get-BrokerTag
Remove-BrokerTag
Get-BrokerUnconfiguredMachine
Add-BrokerUser
New-BrokerUser
Get-BrokerUser
Remove-BrokerUser
Get-BrokerUserDesktopAppAssignment
Citrix Common Commands
Cmdlets











Get-CtxConfigurationLogReport
Get-CtxIcon
New-CtxInformationPackage
Get-CtxProfileApplication
Copy-CtxSystemInformation
Copy-CtxTraceLog
Get-CtxTraceProvider
Stop-CtxTraceSession
Start-CtxTraceSession
Clear-CtxTraceSession
Get-CtxTraceSession
Citrix.Configuration.Admin.V1
About Topics


about_configConfigurationServiceSnapin
about_Configfiltering
Cmdlets


Remove-ConfigAdministrator
New-ConfigAdministrator
































Get-ConfigAdministrator
Get-ConfigAdminPermission
Get-ConfigDBConnection
Set-ConfigDBConnection
Get-ConfigDBSchema
Get-ConfigDBVersionChangeScript
Get-ConfigGlobalMetadata
Remove-ConfigGlobalMetadata
Add-ConfigGlobalMetadata
Get-ConfigInstalledDBVersion
Unregister-ConfigRegisteredServiceInstance
Set-ConfigRegisteredServiceInstance
Get-ConfigRegisteredServiceInstance
Remove-ConfigRegisteredServiceInstanceMetadata
Add-ConfigRegisteredServiceInstanceMetadata
Get-ConfigService
Get-ConfigServiceAddedCapability
Remove-ConfigServiceGroup
Get-ConfigServiceGroup
Reset-ConfigServiceGroupMembership
Remove-ConfigServiceGroupMetadata
Add-ConfigServiceGroupMetadata
Register-ConfigServiceInstance
Get-ConfigServiceInstance
Test-ConfigServiceInstanceAvailability
Get-ConfigServiceStatus
Stop-ConfigTask
Switch-ConfigTask
Remove-ConfigTask
Get-ConfigTask
Remove-ConfigTaskMetadata
Add-ConfigTaskMetadata
Citrix.Host.Admin.V1
About Topics


about_Hypfiltering
about_HypHostSnapin
Cmdlets



Set-HypAdminConnection
Remove-HypAdministrator
Get-HypAdministrator































New-HypAdministrator
Get-HypAdminPermission
Get-HypConfigurationDataForItem
Get-HypDBConnection
Set-HypDBConnection
Get-HypDBSchema
Get-HypDBVersionChangeScript
Remove-HypHostingUnitStorage
Set-HypHostingUnitStorage
Add-HypHostingUnitStorage
Update-HypHypervisorConnection
Add-HypHypervisorConnectionAddress
Remove-HypHypervisorConnectionAddress
Get-HypHypervisorPlugin
Get-HypInstalledDBVersion
Remove-HypMetadata
Add-HypMetadata
Get-HypService
Get-HypServiceAddedCapability
Reset-HypServiceGroupMembership
Get-HypServiceInstance
Get-HypServiceStatus
Stop-HypTask
Get-HypTask
Remove-HypTask
Switch-HypTask
Remove-HypTaskMetadata
Add-HypTaskMetadata
Get-HypVMMacAddress
New-HypVMSnapshot
Get-HypXenServerAddress
Citrix.MachineCreation.Admin.V1
About Topics


about_Provfiltering
about_ProvMachineCreationSnapin
Cmdlets




Get-ProvAdministrator
Remove-ProvAdministrator
New-ProvAdministrator
Get-ProvAdminPermission


































Get-ProvDBConnection
Set-ProvDBConnection
Get-ProvDBSchema
Get-ProvDBVersionChangeScript
Get-ProvInstalledDBVersion
Publish-ProvMasterVmImage
Remove-ProvScheme
Unlock-ProvScheme
New-ProvScheme
Get-ProvScheme
Rename-ProvScheme
Set-ProvScheme
Add-ProvSchemeControllerAddress
Remove-ProvSchemeControllerAddress
Get-ProvSchemeMasterVMImageHistory
Remove-ProvSchemeMasterVMImageHistory
Remove-ProvSchemeMetadata
Add-ProvSchemeMetadata
Get-ProvService
Get-ProvServiceAddedCapability
Reset-ProvServiceGroupMembership
Get-ProvServiceInstance
Get-ProvServiceStatus
Stop-ProvTask
Get-ProvTask
Switch-ProvTask
Remove-ProvTask
Add-ProvTaskMetadata
Remove-ProvTaskMetadata
Unlock-ProvVM
New-ProvVM
Get-ProvVM
Remove-ProvVM
Lock-ProvVM
Citrix.MachineIdentity.Admin.V1
About Topics


about_PvsVmfiltering
about_PvsVMMachineIdentitySnapin
Cmdlets

New-PvsVmAdministrator























Get-PvsVmAdministrator
Remove-PvsVmAdministrator
Get-PvsVmAdminPermission
Set-PvsVmDBConnection
Get-PvsVmDBConnection
Get-PvsVmDBSchema
Get-PvsVmDBVersionChangeScript
Get-PvsVmInstalledDBVersion
Get-PvsVmService
Get-PvsVmServiceAddedCapability
Remove-PvsVmServiceConfigurationData
Set-PvsVmServiceConfigurationData
Get-PvsVmServiceConfigurationData
Reset-PvsVmServiceGroupMembership
Get-PvsVmServiceInstance
Get-PvsVmServiceStatus
Stop-PvsVmTask
Get-PvsVmTask
Remove-PvsVmTask
Switch-PvsVmTask
Remove-PvsVmTaskMetadata
Add-PvsVmTaskMetadata
Get-PvsVmVirtualMachine
XENAPP POWERSHELL BASICS



Home
Scripts and Downloads
XenApp PowerShell Basics
Recently I've responded to a number of posts on the Citrix forums where the question was solved by using PowerShell. I think there are still a lot of people who are running XenApp 5 and there are also a
lot of people who haven't yet started using PowerShell.
So in this post I will explain the very basics of how to start using PowerShell on XenApp.
A word or warning first. PowerShell, as the name says, is very powerful. You can do some major damage if you run the wrong command or script against your farm. In general you are safe with Get
commands as these simply pull information from the farm but always test commands and scripts in a non-production environment before running against your production farm.
XENAPP 5
To install for Windows 2008 use Server Manager to add the feature.
To install for Windows 2003 you must install the Windows Management Framework which is available for download at KB968929
Once you have Windows PowerShell installed you need to install the Citrix Power SDK which you can download from here (MyCitrix ID required). It is called Tech Preview 3 Release but as far as I know
this is the latest PowerShell SDK for XenApp and it never went past Tech Preview.
.NET Framework 3.5 SP1A is a prerequisite of installing the PowerShell SDK.
XENAPP 6 AND 6.5
With Windows 2008 R2 PowerShell comes installed by default so you do not need to do anything to add it.
You still have to install the correct XenApp PowerShell SDK. Download it here for XenApp 6 andhere for XenApp 6.5
When you run the install you will be given the option to update the PowerShell signing policy of the server. If you do not tick this option then certain scripts in the SDK will not run.
If you are writing your own PowerShell scripts and you are not signing them then you need to set the signing policy to unsigned, I will show you how to do this later.
POWERSHELL BASICS
Now you have all the right components installed you are ready to start using PowerShell.
If you want to use the XenApp cmdlets (essentially the XenApp PowerShell commands) you must launch the correct PowerShell console.
You will find this in Start --> All Programs -->Citrix
If you don't use these shortcuts to launch PowerShell the XenApp cmdlets will not load and you will not be able to use the XenApp PowerShell commands.
You can manually load the cmdlets using the following command, if you are running PowerShell commands in a script you need to use this command at the beginning of your script.
[code lang="powershell"] #
Add-PSSnapin Citrix.*
#
[/code]
Once you have the XenApp cmdlets loaded you can use the following command to get a list of the available commands
[code lang="powershell"] #
Get-Command -Module Citrix.*
#
[/code]
Or if you know part of the command you can use wildcards to give you a list of all the commands that are similar.
[code lang="powershell"] #
Get-Command *get-xa*
#
[/code]
Using the Get-Help command followed by a command name will give you all the help information about that command.
[code lang="powershell"] #
Get-Help Get-XAApplicationReport
#
[/code]
Follow Get-Help with -full or -examples for the full help text or example commands.
[code lang="powershell"] #
Get-Help -full Get-XAApplicationReport
#
[/code]
Get-XAApplicationReport is a good command to start playing around with.
[code lang="powershell"] #
Get-XAApplicationReport
#
[/code]
Follow this command with an asterisk to get details of all your published applications (may take a while to run if you have a lot) or follow it by a specific application name to just get information about one
particular published app.
You can use the command pipe (|) symbol to pass results from one PowerShell command into another one. E.G. I can pipe the results from Get-XAApplication report into Select-Object so that I only see the
specific information I want from the XAApplication-Report command.
[code lang="powershell"] #
Get-XAApplicationReport | Select-Object BrowserName,CommandLineExecutable
#
[/code]
I can then pipe this again to the Export-CSV command so that I can save the data out of PowerShell
[code lang="powershell"] #
Get-XAApplicationReport | Select-Object BrowserName,CommandLineExecutable |
Export-CSV C:AppReport.csv
#
[/code]
EXECUTION POLICY
If you want to write your own scripts and run them on your XenApp servers then you will either need to sign your scripts or change the Execution Policy to allow unsigned scripts. This Microsoft blog post
explains how to sign PowerShell scripts.If you want to allow unsigned scripts, run the following command on the server console
[code lang="powershell"] #
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
#
[/code]
OTHER POWERSHELL RESOURCES
There is so much about PowerShell available on the internet, these are just a few of them.
XenApp Rolling Reboot Script for Zero downtime reboots
http://blog.itvce.com/?p=79
Carl Webster's PowerShell script for documenting XenApp Infrastructure
http://carlwebster.com/where-to-get-copies-of-the-xenapp-farm-documentation-scripts/
I also have a few basic scripts in the Scripts and Downloads section