Friday, February 28, 2014

Microsoft Access 2013 on Server 2008 R2 SP 1 remote access through XenDesktop Screen Freeze

Solution

New Solution:

"Legacy Graphics Mode" is an option is Citrix Policy. Enabling this for the desktop group will stop Access from freezing, and doesn't break 'browse' 'save-as' etc. Unsure exactly what legacy graphics mode does, still trying to get someone to answer that for me, or why it doesn't work in the first place, but this is a less bad work around.


Appears to be some visual theme here that messes up the ICA connection. The "fix" - probably more of a workaround - is to run the program in compatibility mode (don't forget to set for all users). You'll want to select compatibility mode for windows 7 + disable visual themes.

Edit: People on Citrix forums claim that this effects office 2010 as well; I can't confirm that it does, or that this fix works for 2010 if the problem does exist, but there you go.

Warning: This workaround has been found to cause some other undesirable behavior. Notably: "browse" buttons will no longer launch the file browser to allow you to select files. This effects a number of things such as the "save as..." feature and "import from (excel/text/etc)" wizards. This is arguably less detrimental than the screen freeze but please be aware.


The Problem / Full story

As you may guess from the title, this is an insanely specific bug that we ran into in one of our labs. Students were trying to use MS Access (because we teach that for some reason) and their sessions kept on locking up. Here's the sequence of events:

Users log into Wyse Xenith 2 thin clients connecting to a 2008 R2 SP 1 terminal server type environment through XenDesktop (Citrix seems to refer to it as ServerOS connection, or Shared Published Desktops). This works great.

Users then open Access and everything seems to be working fine, but when they try to open a table in design view the screen freezes after a few seconds. At this point the machine is completely unresponsive, the mouse still moves, but no mouse clicks or keystrokes appear to have any effect.

I say "appear to have any effect" because they actually do the user just can't see them. If I use lanschool to remotely watch/control the user's session I can see them clicking around and typing things, and when I control I can interact with the session just fine; The user cannot see anything changing on the screen. It's totally bizarre. 

The only way I've found to restore functionality is to remotely log the user off so they could log in again. 

The really weird thing is that none of the factors individually cause the problem. Using Access on the same server but over remote desktop (RDP) works just fine. Using Access on a windows 7 machine over xendesktop works just fine. No other program I've used on the server over XenDesktop has exhibited this behavior.

I figured out the workaround above pretty much by trial and error. Then figured out the correct solution from citrix forums; Yay citrix forums!


Adventures in Powershell: User account locked out continuously

One problem we run into from time to time is when a user's account keeps getting locked out without any obvious reason (They're not typing in the password wrong - though this is probably the number 1 cause). Usually this is the result of some saved credentials somewhere that are no longer valid; They've expired, or there was a password change, or something. However, if the user logs into multiple machines, or has network resources mapped to a personal device, it can be really hard to tell where the bad login attempts are coming from.

So I wrote a neat little powershell function to help out with this. Bad log on attempts are logged in the domain controllers security logs. However, for various reasons, they can be really hard to find (reasons include username not being in the username field, and domain controller security logs having about a billion events at any given time). This powershell function does a little WMI call to each domain controller you specify and looks for these events so you don't have to.

It's a little messy and slow, but can save a great amount of time whenever these events come up.

I've put in some Get-Help features to which explains how to use it. After you import it run "Get-Help Get-WhyIsThisAccountLocked". Or alternatively just read the first 30 lines or so of the code.


