You may run into cases where the sending application has one set of message standards and the receiving service has its own standards. One such case that I recently ran into with an app trying to initiate a call request via vendor-neutral open standards to Cisco Unified communication system. Obviously, Cisco expects the API request to be in its own format and some process needs to do this translation/transformation to complete the request successfully.
Netscaler Rewrite Action can be levered to transform the HTTP REQ Body to Cisco desired format. Below is a rewrite action that I used to bridge the gap, Basically, replaced the message body to Cisco specifications from the extracted information of the original message.
Note: Had to break the expression strings in chucks of ~200 char’s to please Netscaler character limitation. Also, while I could have used XPATH to extract the desired information, I went with regex as it turned out to be faster during testing.
If you tasked to find the public IP for all your ICA clients you will be surprised to know the Citrix monitoring/ODATA in virtual apps and desktops do not have this data.
If you have Citrix ADM/MAS in place and your ADC/Netscaler is on Premium/Platinum license, you are in luck and this could be your source for this kind of data but it doesn’t have a data export function from the web UI. This is where NITRO comes to the rescue, In fact, the Web interface for ADM/MAS gets the data through the NITRO API resources behind the scenes.
Here are some URLs that could help get the data you may seek, initially to explore the data you may start off by just navigating to these URL paths directly using any web browser. you will be prompted for credentials which would your ADM/MAS login. If it piques your interest, you may move to POSTMAN or PowerShell to automate & filter JSON responses.
Citrix provides access to Monitoring Data via ODATA API, I find it useful to extract session info to a very granular level [eg: by mintue]. This is the same data Citrix Director uses to present the fancy usage graphs but as you expand to longer time series it averages it and you might not get the accurate insights for capacity planning. The PS code shown above extracts and exports the SessionActivitySummary by minute to a csv file. the reason for the export is Citrix purges the ByMinute data, by default it only retains it for last 3 days. you could override this default retention value using Set-MonitoringConfiguration . I find it easy to export and generate graphs using pivot tables in excel.
The PS script above could you used to set up as scheduled tasks on a controller and set to run every 3 hours. This provides a way to archive the data as well as leaving the default retention values in Citrix.
Forked from Duo-PSModule by mbegan, added new Administrator Activation Link functions. this automates the provisioning process to the duo admin console and lets you create the account with just corp email whereas GUI forces you to enter temp password and require to key in the user’s phone #.
MSOnline PowerShell module is required to run this, the new AzureAD commandlets do not appear to have the strong authentication properties yet. Run the following PowerShell lines to load and connect to your Azure/o365 tenant.
Install-Module -Name MSOnline
Powershell snippet below gets all user from the tenant and expands StrongAuthenticationUserDetails property to retrieve the enrolled MFA info and further extends to extract default MFA method using PowerShell expression and saves it to c:\tmp\Azure-2FAEnrollmentReport.csv, using PS expression we were able to expand the second property in a single line.
Useful for the testing rewrites for /vpn/js/gateway_login_form_view.js [e.g. hiding the second password box when the radius is enabled]. Without clearing the cache you wouldn’t see your changes immediately.
SSH to netscaler and execute the following line, even though Integrated Caching is not enabled Gateway component of netscaler by default uses this feature.
Download the latest version of root ca list [SST] from windows update on a device that has network connection certutil.exe -generateSSTFromWU roots.sst
copy the sst file to the offline machine and use powershell to import the root ca list.
$sst = ( Get-ChildItem -Path C:\certs\roots.sst )
$sst | Import-Certificate -CertStoreLocation Cert:\LocalMachine\Root
In a case where you have two network interfaces, eg: 4G data card and local ethernet card connect to your device and you would like traffic to a specific destination to go via a preferred network interface, PS code below could guide you through it.
E.g ps code below shows the route to 188.8.131.52 to go through interface 4, this is done by setting a lower route metric than the other interface card.
# you can determine your adapters with Get-NetAdapter
# then you can see what routes are associated with what adapter interface (lets assume your wifi interface is 4 and your loopback is 1)
Get-NetRoute -AddressFamily IPv4
# you will get your specific interface index, destination prefix, nexthop and the routemetric
# you can then set a specific route policy using:
New-NetRoute -DestinationPrefix "184.108.40.206/32" -InterfaceIndex 1 -RouteMetric 256
New-NetRoute -DestinationPrefix "220.127.116.11/32" -InterfaceIndex 4 -NextHop10.1.1.1 -RouteMetric 0
# you can modify the configuration with:
Set-NetRoute -DestinationPrefix "18.104.22.168/32" -InterfaceIndex 4 -NextHop192.168.10.1 -RouteMetric 0
# finally, you can remove the specific route or all the routes with:
Remove-NetRoute -DestinationPrefix "22.214.171.124/32" -InterfaceIndex 1 -Confirm:$false
Remove-NetRoute -DestinationPrefix "126.96.36.199/32" -Confirm:$false
UserAgent mentioned in few blog posts in the past, checked it out last week and I fell it a good tool to have especially since they announced free community licenses – 100 users at the time of this writing. It offers some of useful metrics [few listed below]
break down of session login and logout durations
VM resource usage over time [cpu, memory etc..]
audit info on user session[s] over time[connect/disconnect/reconnect etc..]