How to Disable SMB1

WannaCry and Co. suggest that it’s time to remove some old protocol, and SMB1 it’s one of that.

Here you find a script that is usefull for that; run it as admin rights:


This batch call a powershell script (check that all the scripts is stored on the same folder and that the execution path is where you store the scripts)

I used a batch to bypass the powershell signature and make easier for helpdesk to runas as admin.

For disable it with GPO, check this:

How to Delete WSD printer Port

I had a Windows 2012 R2 printserver where a WSD port was still there after printer deletion. Delete only the port was not possible (operation not permit).

The spooler will delete the port only if it is assigned to a printer and you are deleting the printer. As workaround you can create a fake printer using this port and a preinstalled driver, then delete the printer.

But using powershell is possible to work less…

List all the WSD Printer Port:

Get-PrinterPort -Name wsd*

Delete the WSD Printer Port (PortName):

Remove-PrinterPort -Name PortName

or if you have only one WSD port:

Remove-PrinterPort -Name (Get-PrinterPort -Name wsd*).name

How to create Print queue with Powershell

Due to a new printserver rollout I write a powershell script to easily install network printers on the new Windows 2012 R2 printserver.

The script can be found here:

If the driver is not on driver store of your printserver, you need to install it before via GUI or using pnputil and Add-PrinterDriver:

pnputil -i -a "C:\Temp\Printers\Ricoh_UniDrv_plc6\x2DSPYP.inf"
Add-PrinterDriver -name "RICOH PCL6 UniversalDriver V4.12"

To create a new Printer Port and the Printer then just run this command:

.\New-ProvisioningPrinter.ps1 -ComputerName MYPRINTSRV -PrinterName PR01 -PrinterAddress -PrinterLocation "Italy, Milano, Reception" -PrinterComment "Asset Number: 01987" -PrinterDriver "RICOH PCL6 UniversalDriver V4.12"

Change ComputerName to your printserver, PrinterName to the name of new print queue you want to create, the PrinterAddress to the IP/HostName of network printer, PrinterDriver to the label of driver to use.

The script create the print queue PR01, shared with the same name and a printer port linked to that printer, named with the IP or HostName you specified on PrinterAddress parameter. SNMP is enabled too on “public” community.

You can also pipe a CSV file with PrinterName, PrinterAddress, PrinterLocation, PrinterComment columns to this script for bulk printers creation:

Import-Csv "C:\Data\Working\printers.csv" -delimiter ";" -Encoding UTF8 | .\New-ProvisioningPrinter.ps1 -ComputerName PRINTSRV

You have now all the printers installed to the new printserver. You need now to configure the default settings:

Set-PrintConfiguration -ComputerName MYPRINTSRV –PrinterName PR01 -PaperSize A4 -Color $False

this configure the PR01 printer with default Paper Size to A4 and to Black & White.

How to change Network Location in Windows 10

The easiest option is to use powershell. Open powershell with admin rights.

Get Network Name with this command:


The result on my case…

Name : Network 4
InterfaceAlias : Ethernet
InterfaceIndex : 3
NetworkCategory : Public
IPv4Connectivity : Internet
IPv6Connectivity : NoTraffic

Check the Name and the NetworkCategory.

Change the NetworkCategory (Location) from Public to Private with:

Set-NetConnectionProfile -Name “Network 4” -NetworkCategory Private

How to Change Remote App Icon on Windows 2012 R2

Changeing icon on RDS Remote App is possible only from Powershell.

Open administrative Powershell, import RemoteDesktop module and check first the current IconIndex and IconPath settings:

Import-Module RemoteDesktop

Get-RDRemoteApp -alias “MyApp” | fl

Then set the IconPath and IconIndex to the desired value. Found IconIndex counting the icons present on EXE,DLL,ICO until you reach the desired one starting from 0:

Get-RDRemoteApp -Alias “MyApp” | Set-RDRemoteApp -IconPath “C:\MyProg\MyProg.ico” -IconIndex 0

It’s possible also to change directly the .ico file you found on C:\Windows\RemotePackages\CPubFarms\CPubRemoteApps on the broker if you already have the icon on .ico format.