TechShizz | Tech Guides

Finally, a Windows 10 VPN solution that doesn't make you want to blow your brains out!

As a system administrator, I use many VPN connections throughout the day. Windows 10 is great, but whoever was in change of the VPN client in windows 10 at Microsoft did not deserve his/her bonus for this edition of windows!! It's slow, buggy, gives you no decent error. Fortunately, Mr gates left the good old rasphone intact so we can use this. 

The problem is, its still clunky loading in Windows 10. It can take 3-10 seconds to load the Rasphone each time you open it.

I've written a PowerShell script to make a tidy folder of useable shortcuts that you can add the to tool bar. Here's how it works.

1. Create a folder called "VPNs" in c:\

2. Right click the task bar > Toolbars > New Toolbar

3. Navigate to the VPNs folder and select it and click 'Select Folder'.

4. Paste this PS Script to s txt file. Save it as a .ps1 file.

Remove-Item -Path C:\VPNs\* -Recurse -Force
$vpnlist = Get-VpnConnection | Select Name -Skip 1
ForEach ($vpnname in $vpnlist.Name ){
$Shell = New-Object -ComObject ("WScript.Shell")
$ShortCut = $Shell.CreateShortcut("C:\VPNs\$vpnname.lnk")
$ShortCut.TargetPath="rasphone.exe"
$ShortCut.Arguments="-d `"$vpnname`""
$ShortCut.WorkingDirectory = "c:\windows\system32\";
$ShortCut.WindowStyle = 1;
$ShortCut.Description = "$vpnname";
$ShortCut.Save()}

5.You can check the status (See what VPNs are connected) with this script.

Get-VpnConnection | Where-Object {$_.ConnectionStatus -eq "Connected" } | Select Name,ConnectionStatus,TunnelType,ServerAddress,SplitTunneling | Format-Table
Pause
Exit

6. You can disconnect all VPNs at the same time with this script.

$vpnlist = Get-VpnConnection | Where-Object {$_.ConnectionStatus -eq "Connected" }
ForEach ($vpnname in $vpnlist.Name ){

  rasdial $vpnname /DISCONNECT;

}

Installing and working with Windows Containers in Server 2016

Installing Docker

First, Install "Containers" Feature from Windows Features.

Run PowerShell as administrator:

## Install the module, pull down from internet
Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
##Say yes to install Nuget

## Install the package
Install-Package -Name Docker -ProviderName DockerMsftProvider
##Confirm install.

#Reboot

Installing the base OS

You can do this either in PowerShell or CMD (as admin)

docker pull microsoft/nanoserver
OR
docker pull microsoft/windowsservercore

Containers are created in the file system here: C:\ProgramData\Docker\Containers

Here are some basic commands:
docker images - Shows the current images available.
docker run -it mimcrosoft/nanoserver cmd - Runs a new container with a nanoserver base and runs CMD. You can see the container running in C:\ProgramData\Docker\Containers. If you type "hostname" you'll see the hostname is infact a new one, not the name of your physical host.


docker ps -a - Shows all containers currently running on the server and the container ID.

If you "exit" from the cmd, this will stop the container since no processes are running.

If the container stops, you can start it again with:
docker start <containerid>

If you wanted to get into a cmd in the container again you could do:
docker exec -it <containerid> cmd

docker commit <containerid> <name>
docker commit 11dfds1sf1 containerone

docker run --rm <name> <command> -- --rm removes the container once finished.

Setting up Encrypted email in Office 365 in 5 Steps

1. Ensure you have assigned an Azure right Management license to the user in Office 365.

2. Run the following from a an Elevate PowerShell instance.

If you have never installed Encrypted email before, you may need to install AzureRM and AADRM.

Install-Module -Name AzureRM -AllowClobber
Install-Module -Name AADRM

3. Next run this script (you will need the tenant office 365 credentials):

$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $cred -Authentication Basic -AllowRedirection
Import-PSSession $session
Set-IRMConfiguration -SimplifiedClientAccessEnabled $true
$cred = Get-Credential
Get-Command -Module aadrm
Connect-AadrmService -Credential $cred
Enable-Aadrm
$rmsConfig = Get-AadrmConfiguration
$licenseUri = $rmsConfig.LicensingIntranetDistributionPointUrl
Disconnect-AadrmService
$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $cred -Authentication Basic -AllowRedirection
Import-PSSession $session
$irmConfig = Get-IRMConfiguration
$list = $irmConfig.LicensingLocation
if (!$list) { $list = @() }
if (!$list.Contains($licenseUri)) { $list += $licenseUri }
Set-IRMConfiguration -LicensingLocation $list
Set-IRMConfiguration -AzureRMSLicensingEnabled $true -InternalLicensingEnabled $true
Set-IRMConfiguration -SimplifiedClientAccessEnabled $true
Set-IRMConfiguration -ClientAccessServerEnabled $true

4. To test it is working run:

Test-IRMConfiguration -Sender user@domain.co.uk

5. Next, in the Office 365 Exchange Admin centre, set up a mail flow rule like this:

Activating Volume License Project and Visio Click to Run installations

Problem

You are unable to install Project or Visio Volume License editions along side normal Office 2013/2016 click to run installations. You may get an error like "this product key is for the volume-licensed version of project 2016"

Cause

Microsoft keep moving the goal posts! 

Solution
  1. Use the Office 365 Offline Deployment tool to download the "ProjectStdXVolume" product.
  2. Before running the setup, amend the config file to include the PID key Like so:

<Product ID="VisioProXVolume" PIDKEY="69WXN-MBYV6-22PQG-3WGHK-RM6XC">

Choose te correct PID for the required edition:

Edition ID PIDKEY
Visio Standard 2016  VisioStdXVolume  NY48V-PPYYH-3F4PX-XJRKJ-W4423 
Visio Professional 2016  VisioProXVolume  69WXN-MBYV6-22PQG-3WGHK-RM6XC 
Project Standard 2016  ProjectStdXVolume  D8NRQ-JTYM3-7J2DX-646CT-6836M 
Project Professional 2016  ProjectProXVolume  WGT24-HCNMF-FQ7XH-6M8K7-DRTW9 
Next, to activate the software make sure you have the C2R-P MAK key, not the MSI MAK key.

MAK keys that you use for Windows Installer (MSI) installations of Visio and Project won't work with the Office Deployment Tool. You need a different MAK key to deploy volume licensed editions of Visio and Project with the Office Deployment Tool. To get that MAK key, log into the Volume Licensing Service Center (VLSC) and use the key listed under "C2R-P for use with the Office Deployment Tool."

Reference, Links and Imges

https://docs.microsoft.com/en-us/deployoffice/use-the-office-deployment-tool-to-install-volume-licensed-editions-of-visio-2016 

Redirected Folders In-Accessible OR Access Denied

Problem

User logs on and there are no icons (Redirectoed Folder). Error states that the server \\Server\RedirectedFolders is Inaccessible OR access denied. You are able to access the redirected folders via \\192.168.x.x but not by the NetBios or FQDN.  

Cause

Unknown but suspect this is to do with the TCP/IP stack on the machine. Issue appears to be DNS however fix suggests it's TCP/IP.

Solution

A WINSOCK reset resolved this issue. 

netsh winsock reset