Mostrando entradas con la etiqueta xendesktop. Mostrar todas las entradas
Mostrando entradas con la etiqueta xendesktop. Mostrar todas las entradas

lunes, 15 de diciembre de 2014

How Export all Citrix XenApp 7.6 apps in a CSV file

An option could be get all information about XenApp 7.6 Site and exporting each Delivery Group.
To acomplish this firstly it is necessary get all delivery groups and late, using the attributte UUID, connect to each delivery Group to get all applications inside this group.

If you thinsk you can improove this script, please, send me your improovements to this mail: citrixpedia@gmail.com 

thanks and enjoy it!!

<# =======================================================================

File Name: ExportDeliveryGroupApps_v01.ps1

Author: citrixpedia@gmail.com
Date: 25-nov-2014

Comments: Script developed to get all apps information for each Delivery Group and dump this info in a different csv file.


======================================================================= #>


#-------------------------------------

# Get Location of script
#-------------------------------------

Get-pssnapin -registered | add-pssnapin -passthru


Get-Location | ForEach-Object { $myPath = $_.Path }

$myDate = Get-Date -UFormat "%Y-%m-%d %H%M"

#--------------------------------------------------------------------------------------------------

# Create a "....DeliveryGroups.csv" file with a list of all delivery groups and users permissions
#--------------------------------------------------------------------------------------------------

$myFileName = $myPath + "\" + $myDate + "_DeliveryGroups.csv"

$header = "DeliveryName;UUId;ColorDepth;Enabled;NumPublishedApplications;IncludedUsers"
$header | Out-File $myFileName -encoding ASCII 

Get-BrokerDesktopGroup | Where-Object {$_.Enabled -eq "True"} | ForEach-Object { 

if ($_.Name) { $myDesktopGroupName = $_.Name }
$myString = $_.Name + ";" + $_.UUId + ";" + $_.ColorDepth + ";" + $_.Enabled + ";" + $_.TotalApplications

#--------------------------------------------------------------------------------------------------

#   Get-BrokerAccessPolicyRule -> this CMDLET permits get access permissions
#--------------------------------------------------------------------------------------------------
Get-BrokerAccessPolicyRule | Where-Object { $_.uid -eq "1" -and $_.DesktopGroupName -eq $myDesktopGroupName } | ForEach-Object { 
if ($_.IncludedUsers) { $myIncludedUsers = $_.IncludedUsers }
}
$myUsers = ""
$myIncludedUsers | ForEach-Object {
if ($_.Name -and $myUsers) {$myUsers = $myUsers + "," + $_.Name}
elseif ($_.Name -and -not $myUsers) {$myUsers = $_.Name}
}
$myString + ";" + $myUsers | Add-Content $myFileName
}

#----------------------------------------------------------------------------------------------------------------

# Create a "....<delivery_group_name>_DeliveryGroupApps.csv" file with a list of all apps for each delivery group
# UUID is the attribute to identify and link apps and delivery groups
#----------------------------------------------------------------------------------------------------------------

Get-BrokerDesktopGroup | Where-Object {$_.Enabled -eq "True"} | ForEach-Object { 

$myUUID= $_.UUID
$myFileName = $myPath + "\" + $myDate + "_" + $_.name + "_DeliveryGroupApps.csv"
$myHeader = "AdminFolderName;ApplicationName;ApplicationType;DisplayName;ClientFolder;CommandLineArguments;CommandLineExecutable;AppName;PublishedName;Visible;WaitForPrinterCreation;WorkingDirectory"
$myHeader | Out-File $myFileName -encoding ASCII 

$apps = Get-BrokerApplication -SortBy Name | Where-Object { $_.AssociatedDesktopGroupUUIDs -eq $myUUID }


Foreach ($app in $apps) {
$myString = $app.AdminFolderName + ";" + $app.ApplicationName + ";" + $app.ApplicationType + ";" + $app.BrowserName + ";" + $app.ClientFolder + ";" + $app.CommandLineArguments + ";" + $app.CommandLineExecutable + ";" + $app.Name + ";" + $app.PublishedName + ";" + $app.Visible + ";" + $app.WaitForPrinterCreation + ";" + $app.WorkingDirectory
$myString | Add-Content $myFileName
}
}