- Application usage report with the number of users for a particular timespan
Thursday, September 15, 2022
Citrix Application Performance Reports
- Application usage report with the number of users for a particular timespan
Thursday, June 2, 2022
Kill a User's Citrix Desktop or Application Session
Tuesday, March 29, 2022
Request from a forum user:
I'm running Citrix 7.15 Enterprise edition. Can I get a PowerShell script to retrieve a count of disconnected sessions and available machines in each delivery group ? I would like to send the output to a .csv file.
Here is a very simple way to accomplish this via PowerShell:
Get-BrokerDesktopGroup | Sort-Object Name | Select-Object Name,
DesktopsDisconnected, DesktopsAvailable |
Export-Csv -Path "C:\temp\DGinfo.csv" -NoTypeInformation
Sunday, January 16, 2022
Copy Applications from One Delivery Group to Another
A forum user asked if there was an easy way to copy all applications from one delivery group to another. Here is a simple PowerShell script to accomplish this:
Thursday, October 14, 2021
Retrieve Local Administrators from Multiple Computers
A forum user asked for assistance with a PowerShell script that would read a list of servers from a text file and then either show the list of users in the local administrator groups on each server.
The script below, Get-LocalMembers, takes things a bit further. While it will default to the local administrators group, you can supply any number of groups to the script. It even supports wildcards! By default, the results are displayed on the console, but can also export the results as a .csv file.
The script takes 2 parameters (both optional):
Computers
A list of computers to query. The list may be provided as a parameter to the script, or read from a text file. Default: localhost
Groups
A list of local groups to query on each of the computers. Wildcards are support (see examples below). Default: Administrators
Examples
Get-LocalMembers
Retrieves the members of the default group (Administrators) on the default computer(localhost).
Get-LocalMembers -Computers (Get-Content -Path "c:\temp\computers.txt")
Will retrieve the members of the Administrators group on all the computers in the file computers.txt.
Get-LocalMembers -groups 'Remote*','Admin*'
Will retrieve the members of the Administrators, Remote Desktop Users and Remote Management Users groups on localhost.
Get-LocalMembers | Export-Csv -Path "c:\reports\GroupMembers.csv" -NoTypeInformation
Retrieves the members of the default group (Administrators) on the default computer(localhost) and exports them to the specified .csv file.
Sam Jacobs is the Director of Technology at Newtek Technology Systems (formerly IPM), the longest standing Citrix Platinum Partner on the East Coast. With more than 30 years of IT consulting, Sam is a NetScaler and StoreFront customizations and integrations industry expert. He holds Microsoft and Citrix certifications, and is the editor of TechDevCorner.com, a technical resource blog for IT professionals. He is one of the top Citrix support Forum contributors, and has earned industry praise for the tools he has developed to make NetScaler, StoreFront and Web Interface easier to manage for administrators and more intuitive for end users. Sam became a Citrix Technology Professional (CTP) in 2015, and can be reached at: sjacobs@newtekone.com or on Twitter at: @WIGuru.
Sunday, September 12, 2021
Log Off Idle Citrix Sessions
The simple PowerShell snippet below will log off any session that has been idle for more than the specified number of hours.
# the below number of hours will be logged off
$maxIdleHours = 24
# load the Citrix snapin
Add-PSSnapin Citrix*
# function to calculate the number of hours
# that a session has been idle
Function Get-IdleHours {
param ([TimeSpan] $IdleTime)
($IdleTime.Days * 24) + $IdleTime.Hours
}
# get sessions that are idle
$sessions = @(Get-Brokersession | ? IdleDuration -ne $null)
# cycle through the list, and log off sessions that
# have been idle for > the specified number of hours
foreach ($sess in $sessions) {
if ((Get-IdleHours($sess.IdleDuration)) -gt $maxIdleHours) {
Stop-BrokerSession $sess
}
}
Sam Jacobs is the Director of Technology at Newtek Technology Systems (formerly IPM), the longest standing Citrix Platinum Partner on the East Coast. With more than 30 years of IT consulting, Sam is a NetScaler and StoreFront customizations and integrations industry expert. He holds Microsoft and Citrix certifications, and is the editor of TechDevCorner.com, a technical resource blog for IT professionals. He is one of the top Citrix support Forum contributors, and has earned industry praise for the tools he has developed to make NetScaler, StoreFront and Web Interface easier to manage for administrators and more intuitive for end users. Sam became a Citrix Technology Professional (CTP) in 2015, and can be reached at: sjacobs@newtekone.com or on Twitter at: @WIGuru.
Monday, October 26, 2020
Quickly Disconnect All ICA Sessions
A client recently asked for a way to quickly and easily disconnect all ICA sessions. This seemed like an easy task, which could be accomplished by enabling the Disconnect button within StoreFront. The problem was that the client wanted the ability for users to disconnect their sessions without logging in! Since we don't know who the user is until after login, how would we know which session(s) to disconnect?
I then found out that the Citrix Receiver Self-Service Plug-in had a parameter that will allow you to disconnect all of your applications by simply running the following:
SelfService.exe -disconnectapps
Then it became a matter of creating a new URL Protocol to invoke the above when browsing to the specified protocol. With the assistance of my colleague Jacques Bensimon, we created the attached .REG file. An explanation of the keys in the .REG file follows.
[HKEY_CLASSES_ROOT\xica] defines a new URL protocol called xica.
[HKEY_CLASSES_ROOT\xica\shell\open\command] specifies the registered handler to execute when the URL protocol is invoked.
The final REG key:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\ProtocolExecute\xica]
eliminates the IE prompt asking permission to run the registered handler. (Note: Other browsers may or may not prompt, and may have their own way of eliminating prompts, including possibly giving the user the option to no longer be prompted for these protocols. Those settings may not be in the Registry at all, but rather in some config files in the user profile.)
To invoke the new protocol, you simply needed to browse to it. This could be accomplished in many ways. For example, you could create a shortcut on the desktop with the URL xica://DisconnectApps. You could also invoke the protocol via a hyperlink or a button on a web page.
Sam Jacobs is the Director of Technology Development at IPM, the longest standing Citrix Platinum Partner on the East Coast. With more than 30 years of IT consulting, Sam is a NetScaler and StoreFront customizations and integrations industry expert. He holds Microsoft MCSD, Citrix and CCP-N certifications, and is the editor of TechDevCorner.com, a technical resource blog for IT professionals. He is one of the top Citrix support Forum contributors, and has earned industry praise for the tools he has developed to make NetScaler, StoreFront and Web Interface easier to manage for administrators and more intuitive for end users. Sam became a Citrix Technology Professional (CTP) in 2015, and can be reached at: sam.jacobs@ipm.com or on Twitter at: @WIGuru.