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

miércoles, 14 de enero de 2015

XenApp 7.6 : How setup Virtual IP Range using a Batch File automatically

Hallo, gutten morgen aus Deutschland !!

Today I have a simple script to setup automatically several Virtual IP ranges in our citrix farm.

According to Citrix KB: http://support.citrix.com/article/CTX137163 to configure virtual ip we need use Microsoft Technologies (RD Configuration). To get this goal, it is necessary modify a few registry keys to setup specific range of Virtual IP in each Citrix Server.

Obviuosly, if you need perform this task in several citrix servers, maybe if you have 50 or 100 servers, to can take a lot off time. Maybe in this case you can run a simple batch file to load these registry keys:

To get this I have made a batch file like this:

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
::  File Name: ConfigureVIP_xa76_v01.cmd
::  Author: citrixpedia@gmail.com
::  Date: 14-01-2015
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


@echo off

FOR /F "eol=# tokens=1,2,3,4 delims=; " %%i in (vip.ini) do (

REG ADD \\%%i\HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\TSAppSrv\VirtualIP /v IPPool /t REG_SZ /d %SystemRoot%\system32\TSVIPool.dll /f

REG ADD \\%%i\HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\TSAppSrv\VirtualIP\IPPool /v Start /t REG_SZ /d %%j /f
REG ADD \\%%i\HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\TSAppSrv\VirtualIP\IPPool /v End /t REG_SZ /d %%k /f
REG ADD \\%%i\HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\TSAppSrv\VirtualIP\IPPool /v Subnetmask /t REG_SZ /d %%l /f

)


But you need a input file (*.INI or some TXT planin input file) to get all virtual IP ranges information:

#-----------------------------------------------------------------------------------------------
#
# servername or IP addrees ; starting ip addresses ; ending ip addresses ; subnetmask address
#
#-----------------------------------------------------------------------------------------------

xa7601.ctxlab.local;10.0.0.1;10.0.0.100;255.0.0.0
xa7602.ctxlab.local;10.0.0.101;10.0.0.200;255.0.0.0

Enjoy !!!




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