How to do a SharePoint PnPonline connect with PowerShell 7

If you want to do a connection to SharePoint Online with a PowerShell script. You will need to make a connecting user and a certificate for logon. The legacy function with plain text user/password does not work anymore.

The PowerShell CMD-let SharePoint Online PnP has been beprecated and is replaced with PnP PowerShell. Do the following to confirm right installed CMD-let

To check if you have the right version of PowerShell. You will need at least PowerShell 7.3

1 $PSVersionTable.PSVersion

Get all installed SharePoint Online PnP PowerShell Modules

1 Get-module -ListAvailable *pnp*

If both or PnP Classic is installed

1 Uninstall-Module PnP.PowerShell -AllVersions -Confirm:$False

2 Uninstall-Module SharePointPnPPowerShellOnline -AllVersions -Confirm:$False

Some versions of PowerShell need to change the TLS to version 1.2 for uninstall and install to work

1 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Install the latest version of PnP.PowerShell. Choose install option Yes to All

1 Set-ExecutionPolicy RemoteSigned

2 Install-Module PnP.PowerShell

You have now installed the new Module

To make a connection to SharePoint Online you will need a global account to your Tenant and some information.

Make a folder for your certs at the local computer “c:\mycertificates”. Do not use spaces or local characters for the folder name. Register the account.

$result = Register-PnPEntraIDApp -ApplicationName “[MySharePointAppName]” -Tenant [TenantName].onmicrosoft.com -OutPath c:\mycertificates -Interactive
$result

Sign in with your Admin account and the script will return a client ID on success. Store the client ID for feature use. You will receive two certificates in your certificate folder.

To make a connection to SharePoint

Connect-PnPOnline [TenantName].sharepoint.com/sites/[folder] -ClientId [ClientIDNo] -Tenant [TenantName].onmicrosoft.com -CertificatePath “C:\mycertificates\[MySharePointAppName].pfx”

com0com virtual serial ports

Virtual com port / serial port for Windows 10

Sometimes it can be handy to create virtual com port pairs or virtual null modem using software. There are several solutions available, free and paid. The commercial softwares do work but with prices like 130 USD it is a bit out of range for a hobby project.

However, I found a project called com0com which is free. This software works well with Windows 10, both 32 and 64-bit versions available.

com0com virtual serial ports

Why is my Dropbox full?

Your dropbox is full and the amount of space you are using shown in the app or web interface does not correspond to the size of the Dropbox folder on your computer. You are not using selective syncing, i.e. all folders in the Dropbox cloud should be equal to the size of the Dropbox folder on your computer.

The reason might be you are using an external USB-drive on your computer.

When external USB-drives are connected, Dropbox asks if they should be backed up. If you selected yes, the content of the USB drive is copied to Dropbox cloud and occupies your space. If this was not the intention (for example if the external drive contains a backup copy of your files in the Dropbox folder), remove the external drive from the Dropbox folder.

How to upgrade Windows 10 Enterprise Evaluation to full version

If you’ve tried the Windows 10 Enterprise Evaluation and decide to go on and buy the full version, Microsoft doesn’t support a simple way of just converting or upgrading.

This is how you do it.

You will need:

  • An ISO image of Windows 10 Enterprise, download it from Microsoft (link is not provided here because Microsoft has a tendency to change their URL:s and direct links usually ends up broken, so you just have to search for it at Microsoft). Note: It MUST be for the same language code as the one used when you installed the Evaluation.
  • A Windows 10 license key.
  1. Start the upgrade using the ISO image but do not continue
  2. Start the Registry Editor (i.e. run regedit)
  3. Search for “CurrentVersion”, i.e:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
  4. In EditionID value data, change EnterpriseEval to Enterprise
  5. In ProductName value, change Windows 10 Enterprise Evaluation to Windows 10 Enterprise
  6. Immediately continue the upgrade while the Registry Editor is still open (otherwise the changed registry values will revert and you will not be able to upgrade).

Windows 10 VPN-problem after update to 1903 [workaround]

After installing the 1903 Windows 10 update, also called may 2019 update, users experience problems when trying to connect a VPN connection.

The problem occurs when clicking Connect on the VPN-connection through the system tray. When the dialog box for user name and password should appear, nothing happens.

Until Microsoft solves this a temporary workaround is to connect through the control panel.

  • Click on the Windows start button (the Windows flag in the bottom left corner)
  • Click on the cogwheel for Settings
  • In the control panel search box, type “VPN” and select “VPN-settings
  • Click on the connection you want to use to display the Connect button
  • Click the Connect button and now the dialog box for user name and password will display and you can connect as usual

