Convert Windows boot from BIOS to UEFI without decrypting Bitlocker

I wanted to convert an MBR/BIOS boot drive to GPT/UEFI, but without needing to decrypt and then re-encrypt Bitlocker. Mainly because I am lazy. This worked, but I’ll warn that the advice to decrypt completely first is without any doubt the safest way to go.

Follow the instructions for converting from BIOS to UEFI boot.

With the following changes:

  • Print out your Bitlocker Recovery Key from Control Panel, Bitlocker. You will need this key.
  • Take a backup. No seriously. Use Veeam Endpoint if you don’t have anything else installed to take backups. Stuff goes wrong with computers, and you don’t want to lose your system installation and data.
  • Suspend Bitlocker protection on your system drive.
  • Reboot from your Windows installation / recovery DVD/USB, verify that you can get to your c:\windows directory. This might be d:\windows if you have a recovery partition at the end of the disk.
  • Now boot into Windows and convert to GPT using gptgen
  • When you then boot into the Windows installation / recovery media, you’ll be asked for the Bitlocker Recovery Key. After that, the rest of the steps are as in the generic instructions.
  • When booting into Windows (assuming you changed your BIOS to boot (U)EFI instead of MBR now), you’ll be asked for the recovery key again.
  • In my case, the drive didn’t show suspended. I suspended it again.
  • After that, resuming Bitlocker encryption will fail with “The System cannot find the file specified”.
  • Open Explorer, navigate to C:\Windows\System32\Recovery and rename the file “ReAgent.xml” to “ReAgent.xml.old”
  • Resume Bitlocker encryption on drive C:\ This should now succeed.
  • Reboot for good measure to verify that everything works and you don’t get prompted for the recovery key any more.

Change admin user password expiry on JunOS SPACE

The admin user on JunOS SPACE, which is used for ssh / root access, has a default password expiry of 70 days. This may not be desired.

NB: An upgrade of the JunOS SPACE platform will set the admin password expiry to the default of 70 days again. To avoid the admin user password being prompted for change after the upgrade, this procedure needs to become part of your documented upgrade procedure for JunOS SPACE:

  • Change admin user last password change to be today using chage
  • Upgrade SPACE
  • Change admin user expiry to “never” using chage

The Linux command “chage” will show you the current settings for a user and let’s you change those:

  • Log in as admin via ssh
  • Choose “(Debug) run shell”
  • Use “chage” to see and then change the admin password expiry:
    chage -l admin
    Last password change : Mar 15, 2016
    Password expires : May 24, 2016
    Password inactive : never
    Account expires : never
    Minimum number of days between password change : 7
    Maximum number of days between password change : 70
    Number of days of warning before password expires : 7
  • Change the parameters: 

    chage admin
    Changing the aging information for admin
    Enter the new value, or press ENTER for the default

    Minimum Password Age [7]: 0
    Maximum Password Age [70]: 99999
    Last Password Change (YYYY-MM-DD) [2016-03-15]: <today’s date>
    Password Expiration Warning [7]:
    Password Inactive [-1]:
    Account Expiration Date (YYYY-MM-DD) [1969-12-31]:

    And verify:

    chage -l admin
    Last password change : Mar 25, 2016
    Password expires : never
    Password inactive : never
    Account expires : never
    Minimum number of days between password change : 0
    Maximum number of days between password change : 99999
    Number of days of warning before password expires : 7

Reset admin password on JunOS SPACE VM

Picture this: Bob, your JunOS SPACE administrator, left the company. IT diligently wiped his laptop. Bob was the only one who had the admin password (for ssh / CLI access) to your JunOS SPACE installation.

After vowing to do better in future and storing all infrastructure passwords in some form of centralized, encrypted, backed-up password safe, you are left with the task of restoring access.

If you are running your JunOS SPACE instance on an appliance, all you need is a USB stick and Juniper’s instructions. (Note: That may not be entirely true – see discussion of how /etc/shadow behaves in 14.1R2 of SPACE, below)

If you are running your JunOS SPACE instance in a VM, read on.

