Powershell – Configuration logging

We can never stop having more fun with Powershell and here we take a look at creating Configuration Logging Reports from Citrix XenApp 6.5. We first look at what the GUI Appcenter can offer and it is not bad we can save our reports in XML, but no other format. Powershell then opens up a range of formatting option and is really quite simple with a little practice.

if ( (Get-PSSnapin -Name citrix.common.commands -ErrorAction SilentlyContinue) -eq $null )
{
    Add-PSSnapin citrix.common.commands
}

Get-Command -Module citrix.common.commands
Add-Content c:\conn.udl -Value $null; Start-Process c:\conn.udl
Get-CtxConfigurationLogReport -DataLinkPath C:\conn.udl
Get-CtxConfigurationLogReport -DataLinkPath C:\conn.udl | format-table
Get-CtxConfigurationLogReport -DataLinkPath C:\conn.udl | format-table -Property Date,account,tasktype,itemtype,itemname,description
Get-CtxConfigurationLogReport -DataLinkPath C:\conn.udl -ItemType LoadManager | format-table -Property Date,account,tasktype,itemtype,itemname,description
Get-CtxConfigurationLogReport -DataLinkPath C:\conn.udl -ItemType LoadManager | Export-Csv c:\file.csv

 

You can see then that we need to work with the Snapin “citrix.common.commands”, we check if the snapin is loaded if not we load it. 
Get-Command will show the avilable commands fromt he given module. 
The clever bit is populating our Connnection File for the database, the UDL file. The add-content line achieves this though a GUI. We only need to create this file once so can be done ahead of time and not run on each event. With that done we can then use the Get-CtxConfigurationLogReport to display the log and then start filtering and choosing formatting options. Have fun!

http://www.theurbanpenguin.com/citrix/ps-configlog.html

Deixe uma resposta

Preencha os seus dados abaixo ou clique em um ícone para log in:

Logotipo do WordPress.com

Você está comentando utilizando sua conta WordPress.com. Sair / Alterar )

Imagem do Twitter

Você está comentando utilizando sua conta Twitter. Sair / Alterar )

Foto do Facebook

Você está comentando utilizando sua conta Facebook. Sair / Alterar )

Foto do Google+

Você está comentando utilizando sua conta Google+. Sair / Alterar )

Conectando a %s