UA-19884546-1

Hello!

I am a husband, a father, an IT Tech and an Investor.

I'm going to use this site to save information for later such as code, links and notes for family and friends and the odd photograph I've taken here and there.  I often look for new investment opportunities so will probably post the odd thing here about those too.

 

 

 

 

googlelinkedin

1
Energy logging and visualisation
2
Pulling information from WSUS using Powershell
3
How’s your battery life?
4
Finding my scripts
5
Hunt the email addresses
6
Powershell (re) pinning applications to the taskbar
7
Windows 10 build 9926 update failing
8
Getting RSAT to work on Windows 10 build 9926
9
Uninstalling Internet Explorer
10
Photo walk in London #TRlondon2015

Energy logging and visualisation

Due to the closure of https://www.generaytor.com/ I’m looking for an alternative which will help both log and visualise the huge amount of data which the panels are creating on a daily basis.  My aim is to use this page to catalogue the sites/systems I’m looking at and also document any configuration steps needed to get a solution in place so that it may help anyone else in the same boat.

Currently looking at:

 

Right now I’m using https://monitoring.solaredge.com and https://docs.google.com/spreadsheets in a manual process.

 

Other links:

http://pvwatts.nrel.gov/

 

Pulling information from WSUS using Powershell

Just in the process of pulling all of the machines out of wsus groups and into AD groups and there’s no way I’m doing it manually.  There had to be an automated way; it turns out PowerShell comes to the rescue again.

First we connect to the WSUS server:

Then we list the groups:

Then we list all of the machines in a given group:

Now we can get a list of the machines:

 

From here we can manipulate the list and do what we want with the machines. Such as trimming the domain suffix:

…and then finding these machines and adding them to a group.

Credit

How’s your battery life?

I have had to replace a few batteries recently so wondered if there was a way to find out ahead of time when someone’s battery was getting towards the end of it’s usable life.

After making a csv file with the following and saving it as new.csv:

SystemName,CurrentLevel, Checked

computer1,,XXX
computer2,,XXX

We  can then run the below code to remotely interrogate the batteries.  First we see if the machine is reachable, then we run a scriptblock on their machines to first get the maximum the battery will charge to, then get the designed maximum and work out the difference.  If it’s less than 60% we report it and move on to the next.

 

The next step is to work out how to update the csv file instead of doing it manually but at the minute that part is eluding me somewhat.

Hope it’s useful,

Finding my scripts

I’m forever losing scripts and having to re-do them so I’ve started adding a comment block to the top of them all which is searchable via another script.

Each new script now has in the description part a line starting “ScriptHelp – ” and is saved in a subfolder somewhere below this script here:

When run this searches all the .ps1 files and pulls out the filename and any description line starting with the above string.
Now I don’t need to keep telling everyone else which script does what and have an easy way to see if I’ve already written something for the job.

 

Hunt the email addresses

Often I’m asked to add a bunk of email addresses to a group or perform some other bulk job on them.  Almost never are the emails in a usable clean format just ready to use so I have to waste lots of time cleaning up the data before it’s able to be processed.

Copy this chunk of code into PowerShells ISE

Paste into $people your nasty block of text someone has given you and run.

Out will pop a nice list of all the email addresses found somewhere in there.

Powershell (re) pinning applications to the taskbar

A long time ago I set-up a rather large .vbs file to pin office and other applications to the TaskBar for Windows 7.  It wasn’t too intelligent and so with each new version or type of office the script needed changing.  Fast forward to this week and I’ve re-written it entirely in PowerShell.

This new version is much better and will search for the correct programs paths a little better and pin away.

Windows 10 build 9926 update failing

If you’re getting error 0x80070057 when trying to pull the updates try this registry fix:

 

Restart the Windows Update server or reboot and the updates should start flowing again.

Getting RSAT to work on Windows 10 build 9926

After a fair amount of digging around on the web I’ve finally come up with a working solution which will get RSAT installed on a machine that doesn’t have EN-us as the default language, mine is EN-gb

Firstly download one of these language files

  1. 32bit version
  2. 64bit version

Next press Winkey + R and run lpksetup  (that’s an L not an I)

Now follow this guide here which will walk you through the process of installing a new language then changing the default to EN-us.

Once this is done, download RSAT from here, don’t google it or you will likely end up finding the file which is 34Mb and not the 49Mb one.  Both have the same KB which is super annoying!

 

If you’ve got this far you can install RSAT then flip the default language back to whatever you started with.

Uninstalling Internet Explorer

For some reason Microsoft always seem to make removing this application difficult.  These commands however seem to work much better than using the GUI but there’s no surprise there really!

Example for uninstalling Internet explorer 9
  • Log on to the computer by using an administrator account or an account that has administrative rights.
  • Close all Internet Explorer browser windows.
  • Click Start, type cmd in the Search box, and then click cmd under Programs.
  • Right click and select Run as administrator
  • Copy the following command:
  • Paste the command into the Command Prompt window, and then press Enter.
  • Restart the computer.
Example for uninstalling Internet explorer 10
  • Log on to the computer by using an administrator account or an account that has administrative rights.
  • Close all Internet Explorer browser windows.
  • Click Start, type cmd in the Search box, and then click cmd under Programs.
  • Right click and select Run as administrator
  • Copy the following command:
  • Paste the command into the Command Prompt window, and then press Enter.
  • Restart the computer.
Example for uninstalling Internet explorer 11
  • Log on to the computer by using an administrator account or an account that has administrative rights.
  • Close all Internet Explorer browser windows.
  • Click Start, type cmd in the Search box, and then click cmd under Programs.
  • Right click and select Run as administrator
  • Copy the following command:
  • Paste the command into the Command Prompt window, and then press Enter.
  • Restart the computer.

Copyright © 2014. Created by Mark. Powered by WordPress.