The code:
function Get-WhyIsThisAccountLocked
{
    <#
        .SYNOPSIS
            Querys Domain Conrollers for specific log events looking for failed kerberos authentication.
        .Description
            Method can be used to discover where a specific account is being locked out from. This will return a list of log events related to failed authentications which you can use to further troubleshoot. Because of how these events are formated, it is difficult to select specific information out of them - So this returns the whole event. The important fields to look for are 
            AccountName: (verify it returned the correct user - for various reasons it only does a 'like' comparision here)
            Client Address: (Where the bad requests are coming from - note you will probably see some coming from the domain controller(s) - unless the user is acutally tying to log into/acess the domain controller, you can ignore these.)
            Failure Code: (Tells you more about what sort of authentication was being attempted - google "kerberos autentication failure code")
            Service Name: (Can tell you what service was trying to use the account - krbtgt/domain is typically standard login attempt, if it's something else, google it)
        .PARAMETER UserID
            UserID that is being locked out
        .PARAMETER DomainController
            Domain controller(s) to query for event logs. This may be either a single hostname/IP or a comma seperated list.
        .PARAMETER HoursBack
            Number of hours back to search, default is 1. Using large search periods can exponentially slow down the script.
        .PARAMETER OutFile
            File path to output text to - default is to output to command window
        .PARAMETER YesIAmSure
            If OutFile is specified, does not ask to confirm file write/overwrite. Otherwise does nothing.
        .Example
            Get-WhyIsThisAccountLocked -UserID myuser -DomainController "mydomain1,mydomain2" -HoursBack 2 -OutFile c:\temp\output.txt -YesIAmSure
        .Notes
            Author: Keith Ballou
            Date: Feb 28, 2014


    #>
       [CmdletBinding()] 
       param( 
      [Parameter(Mandatory=$true)][string]$UserID,
      [parameter(Mandatory=$true)][string]$DomainController,
      [Parameter(Mandatory=$false)][int]$HoursBack=1,
      [Parameter(Mandatory=$false)][string]$Outfile,
      [Parameter(Mandatory=$false)][switch]$YesIAmSure
)
       $ListofEvents=""
       $SearchTime=(get-date).addhours(-$HoursBack).touniversaltime().tostring("yyyyMMddHHmmss.000000-000")
       Write-Verbose "Searching between $SearchTime and Current Time"
       $ListofDCs=$DomainController.split(',')

       if ($HoursBack -gt 1)
       {
        write-host "WARNING: Using Larger Serach periods can cause this script to take a very long time" -ForegroundColor "Magenta" -BackgroundColor "Black"
       }

    foreach ($DC in $ListofDCs) 
      {
        write-host "Querying... " $DC
        $Temp=Get-WmiObject -ComputerName $DC -Query "Select * from win32_ntlogevent Where LogFile='Security' AND (Eventcode='4771' OR Eventcode='4769') And Message Like '%$UserID%' AND timegenerated > '$SearchTime'"
        foreach($Entry in $Temp)
        {
            Write-Verbose "Processing Entry" 
            $ListofEvents+="-------------------------------------------------------------------`n"
            $ListofEvents+=$Entry.ComputerName + "`n" 
            $ListofEvents+=$Entry.Message + "`n"            
        }
    }
       
    if($OutFile -ne "")
    {
        write-host "`n`nWarning: About to write to $OutFile - This will overwrite any existing data" -ForegroundColor "Magenta" -BackgroundColor "Black"

        if($YesIAmSure)
            {
                out-file -InputObject $ListofEvents -FilePath $OutFile
            }
        else {
            {
                out-file -InputObject $ListofEvents -FilePath $OutFile -Confirm
            }
        }
    }   

    else {
        write-host $ListofEvents
    }
    

}

Tuesday, January 28, 2014

XenServer Upgrade 6.0.2 to 6.2 : the vm is incompatible with the cpu features of this host

The Solution

In my case I ended up needing to force the VM migration via the command line on each server. From xencenter, connect to the host that you're getting the error on and bring up the console. Enter the following command.

xe vm-migrate host=<xenserverhost> force=true vm=<vmname>
#<xenserverhost> is the host you're migrating to - should be the one of the ones that has already been updated. You're not allowed to migrate to an un-upgraded host, so forcing it to do so could break everything. Be careful.
#<vmname> is the name that shows up in xencenter, there's also an option to do it by UUID

This will force the machine to migrate to the new host. Keep in mind I am running this in a homogeneous environment, so I had some assurance that compatibility wasn't going to be an issue. If you're running on non-homogeneous hardware you'll probably want to test with a non-critical (or at least less critical VM) before you start migrating everything.

The Cause/Full Story

Upgrading servers is always a time and a half. One of the reasons I like Citrix XenServer is the ability to do rolling upgrades on server pools without shutting down any VMs. It works great in theory, but theories are flimsy things because they exist on paper - a substance not known for ability to withstand stress (slightly tortured analogy).

I ran into a problem today upgrading some of my XenDesktop VM hosting XenServers from version 6.0.2 (+ various updates) to version 6.2. This version (and indeed all versions back to 5.6) are supposed to be compatible with the rolling upgrade feature in xencenter. 

I made all the backups, and followed all of the "before upgrading" steps listed in the guide, then started the install using the rolling pool upgrade wizard in xencenter. 

The first server (the master) went great. All the VMs migrated off the server, everything installed and it came back up just like it should. However when I went to start the second server update, none of the VMs could migrate off with the error "the vm is incompatible with the cpu features of this host"

Which was bull, since most of the VMs had just been running on that server, and were currently running on a server that was identical hardware. So after a bit of googling I found the follow commands.

xe host-cpu-info
xe host-reset-cpu-features
xe host-set-cpu-features

Running the first command on the upgraded server and an non-upgraded server I could see that the CPU feature set had changed (for some reason). I tried the second command, to see if resetting would work, but even after a server reboot the feature set was the same. I tried manually setting the feature set using the third command. That seemed to work, the "feature set after reboot" changed to the correct feature set. However after a reboot the feature set had not actually changed. 

Running low on options I went to the command line to try to migrate (GUIs are for babies, etc. etc.). Trying to migrate the servers manually using the "xe vm-migrate" command yielded the same error. But running xe help vm-migrate showed me there was a "force=" parameter I could set.

Luckily I had a few currently-not-in-use VMs I could use to test. The test machines were able to migrate using the force option. I was able to force migrate all of the VMs without any crashes or other problems. After this I was able to finish the upgrade on the other pool members. For the record these were all windows 7 machines (and one server 2008 R2) with the 6.0.2 XenTools installed.




Thursday, January 16, 2014

Setting up Wyse Xenith 2 as an Information Kiosk: Part 2

Previously: Setting up Xenith 2 Kiosk Part 1

And now for the long awaited conclusion to the epic story of setting up the Wyse Xenith 2 as an information kiosk. Reasons for the long delay between segments range from "really busy with end/beginning of semester stuff" to "couldn't be asked".

So today we'll be going over setting up of the web browser (chrome) in kiosk mode, getting everything to start automatically through logon scripts, and preventing users from accessing unauthorized websites.

Setting up Chrome in Kiosk Mode

This is actually really easy. Simple run from the command line (or append to the end of a shortcut command) <pathtochrome>/chrome.exe --kiosk. This will start chrome in kiosk mode, which will give user no access to the URL bar or any chrome settings. The key redirection we set up previously will insure users are unable to escape from the chrome window, or access any chrome console/debug windows/etc.

At this point you'll also want to set the homepage to whatever information page you want users to see first.

I choose chrome because it's easy to setup for a kiosk and some of the other extensions will be useful for website blocking. If you want to use another browser you may be able to find extensions/plugins to make it work.

Logon Scripts

The next thing we need to do is make sure everything starts when the user logs in. Having an auto-login thin client is pointless if you have to go start all of the software manually.

There's a few different ways you could handle this, and they way I did it is almost surely not the most efficient. The issue I ran into trying to combine everything into one script is that windows would not execute both commands simultaneously. It would run the chrome launch command, then wait for chrome to exit before running the auto hot key command. So here's what I did.

In group policy under users>policies>windows settings>scripts>logon create two separate scripts. One will be to run chrome, the other to start autohotkey with the appropriate script. They will look something like this

program: c:\windows\system32\cmd.exe
parameters: /C "\\this.is.my.domain\SysVol\this.is.my.domain\Policies\{AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA}\User\Scripts\Logon\launchchrome.bat"

program: c:\windows\system32\cmd.exe
parameters: /C "\\this.is.my.domain\SysVol\this.is.my.domain\Policies\{AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA}\User\Scripts\Logon\launchAHK.bat"

The contents of the batch file will look something like this:

LaunchAHK.bat
"C:\Program Files\AutoHotkey\AutoHotkey.exe" "\\this.is.my.domain\SysVol\this.is.my.domain\Policies\{AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA}\User\Scripts\Logon\DisableKeys.ahk"

Launchchrome.bat
"C:\Program Files\Google\Chrome\Application\chrome.exe" --kiosk


Blocking users access to other websites

The easiest way to handle this is to craft a special web page for the kiosk that doesn't have links to any external sites. Because kiosk mode keeps people from accessing the URL/search bar, this will effectively block non-authorized usage.

However, if you (or your web guys) don't have time to setup a special website, there are other options.

The first, and most cumbersome is using windows firewall. Setting up firewall rules can allow you to block/allow certain IP addresses. However, this method cannot limit based on URL; so if a website has a non-static IP, or there are some pages on a website you don't want users to have access to this method will be insufficient. 

Luckily there are chrome plugins to do the job.  The one I ended up using was Whitelist for Chrome because I needed to allow access to our companies public site and block everything else. After installing the plugin all I had to do was add *.my.company.com to the whitelist and we were all set. 

Actually, I did use firewall to block access to a few web authentication servers, just to prevent employees from logging into their personal stuff from the public terminal. 

Conclusion 

So with all of that, you should be all set. A few things I have found out since I started writing this guide.

Nightly Reboot - If a user clicks a link that opens in a new tab/window the new tab/window will open but since it's in kiosk they won't be able to close it. This isn't much of an issue from a usability standpoint but can cause chrome to start taking up all system resources if left unmanaged for too long. I setup a nightly reboot to clear out everything. Note that you need to reboot the thin nightly as well (possible to set this up in the Xen.ini file) so that it reconnects after the vm reboots.

Screen Saver - The people I set this up for insisted that the machine not go to sleep. This makes sense from a usability standpoint; a kiosk is more approachable if there's something on the screen. However when had burn in (low end LCD monitor) within about a month of it being on ~24/7. So if you have similar requests find a way to do some sort of screen saver.

Well that's that. Post in the comments if you have any questions.

Wednesday, January 15, 2014

Adventures in XenDesktop 7 Powershell/SDK : Getting a full list of users/machines from an access policy

The Command You're Looking For

Get-BrokerAccessPolicyRule -name "<groupname>" | % {$_.<property>}

Example: Get-BrokerAccessPolicyRule name "mygroup_direct" | % {$_.includedusers}

This returns the full list of all included users/groups in the "mygroup_direct" rule.

Explanation

I've been working with get/set-brokeraccesspolicyrule a lot lately. It's super useful for managing what users have access to what desktops from what machines, in a much more exact way than is possible through the studio application.

It's allowed me to do some really nice things from a user experience standpoint, which I may elaborate on a little later.

One big problem I've been running into was getting information back out of these. For instance, I've got some ACLs (APRs?) set based on user AD Group membership. These work fine, but if I add a bunch, then want to double check which groups I've added, it's not quite so straight forward.

Running a command like : Get-BrokerAccessPolicyRule -name "group_direct"

returns this:

ExtensionData                    : System.Runtime.Serialization.ExtensionDataOb
                                   ject
AllowRestart                     : True
AllowedConnections               : NotViaAG
AllowedProtocols                 : {HDX, RDP}
AllowedUsers                     : Filtered
Description                      :
DesktopGroupName                 : <redacted>
DesktopGroupUid                  : 2
Enabled                          : True
ExcludedClientIPFilterEnabled    : False
ExcludedClientIPs                : {}
ExcludedClientNameFilterEnabled  : True
ExcludedClientNames              : {<redacted>}
ExcludedSmartAccessFilterEnabled : False
ExcludedSmartAccessTags          : {}
ExcludedUserFilterEnabled        : False
ExcludedUsers                    : {}
IncludedClientIPFilterEnabled    : False
IncludedClientIPs                : {}
IncludedClientNameFilterEnabled  : True
IncludedClientNames              : {<redacted>client1,client2,client3,client4.
                                   ..}
IncludedSmartAccessFilterEnabled : True
IncludedSmartAccessTags          : {}
IncludedUserFilterEnabled        : True
IncludedUsers                    : {<redacted>group1,group2,group3,group4,...}
MetadataMap                      : {}
Name                             : <redacted>_Direct

Uid                              : 1002

As you can see several of the sections get cut off with a "...". This is super annoying if you're trying to verify that all the groups you think you added are actually there. My typical approach here is to run a command to only display the field I'm looking for so it doesn't get cut off, something like this:  Get-BrokerAccessPolicyRule -name "group_direct" | select includedusers

This doesn't work here though, it returns the same cut off list. After a lot of playing around I finally found what works (See The Command You're Looking For above). It's a simple command, but it's a strange way of having to get information out of the system. Using that command you get output like this:

ExtensionData : System.Runtime.Serialization.ExtensionDataObject
FullName      : <redacted>
Name          : domain\group1
SID           : S-1-1-11-11111111-111111111-111111111-11111***
UPN           :

ExtensionData : System.Runtime.Serialization.ExtensionDataObject

FullName      : <redacted>
Name          : domain\group2
SID           : S-1-1-11-11111111-111111111-111111111-11111***
UPN           :

ExtensionData : System.Runtime.Serialization.ExtensionDataObject

FullName      : <redacted>
Name          : domain\group3
SID           : S-1-1-11-11111111-111111111-111111111-11111***
UPN           :

This information is far more useful, and can be selected,filtered, and sorted from here.

Tuesday, October 29, 2013

Turning a Wyse Xenith 2 into a Web Kiosk

Introduction


Designing a computer kiosk, where people can walk up and access a set of information online without being able to access all websites, is an application that seems tailor made for a thin client. Low power usage, remote management, no data stored locally - these are all things you want when you're deploying a computer in a public area. However, locking down the machine -- Xenith side and windows side -- can be tricky. Here's a quick guide to get you going





A Dedicated User


The first thing you need to do is setup a user account that will you can use for the kiosk. You'll need the machine on the domain, but presumably most users accessing an information kiosk are not going to have a logon to your domain.

