Administrator, Application Virtualization, Citrix, Microsoft, PowerShell, Script, Server, Web, Web interface, Website

Extract Citrix webinterface settings information using powershell for multiple servers

May 6, 2015

Recently Citrix replaced Citrix websites with Citrix storefront. Till 6.x we use Citrix websites to access Citrix applications. There are various settings which needs to be in place for Citrix website to work.

In this article we would write a small script to get settings data for multiple Citrix websites.

Citrix website settings are save in a configuration file(inetpub\wwwroot\(website)\Conf\WebInterface.conf). Most of the settings can be found here.

Below script check for authentication type for all websites created on servers mentioned in Web-servers.csv(The heading for column should be servers)

$servers = import-csv "C:\test\Web-servers.csv"
[string]$a = ""
$e=foreach($server in $servers){
$d = "\\" + $Server.servers + "\c$\inetpub\wwwroot\"
$dirs = Get-ChildItem $d | where {$_.Attributes -eq 'Directory'}
foreach($dir in $dirs){
if($dir){
$open = "\\" + $Server.servers + "\c$\inetpub\wwwroot\" + $dir + "\conf\WebInterface.conf"
$a = gc $open
$result = ""
$ews = $a.substring($a.IndexOf("WIAuthenticationMethods=")+24,12)
$ew = $ews.substring(0,8)
if($ew -eq "Explicit"){
$ews = $ew
}

$s= $Server.servers
$w = $dir.name
New-Object -type psobject -property @{ServerName=$s;
WebsiteNAme=$w
AuthenticationType=$ews}
}
}
}

$e | export-csv "C:\test\Web-result.csv"

The output would exported to Web-result.csv file.

The script search for “WIAuthenticationMethods” parameter in file and display the result by searching this substring in file.

I hope this information would be helpful for you and you can play with other parameters using this script.

Keep Scripting 🙂

You Might Also Like

No Comments

Leave a Reply