You’ll need vSphere-level access to the VMWare host JunOS SPACE runs on. Make friends with the VMWare admin.

You’ll need an ISO of a Linux rescue disk.

Power down the SPACE VM and change its boot properties to force boot into BIOS, and delay by 10,000ms for good measure, like so:

Screenshot 2015-07-16 10.44.33

Power on the SPACE VM, and open a Console. You’ll find yourself in the BIOS shortly. Connect the virtual CD drive to the ISO you downloaded (that’s the CD-with-wrench icon in the Console) and change the BIOS to boot from CD first, like so:

Screenshot 2015-07-16 10.54.02

Alternatively, you could have left the BIOS alone and hit ESC to get the boot menu during the 10 second boot delay.

Whichever option you choose, make sure the CD has finished connecting (loading the ISO) before you hit F10/Enter. If you are remote to your VMWare host, it may make sense to upload the ISO to the datastore first, and connect the virtual CD to that copy.

Once the VM has booted from the rescue ISO, I chose the “standard with US keymap” boot option for the rescue disk.

Use lvscan to see the device names of the SPACE disks:

 ACTIVE '/dev/jmpvgnocf/lvroot' [25.41 GB] inherit
 ACTIVE '/dev/jmpvgnocf/lvtmp' [17.91 GB] inherit
 ACTIVE '/dev/jmpvgnocf/lvvar' [207.78 GB] inherit
 ACTIVE '/dev/jmpvgnocf/lvlog' [4.88 GB] inherit

Mount the root partition:

mount /dev/jmpvgnocf/lvroot /mnt/custom

Move the shadow- backup file (don’t delete it):

mv /mnt/custom/etc/shadow- /mnt/custom/root

I tried this without moving shadow- and it would revert to the previous admin password after editing shadow.

Juniper’s original instructions for the appliance, based on the now-ancient SPACE 1.2, want you to save an empty password (::) for admin in shadow. When I tried that, I could no longer log in.

Instead, I used passwd on the rescue CD to get the crypt string for the password “abc123”. It is:


With this in hand, I could “vi /mnt/custom/etc/shadow” and insert the string for the new password, which looks like this:

Screenshot 2015-07-16 12.55.28

Save that file using “:x!” in vi and you are ready to “reboot”

Note: Typing that string in the VMWare Console is going to be extremely error-prone. It makes sense to ssh to the rescue Linux instead, so you can copy/paste. Use “ifconfig” to see whether you received a DHCP address. If not, you’ll need to follow the instructions for the rescue image to enable networking – or manually type the password string.

If you changed the BIOS to boot from CDROM first, undo that change when the boot screen comes up.

After reboot, you should be able to log in as admin with the default password and use the option “1” to change the password:

Screenshot 2015-07-16 12.54.59

Now that you’re back in the CLI, you can follow Juniper’s instructions for resetting the password for the ‘super’ user which is used for GUI access and the ‘maintenance’ user which is used for software updates.

With those three accounts restored, you have the access needed to administrate JunOS SPACE again – and set up further GUI authentication for users as desired.

Restoring Extreme Networks Netsight user login

In Extreme Networks’ Netsight management appliance, it is possible to configure external authentication (LDAP or RADIUS) and not set it to “fail to OS,” which is a checkbox that is unchecked by default. If your LDAP or RADIUS server is down, or if you made a mistake entering settings, you’ve just locked yourself out of the Web UI.

There is a way to recover from this without rebuilding Netsight.

I’ll be assuming you still have an OS-level login via ssh to the unit. These instructions assume Netsight on Linux. Netsight on Windows would be similar, you’d just have to figure out where your MySQL utilities live.

This was tested with Netsight 6.3

After logging in to the OS (an ssh session if this is Netsight on Linux), start mysql and connect to the data base:

cd /usr/local/Extreme_Networks/Netsight/mysql/bin
./mysql -unetsight -penterasys --socket /tmp/netsight_mysql.sock -hlocalhost -P4589 netsight

Take a look at the current settings for authentication:

