Friday, 23 October 2020

Not actually a computer thing but...

...Apple really, really don't want you using two phones with the same Apple ID. Not sure why. Are there really that many people selling on iphones without wiping them first, that this is a security consideration?

TL;DW - you can do it, but expect Apple to lock the account, screw up iMessage and ask both phones if it's ok if the other can do something every time you change functionality. It might just be easier to create a new ID for the new phone.

Thursday, 24 September 2020

DHCP and Powershell

Powershell. Like all coding, it kinda makes sense when you can work through a command, although the chances of ever remembering the correct syntax whilst in the fray of a system meltdown seems remote. Like any foreign language, I suppose it's fine so long as you're in a situation of total immersion. For the rest of us, it's a phrase book all the way.

This morning's fun: trying to extract MAC addresses from a DHCP database so they can be set as reservations. I've done this before with Netsh but the details escape me. And I have that nagging feeling that I ought to be using Powershell, so...

To export leases:

Get-DHCPServerv4Lease -Computer <name> -ScopeID x.x.x.0 | Export-Csv <filename>

For "name" it really is just the name, no \\ required.

Importing can either be done on an individual basis in the console window, or via a .csv file.

The interactive command is

Add-DHCPServerv4Reservation -ScopeID x.x.x.0 -IPAddress x.x.x.x -ClientID "<MAC address>" -Description "<description>"

Note, the MAC address is the hyphenated version.

To do this via .csv, you need the headings "ScopeID", "IPAdress", "Name", "ClientID" and "Description" (typically of Microsoft, these are different names, and in a different order, from those in the export file - this may not be essential, but who knows?)

When you enter the MAC addresses and descriptions, you need the hyphenated address but no quotes.

Powershell command to import from a file:

Import-CSV -Path "<path>" | Add-DHCPServerv4Reservation -ComputerName "<fqdn>"

No, don't ask me why you can export from the NetBIOS name but you need the FQDN to import. It may be moot unless you have an enterprise setup, but I don't feel like testing it on a live server.

Hat-tip to Expert in the Cloud and Microsoft's own docmentation.


Saturday, 5 September 2020

Office

More fighting with Office on the new install, but I found something useful. I knew the default Ctrl-V paste had been set to "keep formatting" - this is also the first option if you right-click to paste from the menu - but I didn't realise you could change the default. File > Options > Advanced > Cut, Copy and Paste section. Options are Keep Source Formatting, Merge, or Keep Text. 

Thursday, 20 August 2020

It's been a while - but Windows 10 is still pants

Remember what I said about Windows 10 oh, about 5 years ago now? Nothing has happened to changed my mind. On the contrary. Now I'm forced into both supporting it and running it on my own computers, my cordial dislike has hardened to outright loathing, accompanied by a strong desire to punch the relevant developers in the throat. Remember, kids - coding without due care and attention is bad for your health.

I've been having particular issues lately, for no obvious reason, with activating VLK versions of Windows. Put in the correct key during install, the build decides it has another key (where the hell did it get that from?) which it can't activate because "the organisation's activation server isn't available". Don't ask me how it's managed to install a KMS version of Windows when I downloaded the ISO for the VLK version and put the volume licence key in. And this is confirmed by the fact that it will activate to the VLK, but only programmatically:

 From an elevated command prompt:

slmgr.vbs -ipk <product key> [this changes the installed key]

slmgr.vbs -ato [this does the activation]

Hat-tip to Carey Frisch MVP.