Wednesday, November 15, 2017

Quickly find uninstall GUID of product in Programs and Features

Ever get tired of digging through the registry HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall and HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall keys searching for a product?  Luckily, there's a much faster way to find the GUID, simply run the following command--in this case, we are searching for the Symantec uninstall string:

wmic product get | findstr Symantec

Though the formatting of the result is off, it's still quite easy to locate the GUID and proceed to uninstall the product like so:

msiexec /x {guid}

Thursday, November 9, 2017

Skype for Business / Lync 2013 Outlook Properties Dialog Implementation

Since the advent of Office 2013, I've been increasingly frustrated with the new Outlook contact cards, and the round-about way needed to access the legacy GAL properties dialog as shown below:

After a ton of research, I discovered it's possible to add custom context menus within the Lync 2013 / Skype for Business client, as per this page from Microsoft.  From here, I needed to discover the API necessary to actually launch the legacy GAL properties dialog box.  Doing a bit of research, I simply could not find an easy way to do this, the only thing I was coming across was the following registry key, which just launched the GAL properties box from within Outlook:

DWORD: TurnOnLegacyGALDialog
Value: 1 (enable)

Nearly giving up after hours of digging through the API and searching, I was provided some help via Dmitry Streblechenko on StackOverflow (thank you, Dmitry!).

In the end, I ended up with a simple VBS and registry key:

If WScript.Arguments.Count = 2 Then
                Dim objOutlook : Set objOutlook = CreateObject("Outlook.Application")
                Dim objNamespace : Set objNamespace = objOutlook.GetNamespace("MAPI")
                Set objOutlook = Nothing
                Set objNamespace = Nothing
End If

Windows Registry Editor Version 5.00

"Name"="Outlook Properties"
"Path"="C:\\\\windows\\\\System32\\\\wscript.exe C:\\\\temp\\\\LaunchGALProp\\\\LaunchGALProperties.vbs \"%user-id%\" \"%contact-id%\""
Boom!  After restarting Skype for Business, I was treated with the following view:

It's quite unfortunate that Microsoft removed this functionality within the newer versions of the Lync/Skype clients, but at least with a little bit of elbow grease I was able to recover it...for now.

UPDATE 04/29/2019:

It appears that the "wscript" command is no longer working (for some reason).  I was able to workaround this by creating a C# project with the following source code:

using System;