So create a user, and give them logon access only to the Kiosk VM(s). You'll also want to make the password something totally unrelated to any other password you use on your systems. While I haven't found a way to extract the password for the Xen.ini auto logon, I'm sure it's possible; it pretty much has to be passed to it/stored in cleartext.





Locking down the Thin-Client - Xen.ini config


Note: These configurations are done on Firmware 2.0_104 - mileage may vary on different firmware

Beyond the usual lock-down you'd have on any thin client, there's a few special configurations for the Xen.ini file you'll want in a Kiosk environtment

USB Devices


You probably won't want users to be able to plug in USB devices to the Kiosk - all sorts of bad things could happen, and there's really no reason to have it in a kiosk. Physical security goes a long way here (have the thin client in a locked cabinet where users can't access it) but you can disable forwarding of USB Devices through Xen.ini as well. It'll look something like this; disabling sound is optional.

SessionConfig=ALL unmapprinters=yes unmapserials=yes disablesound=yes unmapusb=yes unmapclipboard=yes

 Auto Login


As I mentioned, users accessing a public information kiosk probably won't have credentials for your domain. This means you'll have to log them on automatically with the generic user. This will make the thin-client invisible to the user, and prevent domain users from logging in with their accounts. The configuration will look like this
Signon=Yes 
DefaultUser=kioskusr
Password=asupersecurepassword 
    DomainList="yourdomain"

 Disable Thin Client Lock


You won't want users to be able to lock the terminal - since your target audience won't have any idea what the password is. So you'll want to disable the key sequences that can lock the terminal.  

 Note: There seems to be a bit of a bug with the key sequences config. According to the documentation, all you should need is "KeySequence=No" in my testing that doesn't work you must user the following.

KeySequence=yes ctrl+alt+down=no ctrl+alt+left=no ctrl+alt+right=no win+L=no

Other Considerations

Those are all of the configurations I made special to Xen.ini for a kiosk. However, your default Xen.ini may be less locked down than mine, so here's some other configs that will probably be necessary.
  • Disable G key reset: "EnableGKey=no"
  • Lockdown Thin: "Privilege=None, LockDown=yes"
  • Disable that annoying system beep: "Device=audio mute=3"





XenDesktop Setup


Note: This setup is on XenDesktop 5.6 - setup may differ (and in fact does) on different versions.

I won't go through the process of setting up machines on XenDesktop. If you haven't created machine pools and delivery groups yet, you're reading the wrong guide. This is just a quick note to show how to assign a VM to specific thin-client. This works better than assign a VM to the kiosk user, because it prevents the kioskusr account from being used on other thin clients.

Full information can be found On Citrix's Support Site. From PowerShell on the DDC, run the following commands - replacing "domain\machine" with your kiosk machine name, and the IP with the address of your thin client.

Add-PSSnapin Citrix.Broker.Admin.*
Set-BrokerPrivateDesktop DOMAIN\MACHINE_A -AssignedIPAddress 10.11.132.7






Windows Customization/Lockdown

Locking down windows so that users cannot get out of the Kiosk mode is key. You don't want users to be able to access any files or other programs on the machine. Optionally you'll also want to restrict web browsing so that users cannot access things like facebook,news sites, or any inappropriate content. For this example I am using Google Chrome because it has a built-in kiosk mode and a bunch of add-ins that make it easier to restrict web browsing.

Some of these precautions are redundant, and you may be able to make a secure environment with just some of them. My goal was to create a system that was easy to manage while being escape-proof, so there's generally a reason for the redundancy.

Disabling CTRL+ALT+DELETE

The most difficult thing to disable on windows is the ctrl-alt-delte sequence; however it is necessary to disable this so that users cannot use it to escape the kiosk mode. The ctrl+alt+delete sequence is embedded deep in the windows operating system and, because it is a security concern and would break normal usage, cannot be disabled through conventional means. The only way to disable is to stop the interpreting of the ctrl,alt, and delete keystrokes (or at least ctrl, and alt). To do this, we must re-write the scan codes for those keys in the registry. I won't go into much detail here, because the article I'm linking does a pretty good job of explaining how to do this, and how it all works.

Don't reboot the machine after you apply this before reading the next section.

With that, enjoy this wonderful article

Removing the CTRL+ALT+DELETE for Logon

The most notable thing disabling ctrl+alt+delete does is break the logon process. If you can't press ctrl+alt+delete to logon, you're going to lock yourself out of the machine. Even XenDesktop utilizes this (it has to) so we need to turn it off.

So in keeping with the spirt of just linking to other sites, here's the Microsoft KB article on how to disable the "require ctrl+alt+delete for logon" feature.

Using AutoHotKey to reassign keys

The northcode article on remapping keys in the registry does a good job of disabling most of the problem keys that allow users to escape from a kiosk mode. It doesn't get all of them though. Notably F1, which usually brings up help menus, and right-clicking, which brings up all sorts of difficult-to-manage context menus. Now, we could add this through the scan code method above, but I find it more useful to use the program AutoHotKey (ahk) to do some remappings. This is because it is far easier to manage and more humanly readable, and because it is simple to remap things to something other than nothing.

Example
Sendmode Input
SetTitleMatchMode 2

F1:: Send {Browser_Home}
F9::.
RButton::.

The first two lines just configure some settings for the AHK program, you can read more about what they do specifically on the AHK website (Sendmode Input | SetTitleMatchMode). The next line re-binds the F1 key to the browser home button. This is useful because the home button will be hidden in Kiosk mode, and the normal home-button hotkey (alt+home) will be disabled.. The other two lines rebind F9 and the Right mouse button to do nothing. You can read a whole list of keys/rebindings here on the AHK website. 

I rebound all of the Fkeys and most shift+key shortcuts (user's can fill out forms on my kiosk, so disabling the shift key all together is not practical).

Using AutoHotKey as an Idle Timer

Generally when you have a kiosk, it is in a public area. So you'll probably want a nice welcome page to greet each new user. Since the users can hardly be expected to go back to the home page themselves when they are done, we need a way of detecting when a user has walked away from a kiosk, and sending the browser back to the home page. It turns out this is pretty simple to do with AutoHotKey.

Loop
{
WinActivate Chrome

if A_TimeIdle >= 90000
{
Send {Browser_Home}
}

Sleep 3000
}

This starts an infinite loop that checks how long a user has been idle every 3 seconds. The WinActivate Chrome line is another bit of security. Sometimes when the thin auto-logs-in, the taskbar is visible - that is chrome is not the active window; so someone resetting the thin client could theoretically escape the kiosk mode. This command forces chrome as the active window if it is not currently. Because it does this every three seconds, it also adds security because it means someone won't be able to do much if the user finds a way to alt-tab out of chrome.

A_TimeIdle is a system variable in AHK, it automatically keeps track of how long it has been since the last mouse/keyboard input. In my script, if there hasn't been any input in 90 seconds (90000 milliseconds), it resets to the home page. I choose A_TimeIdle here rather than A_TimeIdlePhysical (which detects only physical mouse/keyboard input, not input from programs/scripts) because otherwise after 90 seconds it would refresh the page every 3 seconds. Using A_TimeIdle, when the Send {Browser_Home} command is sent, it detects that as input, and resets the counter; it will wait another 90 seconds before refreshing again.

The last line is just a simple wait command that prevents the loop from running too quickly and hogging system resources.

Another way I found works, if you want to check for idle more often, but not have the page refresh constantly, is to run the check, but then set a delay after the first refresh. For example, This Script checks every 30 seconds, but then waits 2 minutes after it detects idle before it checks again.

Loop
{
WinActivate Chrome

if A_TimeIdle >= 30000
{
Send {Browser_Home}
 Sleep 120000
}

Sleep 3000
}


I'm realizing this post is probably already waaaay too long, so I'm going to arbitrarily cut it here. Stay tuned for next installment where I'll detail setting up chrome in kiosk mode, setting up startup/login scripts, and restricting user access to unauthorized websites.

Next part is up!

Tuesday, October 1, 2013

"Display" pane for SAP analysis for Microsoft Excel 1.4 Doesn't open.

I've been having ever so much fun getting pre-office 2013 add-ins to work in Excel 2013. For the most part adding them to the XLSTART folder in the office install directory (so they load automatically with excel) has fixed the problem. This only really works with XLA/XLAM type add-ins though. The last couple of days I've been working with one that launches via an exe and shows in excel as a .dll.

The add-in is "Analysis for Microsoft Excel" version 1.4, it's an add-in associated with SAP. The add-in is launched via an executable (BiSharedAddinLauncher.exe) and shows up in excel > file > optionas > add-ins> as a .dll (bishared07addinshim.dll).


The Short Version


The problem ended up being the start page (the new office 2013 thing that displays a bunch of templates and adds extra clicks before you can actually get work done). Disabling the start page (through group policy, you'll have to download/"install" the office 2013 ADMX files from microsoft) allowed the add-in to load properly.


The Long Version


So when we tried to launch the add-in on most computers (worked on some, which was weird) we would see the add-in load, and the appropriate tab on the ribbon would appear. Most functions would also work. However trying to open the "Display" pane didn't work. The icon would light-up like it was open, but the panel would never show up. 

This problem occurred on windows 7 x86 with office 2013 x86 and on a windows 2008R2 with office 2013 x86 running RDS. 

After much reinstalling (including the entire office suite) I finally found that launching the add-in once excel was already open (file > options > add-ins > com add-ins > go ) worked. This suggested that, for whatever reason, the add-in was not fully loaded when it was launched at the same time as excel. Obviously, adding the add-in in this manor each time you wanted to use it would be much less convenient that clicking the executable from the start menu. 

On a whim, a whim fueled mostly by my hate of the start page, I decided to disable the start page and low-and-behold the problem stopped. The add-in and all of its features work like they're supposed to. I can't imagine why the start page in excel would keep an add-in from loading properly. 

Oh, on a semi-related note, the "excel is not the current default program for all spreadsheet files" dialog also blocks add-ins from loading; blocks them entirely, they never load, you have to click  "don't show this again" and re-launch the add-in to get around it.