How Exactly Does ProxySettingsPerUser Work?

Update A nice man at Microsoft advised me that in addition to setting DefaultConnectionSettings you should also set SavedLegacySettings to the same value under the same key. This value holds, and I quote, “configuration used by network connections other than the default connection”. I have been unable to divine exactly what this means but it sounds like it might be important. Introduction You may occasionally in your career have had a want or need to set Windows proxy settings for every account on a machine regardless of who is logged in....

2021-04-14 · 6 min · Adam

Connecting to NFS Shares From Windows (Properly)

Introduction If you live in the Windows world you probably haven’t had much cause to use NFS because SMB is the done thing, but if you’re working with Linux hosts or NAS devices NFS can be simpler to deal with. The problem is that Windows NFS support is a bit…wonky and it doesn’t help that almost all the guides on t’internet are giving out bad advice. So to continue my series of “I just figured this out so it seems only fair to share” posts, here’s how to setup the NFS client on Windows properly....

2021-02-11 · 3 min · Adam

Protected Users Group Policy Bugs

So apparently members of the Protected Users group can’t edit Wired 802.1x group policy. Wireless 802.1x? Sure. Every other group policy setting? Yup. Wired 802.1x? Can’t load the snapin. Got to love the consistency there, Microsoft.

2019-11-30 · 1 min · Adam

How to Prevent Truncation of Long Output In Powershell

You know how annoying it is when you return some information in Powershell that includes a list of items and the console helpfully truncates it with a … Whereas what you really want is for it to just show the whole thing like: Well you can. The truncation is controlled by $FormatEnumerationLimit and if you set it to -1 it won’t truncate output at all. The default for a standard Powershell instance is 4, the Exchange Management Shell ups this to 16 and other console files may make their own modifications....

2017-04-04 · 1 min · Adam

Proxy Authentication With Powershell

We all know how annoying it is working somewhere with a proxy server that requires authentication, especially as Microsoft increasingly don’t support the scenario with many of their Azure-related tools. However, it is quite possible to use authenticated proxies with .NET applications including Powershell. For the former, edit the application .config file and add <system.net> <defaultProxy useDefaultCredentials="true" /> </system.net> And for Powershell, add the following to your scripts or $profile...

2016-09-09 · 1 min · Adam

Update Window Settings After Scripted Changes

Let’s say you make a change to your locale settings by directly editing the registry, modifying the HKCU\Control Panel\International\sTimeFormat key. Problem is that Windows doesn’t pick up these changes until you log off and back on again or restart explorer.exe. Now if you make the changes via Control Panel you don’t have to do this, so why do you if you modify the registry? Well, when you use the UI to make changes to the locale or any other policy or environment settings, Windows sends a WM_SETTINGCHANGE broadcast to all Windows notifying them of the change to settings so they can refresh their config and you can do it too!...

2015-12-03 · 2 min · Adam

Find Unlinked GPOs

You know how it is, you don’t pay attention to the management of your domain for just 5 or 6 years and suddenly you have hundreds of GPOs with no idea what half of them do or even if they’re actually linked somewhere. For some reason, the Powershell GPO module doesn’t have a simple cmdlet or property that lets you tell if a GPO is linked or not, because that would be far too helpful, but it’s not too hard to do if you don’t mind parsing some XML....

2014-05-30 · 3 min · Adam

Disconnect RDP Console Session Without Locking Server

Sometimes you have badly written apps that need to run interactively on servers, which means you have to connect to the console session to manage them over RDP. If you need to be able to leave the console session unlocked it causes issues as disconnecting an RDP session will lock it by default. This can be changed by running the following command from within the RDP session: tscon 0 /dest:console...

2013-07-03 · 1 min · Adam

Changing Printer Drivers En Masse

If you need to change the drivers for a large number of printers, such as on a print server, then you can use the following Powershell to do it. Set $driver to the name of the driver you wish to set and $pattern to match for the printers you wish to affect (so you don’t change the driver on printers you don’t want to). Note: This script will run pretty quickly, but depending on the number of printers it may take upwards of 10 minutes for Windows to do all the background processing associated with the driver changes....

2012-03-01 · 1 min · Adam

Failed To Restore Print Queue…Error 0x800706d9

Situation You’re using PrintBRM.exe to migrate printers between servers (or to backup and later restore them on the same server) but when it tries to restore the print queues it fails with “Failed to restore print queue <Printer name>. Error 0x800706d9” Cause PrintBRM tries to query the Windows Firewall when it creates the shares for the print queues. If the Windows Firewall service is disabled, this step fails and the print queue is not created....

2012-02-22 · 1 min · Adam