Powershell script to enumerate server serial number, name, manufacturer

Requires an associated txt file with a list of server names/ ip addresses.


#Pings a list of IP addresses, pulls the serial number, manufacturer and computer name from responsive computers

del C:\Support\Scripts\hardware\dellHardware.txt

#Reads from a list of servers
get-content c:\Support\Scripts\Hardware\dellST.txt | Foreach-Object {

#Sets $Result variable to output of test-connection
$Result = test-connection $_ -Quiet

#If $Result is false (i.e. this machine can’t connect to the remote server),
#Send an email out to support staff saying the remote server is down.
if ($Result -eq $True)
$details = Get-WmiObject win32_SystemEnclosure -ComputerName $_ | Select SerialNumber,PSComputerName,Manufacturer}
Add-Content -Path C:\Support\Scripts\hardware\dellHardware.txt $details

Weird Windows 8 Update error #2

Hmm. Still haven’t got to the bottom of this.

I decided to start updating in “blocks” from the GUI on the basis that I would quickly enough figure out which block of updates was failing on my host machine. So… starting with 49 updates, I installed several batches (starting with .Net) and all went fine until I was down to 15 updates. I then selected the bottom 8 (the last 15 are all just “Update for Windows 8” updates) and this broke my host. So I reverted (using system restore- this is important! Create as many restore points as you need to revert back to…), then tried a different random 5 and these worked. From these last 10 I then tried 2 more, but these broke my machine. My PC then went really crazy and I struggled to get it back, but now- instead of having the same 10 left, I know have 14 updates and I don’t think they’re all part of the original 15 I was down to. More to follow…

EDIT 30/MAY/2013 @ 10:14- Just tried install KB 2768703 and it failed, 100%. So there’s something up with this update, even if it’s not the one causing the update process to fail and revert back.

Server core #02

After a week of playing around with server core I’d say it’s worth sticking with. There’s a bit of a learning curve, but it gets easier to use precisely because you can’t do anything “normal” with it. There’s no explorer, no IE, no control panel etc. You can still install normal programs (such as MDT and WAIK) but basically you end up only using the same few commands over and over again because that’s all you can do. The only thing I’d imagine is tricky is IIS; there seem to be a lot of IIS options to install when running dism /online /get-features so I’d imagine it’s tricky getting the right combination.

iSCSI #01

Think I’ve finally nailed this. With help from various sites, I’ve now got two commands which seem to work after running the iscsicli addtarget command. It’s really important to count how many *s and spaces there are- so the first example starts off T<space>*<space> etc.

iscsicli PersistentloginTarget <IQN> T * * * * 0 2 0 0 * * * u p 1 * *

In order, 0 = set security to none, 2 = enable multipath, 0 = sets header digest, 0 = sets data digest, u is your CHAP username, p is your chap password, 1 = set authentication type to CHAP. I think you can ignore the *’s, they do things but not sure how important they are.

iscsicli loginTarget iqn * * * <INI> <INIPRT> * * * * * * * u p 1 * *

<INI> = initiator name which can be found with iscsicli listinitiators, <INIPRT> = I think should be 2, ensures you know which NIC port is connecting, and u, p and 1 as above.

Fun with server core #01

Server core feels a bit like when you wake up with a jolt thinking you’re somewhere unfamiliar. You can do very little, and the little you can do is radically different. So installing hyper-v involves typing weird commands like

Dism /online /enable-feature /featurename:Microsoft-Hyper-V

Which will get you hyper-v, but won’t help with iSCSCI for example. On that note, MS have (thankfully) left a GUI version of the iscsi initiator which can be invoked by typing iscsicpl.exe. I’d actually rather get to grips with iscsicli.exe, but from my limited experience it’s fond of reporting everything as good and connected when in fact it’s anything but. I’ll post more about iscsicli.exe when I get it working but for now am just going to use it in conjunction with iscsicpl.exe so that I can learn what does what.

Disabling NICs through server core

This is easy tho’ you’d never have guessed.

Firstly, type

netsh interface ipv4 show interfaces

and carefully note the Idx numbers of your interfaces.

Next, type

netsh interface ipv4 set interface interface=xx disabled

replacing xx with Idx numbers from above. Just remember not to disable the interface you’re working on!


Bit of an old link, but worth a read (especially the comments):


Ties in nicely with reading “You are not a gadget”.

Ultimately, the internet is a tool. The sole responsibility with using a tool lies with the person in charge of it. Of course, children are generally less experienced to make judgment calls than adults, so the responsibility gets proxied to the parents. And I think that’s where it should end.

You can use a flint axe-head for a lot of things. Digging. Cutting up a potato. Skinning an animal. Or killing someone. There is clearly more and less acceptability in these examples depending on your viewpoint. Skinning an animal might be fine for some people but not for others. Some people might find it fine to skin certain animals but not others. And parent’s should be there to teach children the rights and wrongs of life until they can decide for themselves (and even then, you can’t guarantee they will continue to have the same views you had).

The keys are education and making it easy (and free?) to obtain per-household filtering solutions. Example: NetGear make a line of wireless routers that talk to their own filtering servers, or you could set SmoothWall to perform filtering.

Freedom is very hard to obtain. And the tricky thing is, we won’t suddenly be plunged into a 1984-style world. We’d get there slowly (like grass growing), and wouldn’t even know when we got there because we wouldn’t have anything to compare it to. No-one would remember being able to access any website you wanted, and you might not be able to read 1984. If you think this somewhat overly negative, just think of the degree to which we put up with CCTV today. Or how gleefully we’ve adopted smartphones and (near)-pervasive internet access because of the “benefits” we get (FaceBook?)- without thinking for one second about the fact that actually these mean we’re being tracked pretty much all the time (yup; although of course it might not be you carrying it, your phone is tracked from cell-to-cell and from access point to access point.

Big Brother is watching you? Well, maybe not you just yet, but it is watching all those lovely devices you use (and of course, Google is watching your house :)). Do you really want to risk reducing your liberty while watching surveillance being increase?

Symantec Backup Exec

Funny that this should pop up today:


Because actually, the bits I’ve seen of 2012 look a lot better and more streamlined than any previous version. Still, I think I’m going to be wary of Symantec for a good while. Let’s face it, the fault uncovered in BE2010 (below- “NDMP duplicate backups”) is a major fault- we’ve been running backup software that hasn’t actually been backing up even though it says it is. There was no hotfix for this specific version, the link I posted was a hotfix for R3 so I’m assuming no-one picked up this exact fault with the original 2010.

In some ways we had a lucky escape; this fault got identified by chance when trying to restore a small amount of CIFS data, which is far preferable (tho’ maybe not on an individual level) to finding out your tapes haven’t worked when all your storage has been burnt to a crisp.

NDMP duplicate backups

Just a quick word of warning- if you’re using Backup Exec 2010 to duplicate disk-based NDMP backups to tape, I’d upgrade to 2010 R3 SP2 (+ 3 associated hotfixes). The long and the short of it is that, chances are those disk backups aren’t being duplicated to tape, regardless of what the job logs say.

This article has further information: Backup Exec 2010 R3 revision 5204 Hotfix 173790 (something to do with DirectCopy). As you can see this is a hotfix for R3 without going to SP2, but I was advised to go straight to SP1 then immediately allow LiveUpdate to install SP2 and hotfixes 180429,176937 and 191248.

This now seems to be working, as I’ve successfully run a restore from tape. Quite why the job histories and logs were giving the thumbs up when it blatantly wasn’t working is beyond me but at least it’s working now.