namespace LaunchGALProps {
class Program
static void Main(string[] args) {
if(args.Length == 2)
dynamic objApp;
dynamic objNamespace;

objApp = Activator.CreateInstance(Type.GetTypeFromProgID("Outlook.Application"));
objNamespace = objApp.GetNamespace("MAPI");


If you do not have Visual Studio installed, but you DO have .NET v4+ installed, you can compile the application like so:

C:\Windows\Microsoft.Net\v4.0.30319\csc.exe /out:LaunchGALProps.exe Program.cs

After my program was compiled, I was able to update my registry key values for ApplicationInstallPath and Path -- once this was done everything was working again.

Friday, July 14, 2017

Find All Servers in OU Utilizing dsquery

Recently at work I needed to pull all servers from a specific OU and Get-ADComputer was not working for some reason.  I didn't feel like taking the time to figure it out so I just reverted back to handy dsquery:

dsquery * OU=Test,DC=contoso,DC=local -scope subtree -limit 999999999 -filter "(&(objectClass=Computer)(objectCategory=Computer))" -attr sAMAccountName operatingSystem

Wednesday, July 12, 2017

JavaScript Convert String to Bytes Function

Just wanted to post a quick JavaScript convert string to bytes function just for myself, but I figured someone else may find it useful:

function convertToBytes(str) {
     var bytes = [];
     for(var i = 0; i < str.length; ++i) {
          var charCode = str.charCodeAt(i);
          bytes = bytes.concat([charCode & 0xff, charCode / 256 >>>             0]);

     return bytes;

And my slightly improved, ES6 compatible version:

function convertToBytes(str) {
     var bytes = [];
     Array.from(str).forEach((char) => {
          var charCode = char.charCodeAt(char);
          bytes = bytes.concat([charCode & 0xff, charCode / 256 >>>             0]);

     return bytes;

That funky bytes concatenation line simply enables the function to work with Unicode characters.

All credit goes out to BrunoLM at StackOverflow.

Monday, December 14, 2015

Microsoft KB 3109103 Breaks WebSockets

Recently my gulp live reload broke like so:

ws://x.x.x.x:8080/LiveReload' failed: Error during WebSocket handshake: Unexpected response code: 200

Even though nothing changed, I noted patches had been installed over the weekend.  After looking through which files were updated, I noticed that KB 3109103 patched Wshrm.dll.  I was unable to find much useful information on this DLL, but after looking into the description it appeared to have a lot to do with sockets:  Windows Sockets Helper DLL for PGM.

After removing the update & rebooting my web sockets started working again.

Wednesday, December 2, 2015

MSI Installation Failure - 1328. Error applying patch.

Wow this one killed me.  After attempting to determine why I simply could not install Adobe DC with our package from enterprise (though only on certain machines) I really had to dig into this one.  The package would first fail with a generic:

Product: Adobe Acrobat DC - Update 'Adobe Acrobat DC (15.006.30060)' could not be installed.  Error code 1603.

Knowing that this is a very generic error code, I began digging through a "l*v" generated log to determine the true source of the failure.

MSI (s) (84:88) [14:36:07:292]: Product: Adobe Acrobat DC -- Error 1328.Error applying patch to file C:\Config.Msi\PT2AFE.tmp.  It has probably been updated by other means, and can no longer be modified by this patch.  For more information contact your patch vendor.  System Error: -1072807676

Error 1328.Error applying patch to file C:\Config.Msi\PT2AFE.tmp.  It has probably been updated by other means, and can no longer be modified by this patch.  For more information contact your patch vendor.  System Error: -1072807676

Aha, so it appeared that for some reason the MSP packaged with the MSI was failing to be applied.  Scrolling up through the log I was able to identify the actual failing file itself:

MSI (s) (84:88) [14:36:07:292]: Executing op: CacheBaselineFile(Baseline=0,FileKey=adobe_caps.dll,FilePath=C:\Program Files (x86)\Adobe\Acrobat 2015\Acrobat\adobe_caps.dll,,Existing=0)
MSI (s) (84:88) [14:36:07:292]: Executing op: PatchApply(PatchName=adobe_caps.dll,TargetName=C:\Program Files (x86)\Adobe\Acrobat 2015\Acrobat\adobe_caps.dll,PatchSize=81904,TargetSize=552632,PerTick=0,,FileAttributes=16384,PatchAttributes=0,CheckCRC=0)
MSI (s) (84:88) [14:36:07:292]: Patch for file 'C:\Program Files (x86)\Adobe\Acrobat 2015\Acrobat\adobe_caps.dll' is redirected to patch 'C:\Config.Msi\PT2AFE.tmp' instead.

At this point I needed to dig deeper--I know that the package installed perfectly on other machines, so why not this one?  Firing up Procmon, I was able to see that msiexec.exe was hitting the "adobe_caps.dll" file here:


Being unfamiliar with the "$PatchCache$" folder, I did a little research and found that files can be cached here (and only cached ONCE) for any MSP file installed on your machine.  Since the installer was being pulled across the network, it looks like a network hiccup occurred and a corrupt version of the "adobe_caps.dll" (showing as 0 KB) was stored in cache.

To resolve the error, all that needed to be done was to remove the entire "68AB67CA3301FFFF7706E0F060571500" folder & reinstall!  Bam!!

Thursday, November 19, 2015

Getting NW.js (node-webkit) v0.12.3 to work with Edge.js

This is something I needed to get functioning for work.  Luckily it wasn't so difficult--the hardest part was attempting to figure out why after I compiled Edge.js properly for NW.js v0.12.3 why it wouldn't actually attempt to load the native "edge.node" module.

First things first, we need to make sure the following is installed on your machine:

Windows 7 SDK 7.1

Since I already do quite a bit of development on my machine I was lucky to already have VS 2013 & the Windows 7 SDK 7.1 installed.

Next, go ahead and open up the "Windows SDK 7.1 Command Prompt" from the start menu.

For the next steps, Vijay Kumar has provided some excellent steps here:

Brief procedure for some one who might be interested.
My code was in the directory C:\tdameri\xlsxcplus\test1
I used the Windows 7 SDK 7.1 command prompt (you need to have Windows 7.1 SDK installed)
Commands in the command prompt
setenv /x86
cd C:\tdameri\xlsxcplus\test1
npm install edge
cd C:\tdameri\xlsxcplus\test1\node_modules\edge
nw-gyp configure --target=v0.8.4
nw-gyp build

The build happened without errors.

Copy the edge.node file from edge\build\release folder
and replace the edge.node files the edge\lib folder.

Unfortunately it wasn't so simple as it appeared my corporate proxy was blocking or throwing 403 errors when nw-gyp was attempting to pull the NW.js headers from the Amazon AWS site.  After looking through a bit of the code,  I discovered "install.js" did in fact contain proxy support:

// basic support for a proxy server
var proxyUrl = gyp.opts.proxy
            || process.env.http_proxy
            || process.env.HTTP_PROXY
            || process.env.npm_config_proxy
Woohoo!  I was able able to simply SET my "HTTP_PROXY" environment variable and move forward.  A quick note is that Vijay was building for x86 while I was building for x64, therefore, the only change I needed from his steps was modifying the first line to:

setenv /x64

At this point, my custom "edge.node" was building properly:

Following Vijay's steps above, I found that even though we have build "edge.node," we now need to copy it from:


Over to:


Speaking of my old friend Vijay--it looked like he didn't realize which folder to copy the newly compiled binary to.  In my case, I figured if I was running NW.js v0.12.3--why not copy it over to the "0.12.0" directory?

Thinking I was in the clear I attempted firing up NW.js and discovered to my horror:

 Boo!  As it turns out, the error does in fact state Edge appears to be looking for a "v1.2.0" folder.  Digging into the Edge.js code more, I discovered the following under "node_modules/edge/lib/edge.js":

var versionMap = [
    [ /^0\.8\./, '0.8.22' ],
    [ /^0\.10\./, '0.10.0' ],
    [ /^0\.12\./, '0.12.0' ],
    [ /^4\./, '4.1.1' ]

Aha!  So since Edge is looking to match v1.2.0, I went ahead and modified the above to so:

var versionMap = [
    [ /^0\.8\./, '0.8.22' ],
    [ /^0\.10\./, '0.10.0' ],
    [ /^0\.12\./, '0.12.0' ],
    [ /^4\./, '4.1.1' ],
    [ /^1\.2\./, '1.2.0' ]

Then proceeded to create the following directory:


And finally dumped all the files from the "0.12.0" files into this folder.  After copying the files over, boomzy:

Hope this saves someone a headache.


Wednesday, May 6, 2015

ServiceStack v3, Angular, IIS Express, Windows Authentication & CORS

I've recently busted my balls trying to get ServiceStack v3/Angular/IIS Express/Windows Authentication all working together in our corporate environment.  It was a bit of a nightmare but it appears I finally have it all figured out.  Sorry about the crappy formatting.

First of all, I am running Visual Studio 2010 so I needed to ensure that SP1 was installed so I could properly configure my site from the Properties dialog of solution explorer.  First things first, you'll need to ensure that both Anonymous Authentication & Windows Authentication are enabled on the site:

Once you've confirmed both are enabled, head over to your web.config file and be sure you ad the following to the system.web section (OPTIONS simply would not work with Windows auth):

		<allow verbs="OPTIONS" users="*"/>
		<deny users="?" />

After this is added, implement Demis' (mythz) fallback service documented here (


public class Fallback
public string Path { get; set; }


public class FallbackService : Service
    public object Any(Fallback request)
        if (base.Request.HttpMethod == "OPTIONS")
            return null;

        throw HttpError.NotFound(String.Format("{0} was not found", request.Path));

And finally you'll need to add the following to your AppHostBase in Global.asax:

base.Plugins.Add(new CorsFeature(
allowedOrigins: "http://FrontendUrlHere", allowCredentials: true, allowedMethods: "GET,POST,PUT,DELETE,OPTIONS"


Be sure you replace "FrontendUrlHere" with your front-end URL.  Allowed origins of "*" do not work when allowCredentials is set to true due to security reasons.

Friday, April 3, 2015

PsExec -- Error deriving session key: The system cannot find the file specified

So this one's been driving me insane for a while (especially since I figured it out a while ago and never documented the solution).  On some systems I would only be able to get PsExec working half the time...the other half the time I'd receive this infuriating error:

C:\Users\CJ\Downloads>psexec \\chrlcltsbx803 -i -s cmd.exe

PsExec v2.11 - Execute processes remotely
Copyright (C) 2001-2014 Mark Russinovich
Sysinternals -

Error deriving session key:
The system cannot find the file specified.

So after running ProcMon to determine what file "couldn't be found," I realized--I was running PsExec  as my elevated administrative user without a profile.  As in: runas /noprofile /user:chrl\CJ cmd.exe. Unfortunately, this doesn't seem to work due to something with HKCU cryptographic keys.

Either way, the issue went away once running under my elevated account without the /noprofile switch. Hope this saves someone a headache.

Thursday, April 25, 2013

Lync 2010 Error Code: 500 Internal Server Error. The received certificate has expired. (-2146893016)

Our CA certificate recently expired and we were experiencing  a smorgasbord of issues after renewing the CA cert itself.  One issue we were running into is that our Lync mobile clients stopped connecting, and our external clients were receiving the following error:

Cannot synchronize with the corporate address book. This may be because the proxy server setting in your web browser does not allow access to the address book. If the problem persists, contact your system administrator.

Knowing that this was most likely related to the certificate, I checked and found my certs were up to date and working properly on both the Front End and Edge servers.  The next thing I checked was attempting to use the Microsoft Lync Connectivity Analyzer.  This threw an error stating:

Server discovery failed for unsecured external channel against

So I attempted accessing the URL directly from a web browser and came up with the following:

Hmm, so the certificate has expired?  That's strange as I had previously checked both the FE & Edge servers.  Next, I checked the TMG server and performed a rule test like so:

In the screenshot the test has passed (I took this after implementing the fix), but originally the had failed the test with the same error reported by the web browser.  At this point I realized that the certificate could not be validated as I had not installed the new internal CA trusted root certificate within the TMG server.  After installing the root CA certificate all issues were now resolved.