Friday, December 11, 2020

Error 1312 when adding ssl cert

 If you get an error when using netsh to add a cert thumbprint, make sure you have a private key attached to the cert. Also, make sure the command prompt is open as admin.


netsh http add sslcert ipport=0.0.0.0:443 certhash=‎‎certThumbprint appid={eea9431a-a3d4-4c9b-9f9a-b83916c11c67}

Saturday, September 12, 2020

-bash: [: too many arguments When logging on via SSH

 I had an unusual error after creating a CIS Hardened Ubuntu 18.04 image from the Azure Marketplace. As soon as I would log on I would get the error: -bash: [: too many arguments.


I asked the question on EE and this is what we did to find the answer:

I logged on and ran an strace:  strace bash -l 2>output.txt

While that was running I logged on to another session. As soon as I got the error after logging in, I stopped the strace process on the first session.

I opened the output.txt file in Notepad++ and did a search for -bash: [: too many arguments

and found this:

write(2, "/etc/profile: line 22: [: too ma"..., 45/etc/profile: line 22: [: too many arguments
) = 45


I opened /etc/profile and commented out the lines:

#if [ -d /etc/profile.d ]; then
#  for i in /etc/profile.d/*.sh; do
#    if [ -r $i ]; then
#      . $i
#    fi

#  done
#  unset i
#fi
#umask 027

I logged on again and didn't get the error.

What we ended up doing was deleting the file in /etc/profile.d called '*.sh' using; rm -fi '*.sh'



Friday, January 17, 2020

Installing Microsoft Teams Per Machine instead of Per User

Microsoft finally has a way to install Microsoft Teams "Per Machine" instead of "Per User".

In the past when you installed Teams either from the EXE or through the click to run install, it would put in in the users Appdata folder. Now, you can install it per machine and each new user will already have it without the need to install it per user (the way it should be IMHO). 

THIS article from Microsoft explains how to do it with a persistent setup and a non-persistent setup.

We use FSLogix so we have a non-persistent setup. The article can be a little confusing so I will just put the steps that we did:

  1. Since we used the O365ProPlus installer using ODT and had Teams installed using that, we created a new XML file with the <ExcludeAppID=  "Teams" />  inside and reran the setup.
  2. We removed the two Teams programs inside Programs and apps, Teams and Machine Wide Teams installer.
  3. Added to the registry, HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.\VMware VDM\Agent. (or, HKLM\Software\Citrix\PortICA)
  4. Used the PS Script in the article to remove it from users AppData folder. (This MUST be done per user. So if you have a lot of users you may want to add the script to the login and have it run)
  5. Install the msi using the command line given for Per Machine.


Error 1312 when adding ssl cert

 If you get an error when using netsh to add a cert thumbprint, make sure you have a private key attached to the cert. Also, make sure the c...