|
|
ICT-Hotlist Topic
Get XenApp application security information with PowerShell.
Published : 2014-05-07.
Last updated : 2017-05-02.
This PowerShell script getXenAppApplicationSecurity.ps1 generates a tabulator separated
download file containing the XenApp Application display name and the security group or user name
able to start the application.
The script will create one line per application and user name or group. This enables the output to be used with Excel PivotTables or Filtering to get all users / groups enabled for one application or find all the applications enabled for an user or group.
The output file directly opens in Microsoft Excel as can be seen below.
Limitations:
- You must run this script on the Citrix XenApp server itself (no remoting implemented).
- This script must run using an user account that is a Citrix XenApp administrator
- The IMA service must be running on the Citrix server.
The script getXenAppApplicationSecurity.ps1
# This PowerShell script getXenAppApplicationSecurity.ps1 generates a tabulator separated
# download file containing the XenApp Application display name and the security group or user name
# able to start the application.
#
# (C) Copyright 2013-2023 Johan van Soest. [http://www.vansoest.it]
# Version 1.0 05-11-2013 by Johan van Soest
# Version 1.1 22-03-2014 by Johan van Soest (added browsername option & Snapin detection)
# Call the script as follows .\getXenAppApplicationSecurity.ps1 >> FileName.csv
# Load the Citrix components
if ( (Get-PSSnapin -Name Citrix* -ErrorAction SilentlyContinue) -eq $null )
{
Add-PSSnapin Citrix*
}
# Get all the applications information
$apps=Get-XAApplicationReport -BrowserName *
# Write the table header
Write-output "ApplicationDisplayName`tAccountDisplayName"
# Loop over all applications
foreach ($app in $apps)
{
$Accounts = $app.Accounts
# Loop over all Accounts
foreach ($account in $Accounts)
{
# Display only the information we are interested in.
Write-output "$($app.DisplayName)`t$($account.AccountDisplayName)"
}
}
Example output.
ApplicationDisplayName | AccountDisplayName |
AppCenter | VANSOEST\JohnL |
AppCenter | VANSOEST\GeorgeH |
AppCenter | VANSOEST\PaulM |
AppCenter | VANSOEST\johanvs |
AppCenter | VANSOEST\Domain Admins |
Citrix Client Printer Selection | VANSOEST\Domain Users |
CMD | VANSOEST\johanvs |
CMD | VANSOEST\PaulM |
CMD | VANSOEST\Domain Admins |
CMD | VANSOEST\JohnL |
Default Printer Selection | VANSOEST\Domain Users |
Internet Explorer | VANSOEST\johanvs |
Internet Explorer | VANSOEST\Domain Users |
Microsoft Excel 2013 | VANSOEST\johanvs |
Microsoft Excel 2013 | VANSOEST\Domain Users |
Microsoft Powerpoint 2013 | VANSOEST\johanvs |
Microsoft Powerpoint 2013 | VANSOEST\Domain Users |
Microsoft Word 2013 | VANSOEST\johanvs |
Microsoft Word 2013 | VANSOEST\Domain Users |
Paint | VANSOEST\johanvs |
Paint | VANSOEST\Domain Users |
Microsoft Office Excel 2013 Auto Filter example.
Microsoft Office Excel 2013 PivotTable example.
Scripts and programming examples disclaimer
Unless stated otherwise, the script sources and programming examples provided are copyrighted freeware.
You may modify them, as long as a reference to the original code and hyperlink to the source page is included in the modified code and documentation.
However, it is not allowed to publish (copies of) scripts and programming examples on your own site, blog, vlog, or distribute them on paper or any other medium, without prior written consent.
Many of the techniques used in these scripts, including but not limited to modifying the registry or system files and settings, impose a risk of rendering the Operating System inoperable and loss of data.
Make sure you have verified full backups and the associated restore software available before running any script or programming example.
Use these scripts and programming examples entirely at your own risk. All liability claims against the author in relation to material or non-material losses caused by the use, misuse or non-use of the information provided, or the use of incorrect or incomplete information, are excluded. All content is subject to change and provided without obligation.
|