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




No hay comentarios:

Publicar un comentario