SELECT * FROM nsproperties;

Next, to re-enable Web UI login, you could just set your authentication type back to OS authentication:

UPDATE nsproperties SET VALUE='Default ( OS Authentication )' WHERE NAME='serverAuthType';

Alternatively, you could instruct the authentication to fall back to OS authentication if it fails. You’d have to do this for either LDAP or RADIUS, depending on which one you are using:

UPDATE nsproperties SET VALUE='true' WHERE NAME='serverAuthLDAPFailToOS';
UPDATE nsproperties SET VALUE='true' WHERE NAME='serverAuthRadiusFailToOS';

And for future reference, always check the “Fail To OS” checkbox first before doing any further work in your external authentication settings screen.

Better WebEx / Lync / Skype meeting locations for mobile users

[Edit 2016-12-01 … changed the VBA code to format the phone number with dashes]
[Edit 2016-11-07 … changed the VBA code to handle WebEx invites, too][Edit 2015-10-27 … changed the VBA code to be able to extract the phone number]

By default, the “Location” for a Skype for Business (ne Lync) Meeting in an Outlook calender invite reads as “Skype Meeting”. WebEx is no better. This is not very friendly to mobile users who want to dial in via phone. If the body of the meeting contains a lot of agenda text, the WebEx / Skype dialin information may not display at all on mobile; and without something in the “Location”, a user can’t just tap the invite to dial in directly.

I wanted to have a Macro that lets me set the “Location” to “phone-number,,,conference-id#”. This way, the user can dial, and will be logged in automatically.
An alternative (you’d need to slightly modify the code by replacing “,,,” in the second line with ” ; “) would be “phone-number ; conference-id#” which makes the conference id available in the dial screen to be sent with one touch.

Further, I wanted to be able to control permissions through the Skype Meeting Options, which means I can’t use a “dedicated meeting space”, but have to use the “new meeting space” option, which means the conference ID changes with every meeting.

I want to hear when people enter or leave, I don’t want anyone to have to wait around in a lobby, and I conference with customers, so I don’t want restrictions as to who can join or present. The screenshot below shows the permissions I chose before hitting “Remember Settings”.

Screenshot 2015-06-01 10.33.50

The macro I created can extract US phone numbers. If you have a need for international number detection, you’d need to key on the country code and then have individual patterns from there in a case structure. There’s no good way I know of to handle international number formats in a single regex.

In order to use the macro, you’ll need to:

– Enable access to the coding tools in Outlook, the “Developer” toolbar

– Create the macro

– Sign the macro and save

– Link the macro to the “New Appointment” screen

The macro was created for use with Outlook 2016, 2013 and 2010. The current version has only been tested with Outlook 2016.

Enable access to the coding tools in Outlook

From the Outlook main windows, click on “File” then “Options”

In the “Outlook Options” window, click on “Customize Ribbon” on the left. Check the “Developer” ribbon to show up.

Click OK

Screenshot 2015-06-01 10.41.13

Create the macro

From the Outlook main window, click the “Developer” toolbar, then the “Visual Basic” icon

Right-click the Project name in the left pane, choose “Properties…” and set the “Project Name” to “Conf”, then click OK.

Under “Modules”, you should see a “Module 1” with an empty window to the right. Click it and paste the code below.

<Edit> Now with code formatting that will paste correctly.

Sub AddLocation()
Application.ActiveInspector.CurrentItem.Location = GetConfNumUsingRegEx() & ",,," & GetConfCodeUsingRegEx() & "#"
End Sub