Windows 10 desktop disappeared

A Windows 10 user contacted me because the desktop had disappeared.

The first thing to check is if Windows is in “Tablet mode” which disables the desktop.

  • Go to the Control panel
  • Search for “tablet” and click on “Table mode settings”
  • In the “When I sign in” change from “Use the apropriate mode for my hardware” to “Use desktop mode”
  • Log out and log back in again

If this doesn’t help the user profile might have become broken. In this case, the solution is (description below is just short notes taken from my memory):

  • Go to the Control panel and select accounts
  • Create a new account
  • Using a user with administrative rights, copy the content from the users folders like desktop, documents etc to the new user’s folder.
  • Log in using the new user

Resize EFI partition but the 16 MB MSR partition is blocking

With Microsoft Windows 10 Fall Creators update many users have ran into problems updating becuase their computer was installed with a too small EFI partition (100 MB). I’d consider this a warranty issue with the computer supplier, becuase obviously the computer wasn’t Windows 10 ready. The problem is that the hardware supplier will happily take your machine in, erase it and factory install it with a new Windows 10 image with a bigger EFI, but you will lose all your data.

A solution would of cause to make a backup and let them erase the machine but some of my clients have computers that will take 1-2 work days to reinstall and configure all software. So resizing the EFI is preferred.

This guide shows a simple way to do it with EaseUS partition master (requires to buy a license, but 50-60 usd is worth it if I can save 1-2 days of work). The problem is that in my case it wasn’t so simple as the guide shows, because there were no unallocated space after the EFI partition and the 16 MB MSR partition following it wasn’t possible to move. The layout looked like this (simplified):

EFI-partition -> 16 MB MSR partition (file system type “Other”) -> circa 500 GB NTFS Windows partition (C:)

This is how I solved it using EaseUS partition master:

  • Backup, backup and backup all your data! If something goes wrong this is your life line.
  • Resize the 500 GB NTFS partion, shrinking it and creating 32 MB unused space after the NTFS partition (I first tried 16 MB but wasn’t able to clone the 16 MB MSR partition to it, displaying an error message saying it wasn’t enough space), apply changes and let the system reboot
  • Select the 16 MB MSR and clone it to the unsused 32 MB space
  • Resize the 500 GB NTFS partition, shrinking it creating 400 MB unused space before the NTFS partition, apply changes and let the system reboot
  • Now there is 400 MB unallocated space between the EFI and NTFS-partitions. Select the EFI partition and resize it to 500 MB, apply and reboot

 

Meltdown and Spectre vulnerabilities – what to do?

Meltdown and Spectre are two vulnerabilities present in hardware making it potentially possible for programs to steal information, like passwords etc.

Meltdown affects only Intel processors while Spectre, which is more complex, also partly affects AMD and ARM based processors.

It is not yet known if these vulnerabilities has been exploited by anone. It can affect personal computers, servers, tablets and mobile phones, i.e. more or less any device containing a processor.

More information on: https://spectreattack.com/

What can you do?

  • Check your operating system for updates the upcoming weeks (this is normal good security practice, but make sure you do it frequently)
  • Install and update your virus protection. Even if the antivirus program can’t protect you from the attack it might be able to inform you that your device has got malicious code onboard

You can find security bulletins, security advisorys, faq:s etc for your operating system here: https://meltdownattack.com/#faq-advisory

Unable to mount NTFS filesystem due to hibernation

I had retrieved a harddisk out of a broken laptop containing Windows 10 in order to retrieve some files from it. The harddisk had been removed from the broken laptop and then installed in a HDD enclosure with USB connection. When I connected it to a Windows computer I could browse the Users folder but clicking on a user’s folder displayed a message that I didn’t have permissions to open it unless I continued as administrator. After the progress bar had went to 100%, I still couldn’t access the folder.

Instead I connected it to a Linux/Ubuntu computer and now the message “The NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting), or mount the volume read-only with the `ro` mount option.” was displayed when connected. The original laptop had been in a hibernate state when it broke which locks the filesystem.

It turned out that the easiest solution was to connect the USB harddrive to a laptop and press F10 to select boot device during boot up (the key might be different depending on brand, on my Samsing it was F10). I selected the USB harddisk and it booted after fixing the disk automatically. I was actually a bit hesitant to do this because I know from earlier Windows version that it usually was a hopeless task to boot on a harddisk that had been moved from one host computer to another. In Windows 10 it looks like they have fixed this.

I could log in to Windows as the original user and retrieve the files. After shutting it down in a controlled manner, it was also possible to mount the disk in Linux/Ubuntu..