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

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

Send Skype For Business (Lync) IMs via Powershell

This script uses UCWA to send IMs via Skype For Business. Unlike the commonly documented methods using Microsoft.Lync.Model from the Lync SDK which require the Lync/S4B client to be installed, running and logged in to work, this will run from any machine on your internal network (and in theory could be used externally with some tweaking too). It still needs some cleaning up because none of the code examples I could find were for Powershell so there was a bit of trial and error and I’m sure things can be done more efficiently, but at a basic level it does what it’s supposed to....

2016-02-02 · 4 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

AD Group Membership Visualisation

I’m amazed that I haven’t previously had a need for something like this, but I was looking for some way to visualise AD group memberships, specifically to take into account fairly deeply nested groups. After a fair bit of searching, a lot of dead-ends and some products that seriously over-sold themselves, I came across this little beauty: https://gallery.technet.microsoft.com/scriptcenter/Graph-Nested-AD-Security-eaa01644 As the original download no longer seems to exist I’ve put a copy here...

2014-11-12 · 1 min · Adam

Find Exchange Install Path

Quick and easy; Exchange creates an environment variable called “ExchangeInstallPath” which holds the install path for Exchange on a given server, this can be accessed via Powershell using $env:ExchangeInstallPath. This can be useful if you need to call elements such as RemoteExchange.ps1 but aren’t sure if Exchange has been installed to the default location.

2014-10-13 · 1 min · Adam

Get GC Status From All DCs

Quick and easy one-liner - if you need to know at a glance which DCs in a domain are GCs and which aren’t: [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain().DomainControllers | %{"$($_.Name) : $($_.isglobalcatalog())"}

2014-07-10 · 1 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

DHCP-Multitool

The following script is an amalgamation of several tools I’ve built up over the last couple of years to work with multiple DHCP scopes on servers. It has 6 basic modes of operation, as detailed below, which allow you to list all scopes on a server, enable all scopes on a server, disable all scopes on a server, change the lease time for all scopes on a server, change the offer delay for all scopes on a server or add reservations to one or more servers....

2012-10-16 · 5 min · Adam