Function GetConfNumUsingRegEx() As String
 ' Set reference to VB Script library
 ' Microsoft VBScript Regular Expressions 5.5
 Dim olAppt As Outlook.AppointmentItem
 Dim Reg1 As RegExp
 Dim M1 As MatchCollection
 Dim M As Match
 Dim fNumber As String ' Formatted phone number
 Set olAppt = Application.ActiveInspector.CurrentItem
 ' Debug.Print olAppt.Body

 Set Reg1 = New RegExp
 For i = 1 To 2 ' Run through twice in case this hasn't been saved and WebEx info isn't there yet
 With Reg1 ' look for the bizarre CI number we use, and prefer it if it's there
 .Pattern = "tel:\+1855-SkypeCI"
 .Global = True
 End With
 If Reg1.test(olAppt.Body) Then
 GetConfNumUsingRegEx = "+1-855-759-7324"
 Exit Function
 End If
 ' You can copy / paste code from "With Reg1" to "End If" any number of times if there are
 ' additional preferred numbers / oddly formatted numbers you want to be on the lookout for
 With Reg1 ' look for tel: style links, US numbers being matched
 .Pattern = "tel\s*[:]+\s*((?:\+?(\d{1,3}))?[-. (]*(\d{3})[-. )]*(\d{3})[-. ]*(\d{4})(?: *(?:ext\.|ext|x)?\s*(\d+))?)\w*"
 .Global = True
 End With
 If Reg1.test(olAppt.Body) Then
 Set M1 = Reg1.Execute(olAppt.Body)
 For Each M In M1 ' Find preferred toll-free number
 If (Found = False) And ((M.SubMatches(2) = "800") Or (M.SubMatches(2) = "844") Or (M.SubMatches(2) = "855") Or (M.SubMatches(2) = "866") Or (M.SubMatches(2) = "877") Or (M.SubMatches(2) = "888")) Then
 Found = True
 GetConfNumUsingRegEx = FormatPhoneNumber(M.SubMatches(0))
 Exit Function
 End If
 ' No preferred number, use the first one
 Set M = M1(0)
 GetConfNumUsingRegEx = FormatPhoneNumber(M.SubMatches(0))
 Exit Function
 End If
 With Reg1 ' sometimes tel: is missing, again US numbers being matched
 .Pattern = "((?:\+?(\d{1,3}))?[-. (]*(\d{3})[-. )]*(\d{3})[-. ]*(\d{4})(?: *(?:ext\.|ext|x)?\s*(\d+))?)\w*"
 .Global = True
 End With
 If Reg1.test(olAppt.Body) Then
 Set M1 = Reg1.Execute(olAppt.Body)
 For Each M In M1 ' Find preferred number
 If (Found = False) And ((M.SubMatches(2) = "800") Or (M.SubMatches(2) = "844") Or (M.SubMatches(2) = "855") Or (M.SubMatches(2) = "866") Or (M.SubMatches(2) = "877") Or (M.SubMatches(2) = "888")) Then
 Found = True
 GetConfNumUsingRegEx = FormatPhoneNumber(M.SubMatches(0))
 Exit Function
 End If
 ' No preferred number, use the first one
 Set M = M1(0)
 GetConfNumUsingRegEx = FormatPhoneNumber(M.SubMatches(0))
 Exit Function
 End If
 olAppt.Save ' This will fill in WebEx info with WebEx Productivity Tools running and try again
 Next i
End Function

Function GetConfCodeUsingRegEx() As String
 ' Set reference to VB Script library
 ' Microsoft VBScript Regular Expressions 5.5
 Dim olAppt As Outlook.AppointmentItem
 Dim Reg1 As RegExp
 Dim M1 As MatchCollection
 Dim M As Match
 Set olAppt = Application.ActiveInspector.CurrentItem
 ' Debug.Print olAppt.Body
 Set Reg1 = New RegExp
 With Reg1 ' look for Skype/Lync pattern
 .Pattern = "Conference ID\s*[:]+\s*(\d*)\s*"
 .Global = True
 End With
 If Reg1.test(olAppt.Body) Then
 Set M1 = Reg1.Execute(olAppt.Body)
 Set M = M1(0)
 GetConfCodeUsingRegEx = M.SubMatches(0)
 Exit Function
 End If
 With Reg1 ' look for WebEx public or private room pattern
 .Pattern = "[Aa]ccess code\)?\s*[:]+\s*(\d*\s?\d*\s?\d*)"
 .Global = True
 End With
 If Reg1.test(olAppt.Body) Then
 Set M1 = Reg1.Execute(olAppt.Body)
 Set M = M1(0)
 GetConfCodeUsingRegEx = Replace(M.SubMatches(0), " ", "") ' strip all spaces
 Exit Function
 End If
