Deleting an Always On VPN Device Tunnel

To delete an Always On VPN device tunnel, open an elevated PowerShell window and enter the following command:

Get-VpnConnection -AllUserConnection | Remove-VpnConnection -Force

Verifying VPN Device Tunnel Creation

To verify the creation of the VPN device tunnel, run the following PowerShell command:

Get-VpnConnection -AllUserConnection

Using rasdial.exe

rasdial "ConnectionName" "Username" "Password"
rasdial "ConnectionName" /disconnect

Network Configuration

Get-NetIPConfiguration -InterfaceAlias "Always On VPN Name"

VPN Connection Trigger

Get-VpnConnectionTrigger
Set-VpnConnectionTrigger -Name "MyVPN" -DnsSuffix "example.com"

Network Diagnostics

msdt.exe /id NetworkDiagnosticsNetworkAdapter

PowerShell Execution Policy

powershell -ExecutionPolicy Bypass -File .\WhoShutItDown.ps1

Quick Commands

win + r = mrt
reagentc /info
gpresult /Scope Computer /v

Network Adapter and DNS Settings

Get-NetAdapter
Set-DnsClientServerAddress -InterfaceAlias "Wi-Fi" -ServerAddresses ("8.8.8.8", "8.8.4.4")
nslookup -d2 rootctl.com

Exchange Online Management

Install-Module -Name ExchangeOnlineManagement -Force -AllowClobber
Connect-ExchangeOnline -UserPrincipalName admin@rootctl.com -ShowProgress $true

Installing Modules

Install-Module MSOnline vs Install-Module AzureAD

Group Policy Results

gpresult /r /scope computer >> c:\temp\ou.txt
FIND "CN=" "C:\Temp\ou.txt" > C:\Temp\ou1.txt

System Information

echo %USERNAME%
echo %USERDOMAIN%
systeminfo
wmic ComputerSystem get Username
net user %username%
query user
cd /users; dir
reg query “hkcu\volatile environment”

Audit Policy Configuration Settings

AuditPol.exe /get /subcategory:Logoff

Time Zone Configuration

Get a current list of time zones

To get the most current list of time zones, use tzutil from a Command prompt:

tzutil /l

Change the default time zone in an image

To change the default time zone in an offline image:

Dism /Image:"C:\mount\windows" /Set-TimeZone:"W. Europe Standard Time"

Note: Setting the time zone with DISM /Set-TimeZone is only supported in offline images.

Synchronizing Machine Time

W32tm /resync /force