Windows 10 VPN connections & default DNS servers

For some reason the DNS servers for the connecting VPN client do not get used and this caused problems especially as the internal AD domain suffix was split brain DNS and was getting resolved externally first.

After trying various things including registry hacks removing IPv6 etc I found out that it worked fine as long as I specified a default DNS server and used a named connection suffix.

Downside is that this is useless as I wanted to leverage DHCP wherever I may be and hard coding DNS servers would become a problem when roaming between internally and externally.

I finally found that all I had to do was change the metric on the network interface.  For both ipv4 AND ipv6 remove automatic metric and set to 100.  After this, no problems.

SYSPREP Windows 10 errors

Windows 10 with the latest updates now appears to cause the SYSPREP to fail due to some of the installed apps.  The error log points you to the offending items in the system32\sysprep\panther\setuperr.log file.  I had to remove the packages one by one and SYSPREP would then fail at the next one in the list.

I only had a few to remove to get SYSPREP working again using following PowerShell

Get-AppxPackage *candy* | Remove-AppxPackage
Get-AppxPackage *twitter* | Remove-AppxPackage
Get-AppxPackage *photos* | Remove-AppxPackage
Get-AppxPackage *HPPrinterControl* | Remove-AppxPackage

Update 27/10/17 After 1709 update SYSPREP errors again this time with the MiraView application and could not remove it, after digging through the event logs shows the corresponding .xml file missing.  Coped c:\windows.old\windows\miraview folder to c:\windows and rebooted.  Afterwards, worked as expected.  An error in the 1709 upgrade process possibly?

Find information on server shares being synced on a client workstation (Offline Files)

Useful to find out if users are caching/syncing with server resource about to be retired

Get-WmiObject Win32_OfflineFilesItem -filter “itemname = ‘\\\\SERVER'” | ft itempath

The following highlights all offline folder shares

Get-WmiObject Win32_OfflineFilesItem -filter “itemtype=2” | ft itempath

Both need to be ran under the context of the user but results could easily be piped locally or to a network share

 

Script to remove network printers

Removal of printers has always been a problem whether via GPO or otherwise especially migrating across print servers.

https://community.spiceworks.com/scripts/show/318-remove-printers-by-name-or-server makes this a lot easier!

' Remove Printers by Name or Server
' By: Greg Upton March 14th 2010

Dim objNetwork
Set objNetwork = WScript.CreateObject("Wscript.Network")

' *************************** Change Script Below ***************************
' RemovePrinter("\\ServerName\PrinterName")
' RemovePrintersFromServer("ServerName")

' *************************** Change Script Above ***************************

' ######################### Subs 'n Functions Below #########################
' ############################## DO NOT CHANGE ##############################

Set objNetwork = Nothing
WScript.Quit

sub RemovePrinter(sPrinterUNC)
	dim oPrinters
	Set oPrinters = objNetwork.EnumPrinterConnections
	For i = 0 to oPrinters.Count - 1 Step 2
		if uCase(oPrinters.Item(i+1)) = uCase(sPrinterUNC) then 
			on error resume next
			objNetwork.RemovePrinterConnection sPrinterUNC, true, true
			on error goto 0
			exit sub
		end if	
	Next
	set oPrinters = Nothing
end sub

sub RemovePrintersFromServer(sServerName)
	dim oPrinters, aPrinter
	Set oPrinters = objNetwork.EnumPrinterConnections
	For i = 0 to oPrinters.Count - 1 Step 2
		on error resume next
			aPrinter = split(uCase(oPrinters.Item(i+1)),"\",-1, 1)  '"
			if not UBound(aPrinter) = 0 then  'this is not a local printer, process code
				if aPrinter(2) = ucase(sServerName) then
					objNetwork.RemovePrinterConnection oPrinters.Item(i+1), true, true
				end if
			end if
		aPrinter = ""
		on error goto 0
	Next
end sub

 

Windows 10 LTSB

 

Windows 10 LTSB (Long Term Servicing Branch) is Windows 10 without Edge, Cortana, Store amongst other applications that require frequent updates. LTSB is only for rare mission-critical devices. “It’s more important that these devices be kept as stable and secure as possible than up to date with user interface changes,” explains the documentation

Only available for Enterprise edition.

Windows 10 Without the Cruft: Windows 10 LTSB (Long Term Servicing Branch), Explained

https://technet.microsoft.com/en-us/windows/release-info.aspx

 

Update Computer Group Membership Without a Reboot

Update klist -lh 0 -li 0x3e7 purge

Update Computer Group Membership Without a Reboot