End Function

Function FormatPhoneNumber(sRawNumber As String)
 'Purpose: Formats a US telephone number as 999-999-9999,,,165.
 'Works with x, ext, ext. or just space before extension
 'Works with or without 1-number or +1-number
 'Works with or without spaces, dashes or parentheses between and around number groups
 'Does NOT deal with international numbers

 Dim sPhoneNumber As String 'Phone number formatted as 999-999-9999
 Dim Reg1 As RegExp
 Dim M1 As MatchCollection
 Dim M As Match
 Set Reg1 = New RegExp
 With Reg1 ' US numbers being matched
 .Pattern = "((?:\+?(\d{1,3}))?[-. (]*(\d{3})[-. )]*(\d{3})[-. ]*(\d{4})(?: *(?:ext\.|ext|x)?\s*(\d+))?)\w*"
 .Global = True
 End With
 If Reg1.test(sRawNumber) Then
 Set M1 = Reg1.Execute(sRawNumber)
 Set M = M1(0)
 If Not Len(M.SubMatches(1)) = 0 Then ' Starting with a code like "1"
 sPhoneNumber = M.SubMatches(1) & "-" & M.SubMatches(2) & "-" & M.SubMatches(3) & "-" & M.SubMatches(4)
 sPhoneNumber = M.SubMatches(2) & "-" & M.SubMatches(3) & "-" & M.SubMatches(4)
 End If
 If Not Len(M.SubMatches(5)) = 0 Then ' Found an extension
 sPhoneNumber = sPhoneNumber & ",,," & M.SubMatches(5)
 End If
 End If
 'Return formatted phone number
 FormatPhoneNumber = sPhoneNumber

End Function

This code should work as-is. If desired, you can hard-code a number to be used for your own invites inside the GetConfNumUsingRegex() function.

In the Visual Basic editor, click the “Tools” menu, then “References…” and check the “Microsoft VBScript Regular Expressions 5.5”, then click “OK”. This is required for the macro to function.

Screenshot 2015-06-01 11.11.32

Here is a screen shot of the VBA editor for reference:

Screenshot 2015-06-01 10.44.26

Sign the macro and save

Outlook 2010, by default, has a macro security setting of “Notifications for digitally signed macros, all other macros disabled”. Without signing the macro, it may work the first time around, but you might get an error message that “the macros in this project are disabled” in future.

We’ll create a self-signed cert and apply it. For Outlook 2010 and 2013, look for the “Digital Certificate for VBA Projects” application in the Start menu, give it your name, and click “OK” to create the certificate, like so:

Screenshot 2015-06-02 13.47.47

N.B.: Your installation of Office might not have linked this utility in the Start Menu. My O365 copy of Office 2016 does not, for example. In that case, open File Explorer, navigate to where Office is installed (C:\Program Files (x86)\Microsoft Office\Office16 is the default path for Office 2016), and launch the “SELFCERT.EXE” program.

Next, apply this certificate to your project. In the VBA editor, choose the “Tools” menu then “Digital Signature…” and apply the certificate you just created by selecting it via “Choose…” then clicking “OK”:

Screenshot 2015-06-02 13.48.10


Lastly, save your Project via “File” and “Save VbaProject.OTM”.

When that is done, you can close the VBA editor screen either via the X in the corner or through the “File” menu.

At some point when first executing the macro, you may see a warning whether to trust the certificate you just created. Choose “Enable Macros” or “Trust all documents from this publisher” :

Screenshot 2015-06-02 13.53.19


Link the macro to the “New Appointment” screen

This was actually the least intuitive step of the whole lot.

In Outlook, click on “Calendar”, then “New Meeting”. As far as I can tell, you can only add the macro to the ribbon while in that window.

With that new meeting window open, click “File”, then “Options”.

Click on “Customize Ribbon”

Right-click “Appointment” and choose “Add New Group”

