PowerShell: Friday Script Blitz 2

scripts-powershell-scripts-everywhere

Intro

In my current position I’m getting to do a lot of PowerShell scripting. Typically these are quick scripts for maintenance or finding information about our Citrix environment. I’m posting several here to share.

NOTE: These scripts were written against a XenApp 6.5 environment

check-deedrive.ps1

Iterates though all XenApp Servers in the farm and checks that the D: drive is formatted. I wrote this because we found some existing provisioned servers that had unformatted D: drives attached.

Get it from GitHub

count-usrprof.ps1

Iterates though user’s profile directories and counts number of files in specified sub directory. It produces a CSV report (if the file count is above a threshold you set in the script) and also counts the total number of profiles. Useful for confirming your profile management solution is working as expected.

Get it from GitHub

clean-crashdumps.ps1

Iterates though a list of servers and reports on crashdumps. EdgeSight and Windows can collect crashdumps and if you don’t clear them off, the accumulate. This script will generate a CSV report and delete the dumps if the -delete switch is included.

Get it from GitHub

Thanks for reading,
Alain

PowerShell: Get XenApp Load and Create Report (Again)

load2.jpg

Intro

Nostalgia is ruling movies and TV these days. Mystery Science Theater 3000 has returned from the dead to Netflix. I’m still getting through he first episode, so I’m still withholding judgement. In the spirit of going back to the well and rehashing old ideas, I’ve revisited my XenApp Load/Report script again.

Changes

  • I’ve moved the code to my Github account
  • I’ve removed the Logon Status column and replaced it with the server’s worker group
  • I’ve sorted the report by the Worker Group
  • I fixed the formatting to display all the columns even if the first server was down. Before, if the first server queried by the script was down, then only the servername and status would show for all servers.

The Report

The report can be generated and sent to your browser of choice (the script defaults to Internet Explorer). In addition, you can set the SMTP information in the script have have it emailed.

load1

The Script

Get the script from Github

WEM: Notes From the Field 1

picard_wem
Intro

In September 2016, Citrix announced the purchase of Norskale. Now dubbed Workspace Environment Manager (rolls off the tongue :)), Citrix has a powerful tool that provides system optimization along with user environment control. I’m implementing a small VDI solution utilizing this new tool and these notes are primarily for me and others to note some particulars of this product.

Registry

They always say RTFM, but I was pressed for time and only dived into the installation guide for WEM 4.2. While attempting to apply settings to the registry I became more and more frustrated because nothing was happening. I finally went back to the Citrix Docs and found out my issue.

When you apply registry settings in WEM they ONLY affect Current User Registry entries:

Target Path. The registry location in which the registry entry will be created. Citrix Workspace Environment Management can only create Current User registry entries, so you do not need to preface your value with %ComputerName%\HKEY_CURRENT_USER\ this is done automatically.

wem1

WEM Sites

You can create any number of WEM sites to manage your environment. They can be OS specific, user specific or just separate to test changes in an acceptance environment before making the changes in production.

In the home tab of the WEM Console, there are import export buttons

wem2

Exporting actions will allow you to export any settings you have under the Action pane

wem3

Exporting Settings will export settings under the System Optimization, Policies and Profiles, Transformer Settings, and Advanced Settings panes

wem4

Now here’s the rub. The following items are not exported:

  • Filters
  • Assignments
  • Configured Users
  • Administration

You will have to redo these settings yourself. Luckily, you can easily switch sites can compare settings

That’s all for now. More to come as I dive deeper into WEM.

Thanks for reading,
Alain

A hard, rough, abrasive look at camel spotting…no dromedaries…no virtualization.

%d bloggers like this: