How to create a PowerShell command to uninstall an application

First, identify the applications in the list from this command:

#Get App 
Get-WmiObject -Class win32_product

Next, filter to the app you want to remove: I'm testing here with "Advanced installer".

#Filter to just the app name
Get-WmiObject -Class win32_product -Filter "Name like '%Advanced Installer 16.5%'"

Next, check the locate the uninstall module:

#Locate the Uninstall() Method of the Win32_Product Class using the Get-Member cmdlet:
Get-WmiObject -Class win32_product -Filter "Name like '%Advanced Installer 16.5%'" | gm

Finally, contstruct your uninstall command like this:

#Use the uninstall method to uninstall.
Get-WmiObject -Class win32_product -Filter "Name like '%Advanced Installer 16.5%'" | ForEach-Object { $_.Uninstall()}

Skype for Business not showing inbound / outbound / misses calls

I had an issue where Skype for Business was not showing missed or outbound calls. The environment was an On-Prem Skype for Business server with AzureAD Connect enabled.

Various articles online all state various reasons for why this might occur but none of them mentioned this cause, which is why I'm posting on this. 

The issue for us was caused by a missing email address being populated in the user’s active directory account. 

I think back when AzureADConnect used to be DirSync, adding the email address used to be a requirement to allow sync of accounts. As soon as the email address of the user was added, the calls history populated immediately.

How to split a private key from an SSL .PFX file

If you want to split and .pfx file to see the Prvate key, you need to use OpenSSL to do this. 

Download the installer from here: https://slproweb.com/products/Win32OpenSSL.html

Place your certificate in C:\

You'll need to know the password for your PFX file.

Open a CMD and change directory to C:\Program Files OpenSSL-win64\bin\

Then run these three commands:

openssl.exe pkcs12 -in c:\certname.pfx -nocerts -out key.pem -nodes
openssl.exe pkcs12 -in c:\certname.pfx -nokeys -out cert.pem
openssl.exe rsa -in key.pem -out server.key

The private key is output into the key.pem file. Open this in notepad. They will be located at C:\Program Files OpenSSL-win64\bin\

Microsoft Access Query is Corrupt Error 3340

The best way to fix the problem is to uninstall the Security Update for Office which is the source of the problem. The solution is different based on whether your Access installation is from a traditional perpetual license, ACE, or Office 365 subscription.


Perpetual License and Disk Installations of Office/Access, and ACE Distribution Installations

If you installed Access/Office directly on your machine through a perpetual license, local setup program/disk, or distributed the Access Database Engine (ACE), the Security Updates were installed on the machine outside of the Office 365 subscription service. Follow the steps below to find and uninstall the updates:

  1. Press the Windows key and R to bring up the Run prompt.
  2. Type "appwiz.cpl" and press [OK] to launch the Control Panel's Program and Features program.
    Run command
  3. Click [Viewed installed updates].
    View installed updates
  4. In the Search bar, search for the following KB's.
    • Office 2010: KB4484127
    • Office 2013: KB4484119
    • Office 2016: KB4484113
  5. On this system, KB4484127 is present.
  6. Right-click the program, and select [Uninstall].
  7. Click [Yes] to start the uninstall process.
  8. The prompt will ask if you're ready to uninstall. Click the [Uninstall] button to proceed.
  9. Click [OK] when the uninstall of the update was successful.

In our experience, if this uninstalls all the offending security updates, the problem is resolved without a need to reboot.

We will have additional information for Office 365 installations shortly.


Microsoft Office 365Office 365 Subscription (Click to Run) Installations

For Office 365 Users, follow these steps:

  1. Open Office and under “Account” choose the option to disable updates.
  2. Use this link to look up the version of Office that you want to revert to: Update history for Office 365 ProPlus (listed by date)
    For instance, "16.0.12130.20272"
  3. Download the Office Deployment tool (Download)
    Follow the prompts to unzip the files to a folder that’s easily accessible.
  4. In that folder, use Notepad to create a new file named “config.xml” containing:
    <Configuration>
    <Updates Enabled="TRUE" TargetVersion="16.0.12130.20272" />
    </Configuration>			
    
  5. In an elevated command prompt, change directories to the folder where you unzipped the files. Then run the following command:
    setup.exe /configure config.xml
    
  6. Open an Office program and go to the Account page, and “get updates now”.  This reverts back to update 16.0.12130.20272.

Microsoft resource: How to revert to an earlier version of Office 2016 Click-to-Run

How to Remote PowerShell to Office 365 with MFA enabled

Since MFA has become more popular and it's being enabled on more and more tenant account it has presented a problem when connecting to Office 365 via PowerShell in the usual way we've done it for years.

Now, you must download the ExchangeOnline PowerShell Module. This can be done by logging into your Exchange Online GUI, and then from the Hybrid section, click 'Configure' under the MFA section. 

Once you've install the module, you can launch it and then conenct to any tenant by using only your email address in the Connect-EXOPSSession command like this:

Connect-EXOPSSession -UserPrincipalName [email protected]

You will be required to approve your MFA request. Once approved, the PowerShell session conencts as normal.