Right-Click the “New Group (Custom)” and rename it to “Conf”

Select “Conf (Custom)” and use the up-arrow to the right to move it just under “Skype Meeting” or “WebEx”, depending on which you use.

With “Conf (Custom)” still selected, change “Choose commands from:” on the left-hand list to “Macros”

Click on the “Conf.AddLocation” macro and use the “Add>>” button

The macro should now show up in your “Conf (Custom)” group.

Click OK and test the macro!

Screenshot of what this ribbon option window looks like below.

Screenshot 2015-06-01 10.52.39

All Done

This is a fair serious amount of effort just to get a phone number into the “Location” field. For me, it was worth it because that effort makes life easier for my customers joining my meetings.

If so desired, you can disable the “Developer” toolbar again.

Canon EOS utility causes high “System” CPU, network meltdown

This is one of those slightly odd ones. I had high CPU on my PC even when not running anything, 20-25% (one whole core in essence) taken up by “System”. Mouse responsiveness was sluggish, sound would stutter, the works.

I tracked it down to ndis, and my Ethernet driver, using Sysinternals Process Explorer. Other folk have had similar experiences, so I updated the Ethernet driver. Things got worse. Rolled back and disabled all power savings functions on Ethernet. That helped a little, but only a little.

After a few weeks of off-and-on trying to fix this (and business travel in between), it occurred to me that my driver might be behaving just fine, that it was just genuinely busy – that there might be some form of traffic flood on the wire that caused my symptoms.

Sure enough. SSDP (UPnP discovery) packets to an obscene degree, originating from another machine in the network, with the string “Canon” in the discovery.

This was the Canon EOS Utility 2, or rather the UPnP discovery part of it. I saw no way of disabling UPnP discovery in settings, and the user was opposed to uninstalling the utility, so I just renamed the UPnP discovery exe so it couldn’t be started on boot, then rebooted the machine to check that worked. Problem solved. By killing the UPnP discovery process on another PC, my PC is responsive again.

That UPnP discovery process misbehaves. Until Canon fixes the issue – if they will – renaming it is the only workaround I can see.

If your System process CPU is high and it’s your network driver that’s doing it, run wireshark. It might not be your system at fault.

Installing VMWare Tools on JunOS SPACE 15.2 or older

[Edit 2017-05-04] The below is still valid for JunOS SPACE 15.2 or older. From JunOS SPACE 16.1 on, you can use “Open VM Tools” instead.

JunOS SPACE, Juniper’s management platform for JunOS devices (switches, routers, firewalls) does not come with gcc or kernel-headers. Installing VMWare Tools from a mounted ISO via is not all that successful. Happily, VMWare still provides RPM versions of those tools. SPACE 15.2 is built on CentOS 5, which in turn is a RHEL 5 clone.

Be sure to use the VMWare Tools package that matches the version of CentOS your SPACE is running.

1) Start by downloading the RPMs for VMWare Tools on RHEL 5. You’ll want the following (or their current equivalent):


That list might change with newer versions of the tools and of RHEL, of course. When in doubt, grab just the vmware-tools-esx-nox package, try to install it, and take a note of all the dependent packages it wants, then download those too.

2) scp the lot to SPACE, say to /var/tmp. While WinSCP is unhappy with the shell the admin user runs on, command-line scp does not care and will work. Choose any version you like: The one that comes with Putty, the one that comes with Cygwin, an Ubuntu one on Windows 10, or any other. And if you’re running OSX or Linux, you can feel extra-smug because you have scp as part of your base OS.

3) Install those RPMs. Now, you could install the GPG key they are signed with, but if you trust that you got them from VMWare, in an unaltered form, then just:

yum install --nogpgcheck vmware-tools*rpm

If there are dependency errors, download the missing packages as well and try again.

5) Satisfy yourself that vmtoolsd is running:

service vmware-tools-services status


vSphere should now be reporting that SPACE is running “VMtools 3rd party/independent”. And that’s all there is to it.

The kmod portion of the tools won’t install, by the way – but then it’s not needed.