Identify App-V 5 errors

App-V 5 has provided us with many granular logs to identify issues, but when troubleshooting there needs to be an overview of errors. For the last few days quite a lot of effort on my own part has been in browsing through the logs, so as opposed to manually traverse individual logs or filtering all of them we can leverage PowerShell to identify errors quite easily. The below piece of code will traverse all but one of the logs and quickly identify any errors.

#Nicke Källén – 2013-05-08
#Define App-V logs
$appvlogs = Get-WinEvent -ListLog *AppV* -Force
#Define start-time - suggested time yesterday
$starttime = (Get-Date).AddDays(-1)
#Define end-time - now
$endtime=[datetime]::Today
#Set Culture to en-US, otherwise Message goes blank
$orgCulture = Get-Culture
[System.Threading.Thread]::CurrentThread.CurrentCulture = New-Object "System.Globalization.CultureInfo" "en-US"

#Loop through all log-files
foreach ($log in $appvlogs) {
write-host “Log; ” $log.LogName
#Skip operational log as it most contains informational messages and is heavy
if ($log.Logname -ne "Microsoft-AppV-Client/Operational") {
#Select only errors (level = 2) and select time and message of the event
Get-WinEvent -FilterHashTable @{Logname=$log.LogName;starttime=$starttime;endtime=$endtime} -Oldest -ErrorAction SilentlyContinue| ?{$_.Level -eq "2"} | Format-List TimeCreated, Message
}}
# Reset Culture to orginal
[System.Threading.Thread]::CurrentThread.CurrentCulture = $orgCulture

App-V 5; Enable or disable all debug-logs

Been diving into the App-V 5 logs for a few days and got tired of enabling the debug and analytic log files. Made a small sample to enable them in a loop;

Enable all App-V 5 logs;

##Nicke Källén 2013-05-08
##Enable all logs
$appvlogs = Get-WinEvent -ListLog *AppV* -force | Where-Object {$_.IsEnabled -eq $false}
foreach ($logitem in $appvlogs) {
     write-host “Log enabled: ” $logitem.LogName
     $logitem.IsEnabled = $true
     $logitem.SaveChanges()
}
##Disable all logs
$appvlogs = Get-WinEvent -ListLog *AppV* -force | Where-Object {$_.IsEnabled -eq $true}
foreach ($logitem in $appvlogs) {
if (($logitem.LogName -ne "Microsoft-AppV-Client/Admin") -or ($logitem.LogName -ne "Microsoft-AppV-Client/Operational") -or ($logitem.LogName -ne "Microsoft-AppV-Client/Virtual Applications"))
{
     write-host “Log Disabled: ” $logitem.LogName
     $logitem.IsEnabled = $false
     $logitem.SaveChanges()
}}

No error handling is available, this is just a quick start to avoid loads of clicking.

(2013-05-05 – Added the Where-object to avoid getting errors…)

App-V troubleshooting–a common view of logs

App-V 5 has gotten rid of the previously used text-based format for log-files and now provides multiple event logs, some hidden under the “Show analytic and debug logs”, which can be reviewed individually to identify issues.

In reality, we are still talking about a log to catch an issue and since its an issue – it might be hard to know where to look. When we enable analytic and debug logs there are two steps to get the output. First, we enable the debug logs to see the in the tree-list;

image

Once they are visible, we need to enable them to get any output. And oh boy, there is a lot of them.

image

Each log can be enabled, individually. You will always have to enable a log to view it anywhere, and to avoid excessive usage of the logging functionality – recommended approach is to disable the debug-logs once the troubleshooting scenario is completed.

So now there are X amount of individual event logs that we can jump between in order to identify what happens. Lets try to combine them into one common view – something that will make life easier;

image

We now have the option to select a few criteria to which can combine events from any log to a common view – allowing us to view a common timeline of all events.

image

App-V does provide us with a lot of logs (which is great!), so once we click OK – we get this warning;

image

Finally – we can name our view;

image

Now we have a custom view that have joined all the App-V events into a single view! Great for tracking in a difficult situation!

Teamviewer 8, Licensing and App-V

If you sequence Teamviewer 8 with App-V 4.X there has previously been a recommendation to use the portable version to allow an easy path. The steps are outlined in a post on Appvirtguru and can be followed by anyone. As an alternative – you can use the traditional install, with a few recommendations that will ease the path forward.

As always – use MSI-files as the primary source for any installation. Retrieve Teamviewer MSI-files here from teamviewer.com

Pre-sequencing

Perform a traditional installation and setup your configuration. Once the setup is completed and all the configurations are as you like them – export them using the Advanced options;

image

Choose Export options to a *.reg-file and also choose to include your licensing information.

Name the file TeamViewer_Settings.reg and place it in the same folder as the Teamviewer MSI-file.

This will be your installation-kit.

Sequencing

Initiate the sequencing process and install the MSI-file for the Teamviewer Admin. Do not start the Teamviewer during the sequencing process at any stage.

Post-sequencing

The below registry key is part of the export performed in the pre-sequencing steps. You can extract that and insert it into the package. My recommendation is to set this within the OSD-file to ensure that its always present. There is no value here, this has to be retrieved from your own export.
The below key is from a 64-bit system


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432node\TeamViewer\Version8]
"LicenseKeyAES"=hex

European App-V User Group 2013 – video #1

There will be more videos, unfortunately not as many as we would like. Here comes the first promo for the European App-V User Group;

European App-V User Group 2013