Automated shutdown of devices

Scheduled Tasks to shutdown pushed out through Group Policy Preferences

In a drive to reduce power usage, I’ve tried a few times over the years at a way to shutdown computers but not if they are in use. I’ve tried using scheduled tasks set to only run when idle – in reality this doesn’t really work as we tend to have quite a lot of mice that move ever so slightly on their own, so the PCs never think they are idle. Even wrote a client/server application where the client reports when someone logs on, logs off, or switches user and when prompted to shutdown by the server, the client asks the logged on user if they want to go a head or cancel. This worked fine for a while but when we updated to Windows 10 it stopped working and needed a lot of time spent on working out what had changed. So I moved away from that method. Continue reading “Automated shutdown of devices”

Locking down the Win+X menu

The WinX menu displayed for teachers and pupils

Whilst the Win+X menu is really useful for sys admins, there’s quite a lot of items on there that I’d rather not have pupils clicking on (even if they’d not get anywhere due to not having access rights). It’s possible to customise this menu and remove items you don’t want from it.

The shortcuts are stored (per user) in %LOCALAPPDATA%\Microsoft\Windows\WinX in three folders – Group1, Group2 and Group3. I don’t think it’s possible to add custom shortcuts however deleting them will remove the corresponding item from the WinX menu. Continue reading “Locking down the Win+X menu”

Powershell Printer Script

Over the last 15 years I’ve tried pretty much every method of adding printers at logon there is – KIXTART script, VBS, Group Policy Preferences and Powershell. As part of speeding up logon, and investigating a weird issue with Windows 10 printers, I moved away from GPP and to Powershell shortly after we upgraded from Windows 8.1 to Windows 10.

Some detail is show to the user, this form isn’t modal so won’t take over the screen, and if they close it the script carries on in the background.

The issue being – roughly 5% of the time, on random user/computer combinations, printers would take a long time adding and then fail to add, with a non-specific error message. My first go at this was a basic powershell script which had a hard coded list of location/printer mapping, and it would run the “add printer” command repeatedly until the error went away. (It always added fine on the 2nd go). The problem with this is that it’s a complicated script for technicians to update, and being a single threaded script the nice form it displays showing people what’s happening would freeze while it was working in the background.

My new script does the bulk of the work in background jobs – so printers add quicker (as it can do more than one at once), and the UI doesn’t lock up and freeze. More importantly, it uses Group Policy Preferences by reading the XML file generated and applies that – so technicians have the familiar interface for adding/removing printers from the script.  Continue reading “Powershell Printer Script”