Stop Edge Hijacking PDF Files

KB ID 0001395

Problem

This question appeared in my inbox today, ‘Edge’ has a nasty habit of assigning itself the default PDF reader, particularly after a round of updates!

Solution

First I went and had a look at my old Experts Exchange Buddy Ramesh’s site (www.winhelponline.com) who had done the heavy lifting and worked out the registry keys;

Note: I’m only concerned with .pdf files, if you want to block .htm and/or .html files, then just repeat this process using the the REG_SZ values from above;

The solution for a single machine is to create the following two registry string values;

HKEY_CURRENT_USER\Software\Classes\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723
REG_SZ Name = NoOpenWith
REG_SZ Name = NoStaticDefaultVerb

Then set the correct file associate like so;

Which is fine for one machine but what if you have hundreds of complaining users! Then we need to employ some Group Policies. But there’s a few hoops to jump though first. On your client machine, the one you have just tested the procedure on, export your file association to an XML file. Open an administrative command window, and execute the following command;

[box]

Dism /Online /Export-DefaultAppAssociations:C:\Windows\Temp\DefaultApps.xml

[/box]

If you take a look at the a file you will see, (providing you did it right) the Adobe/PDF file association.

Now copy the file to a location all your domain clients can see, in my case I’m going to drop it in the sysvol directory.

Crete a new Group Policy linked to the computers you want to apply the change to, then edit it.

Navigate to;

[box]Computer Configuration > Policies> Administrative Templates > Windows Components > File Explorer > Set default associations configuration file  >Enable > Put in the path to your .XML file[/box]

Save and exit the, group policy, now create a SECOND POLICY linked to your USERS.

Navigate to;

[box]User Configuration > Preferences > Windows Settings > Registry > New > Registry Item[/box]

Note: Ive already created the registry values on the machine I’m configuring the policy on, (you can export the key and import it on a domain controller to make things easier for you). Close and exit the policy editor.

Then wait, or Force Group Policy.

Related Articles, References, Credits, or External Links

NA

VMware Fusion: Windows 10 ‘Lost’ Mapped Drive to the Host

KB ID 0001394

Problem

My Windows 10 VM decided it was going to do a major update last night, so I let it get on with it. However today I can no longer access the ‘shared’ drive that it had back to the host (my MacBook).

Solution

I’m pretty sure this is the second time this has happened, so after berating myself for not documenting the fix last time, this is the fix. Run Regedit (Windows Key+R > regedit {Enter})

Navigate to: HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Control > NetworkProvider > Order

Locate the PROVIDERORDER entry;

Move the ‘vmhgfs‘ entry, so that it is the first one in the list > OK > Exit the registry editor.

That’s it, no reboot or anything, your drive should start working again.

Related Articles, References, Credits, or External Links

NA

Windows: Enable ‘Previous Versions’

KB ID 0001393

Problem

Anyone who’s ever trashed a spreadsheet, or saved a file over the top of one that they shouldn’t, will appreciate previous versions. It’s done by a technology we have had since Windows XP (and Server 2003) called ‘shadow copy’. If you are familiar with virtualisation it’s a bit like taking ‘snapshots’ of files.

It’s also great for sysadmins, as users can ‘restore’ their own files if they break them. The problem is, the first time you need it, its probably not turned on!

Solution

You enable shadow copies at a ‘volume’ level, Server Manager> Tools> Computer Management > Share Folders > Configure Shadow Copies > Select the Volume > Enable.

It will use up to 10% of the drive to store its copies, you can change this if you require (Settings), you can also change the schedule that copies are taken (Settings > Schedule).

Related Articles, References, Credits, or External Links

NA

Windows Server: Connecting to iSCSI Storage Using MPIO

KB ID 0001392

Problem

In my scenario my Windows Server is a VMware virtual machine. To enable MPIO (Multipath I/O) I’m going to need two network cards, connected to the two iSCSI networks. 

Above I’ve shown both iSCSI networks in  different colours 192.168.51.0/24 and 192.168.50.0/24 in production I would also have these in their own VLANs, (or even separate physical networks).

This article is not about setting up your iSCSI Target/Storage, I’m assuming you have this up and running with the correct IP addresses connected to the correct networks ready to go.

Note: I’m also NOT using iSCSI authentication, and I’m also assuming you have allowed either the two IP addresses of the Windows server, (or more likely its iSCSI iqn address), access to the storage.

Solution

Firstly MPIO is NOT enabled or installed by default, you need to add it. Open Server Manager > Manage > Add Roles and Features > Follow the wizard all the way to ‘features’ > Enable Multipath I/O > Complete the Wizard.

Back in Server Manager > Tools > MPIO > Discover  Multi-Paths > Add support for iSCSI devices > Yes  > Let the server reboot.

After the reboot go back into the MPIO properties, and make sure iSCSI is now listed, (MSFT2005iSCSIBusType_0x9). You can close the MPIO properties now.

Now back in Server Manager > Tools > iSCSI Initiator.

First task is to add the TWO iSCSI Target IP’s (192.168.50.200 and 192.168.51.200) > Discovery > Discover Portal > Put in the first iSCSI Target IP > Advanced > Local Adapter = Microsoft iSCSI Initiator > Initiator IP = The Servers NIC that’s on the same iSCSI network as this target, (i.e. 192.168.50.6 or 192.168.51.6) > OK > OK > Apply > OK.

NOW REPEAT THE PROCEDURE FOR THE SECOND iSCSI TARGET

Assuming your iSCSI and networking setup are correctly, you should start to see the storage appearing on the ‘Targets’ tab. Select the first piece of storage you want to attach > Connect > Tick ‘Enable Multi-path’ > Advanced > Local Adapter = Initiator IP (either 192.168.50.6 or 192.168.51.6)  > Target Portal IP  = (The iSCSI Target IP that corresponds to the IP you have just set, either 192.168.50.200 or 192.168.51.200) > OK > OK > Apply > OK.


The status should change to connected.

NOW REPEAT THE PROCEDURE A ‘SECOND TIME’ FOR THE SAME PEICE OF STORAGE, BUT CONNECT TO IT FROM THE OTHER iSCSI IP ADDRESS, TO THE OTHER iSCSI TARGET IP. THERE YOU CONNECT TO EACH ONE ‘TWICE’ (ONCE OVER EACH iSCSI NETWORK).

If you now look in the properties of the storage, you will see it has two identifiers and two IPv4 Portal groups.

At this point you would need to go into ‘Disk Management’ (Server Manager > Tools > Computer Management > Disk Management). You will see the storage presented but ‘Offline’ you will need to bring the drive online > Create a partition on it, (if it does not already have one),  and you can also assign a new drive letter. Note: Look in the Properties here, and you can prove MPIO is working and change the MPIO policy (if you require).

Related Articles, References, Credits, or External Links

NA

Windows 10: Why Can’t I Launch MMC?

KB ID 0001391

Problem

Usually if I’m in Windows I’m on a server, and if I need a Microsoft Management Console, I simply type mmc, and away we go. On my new work Windows 10 laptop, when I do that and this happens;

Solution

I’ve also always assumed it was mmc.msc, but a search round on my laptop discovered that, (on Windows 10 anyway) it’s an exe file.

So if you search for that it works?

You can still launch it straight from the run box (Windows Key+R) though?

And you can still launch it straight form command line, using mmc or mmc.exe

Related Articles, References, Credits, or External Links

NA

Hyper V: Add a VM as a Cluster Resource

KB ID 0001390

Problem

If you have a Hyper  V cluster, then you should add virtual machines with ‘Failover Cluster Manager’ but if someone does not, (i.e. they add them directly to a host), then you wont see them in the list! So how do you add them in?

Solution

In Cluster Failover Manager > Right Click the failover node > Configure Role.

Next.

Scroll down and select Virtual Machine > Next.

Non clustered VM’s will be shown select the VM(s) as required > Next.

Next.

Finish

Related Articles, References, Credits, or External Links

NA

Windows Server 2016: Active Directory Recycle Bin

KB ID 0001389

Problem

To be honest we have had the capability to recover deleted active directory objects for ages. It’s just in Windows 2016 things look a bit neater.

Enable Active Directory Recycle Bin

From Server Manager > Tools > Active Directory Administrative Center ,> {Domain-Name} > Enable Recycle Bin.

OK

Note: You may need to restart ADAC before you will be able to see the option greyed out.

Enable Active Directory Recycle Bin with PowerShell

From an administrative PowerShell window;

[box]

Enable-ADOptionalFeature ñIdentity 'CN=Recycle Bin Feature,CN=Optional Features,CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=domainx,DC=net' ñScope ForestOrConfigurationSet ñTarget 'domainx.net'

[/box]

Restore an AD Object From the Recycle Bin

I’ve deleted a user , and I want to restore him. From Server Manager > Tools > Active Directory Administrative Center > {Domain-Name} > Deleted Objects.

Locate the deleted object > Restore.

Restore an AD Object From the Recycle Bin with PowerShell

First let’s make sure the item is there to restore!

[box]

Get-ADObject -filter {displayname -eq "Pete Long"} -includedeletedobjects

[/box]

Now we’ve found our deleted user, to restore them, use the same command but ‘pipe’ it to a Restore-ADObject commandlet.

[box]

Get-ADObject -filter {displayname -eq "Pete Long"} -includedeletedobjects | Restore-ADObject

[/box]

 

Related Articles, References, Credits, or External Links

NA

IBM Storwize 3700 Recover Lost IP Address

KB ID 0001388

Problem

While repurposing an IBM Storwize V3700 SAN, it became apparent that I didn’t know the IP addresses and they had been ‘misplaced’ by the client. 

Solution

Arm yourself with a FAT32 formatted USB drive, and create a file on it called satask.txt.

Pop your USB into the controller, and the fault light will flash for a few seconds.

Now on your USB drive theres should be a file called satask_result.html which you can open and locate the IP addresses

Related Articles, References, Credits, or External Links

NA

Hyper V: Live Migration Error 0x80071008

KB ID 0001387

Problem

When attempting to perform a ‘live migration’ of a virtual machines storage, this happened.

Error
Invalid Parameter Code 0.80071008

Solution

Oddly I had already moved one of the virtual machines drives to another cluster, before this happened, so I was a little confused. To get the migration to work, I needed to ‘unmount’ the parent VMs mounted .ISO file.

The set the migration going again.

Related Articles, References, Credits, or External Links

NA

Hyper V: Get All The Guest VM IP Addresses

KB ID 0001386

Problem

Getting the IP address for an individual guest VM is easy enough, but if you have a lot of guest VM’s then you need some PowerShell.

Solution

To get the IP’s of all the Guest VM’s on an individual Hyper-V host, use the following syntax;

[box]Get-VM | Select-Object -ExpandProperty NetworkAdapters | Select-Object VMName,IPAddresses | Format-Table -Auto[/box]

Note: The entries with no IP, are either powered off, (or are VM replicas).

But if you have a Hyper-V cluster, you would have to do this on every host. Or you can use the following syntax;

[box]Get-VM -ComputerName (Get-ClusterNode)| Select-Object -ExpandProperty NetworkAdapters | Select-Object VMName,IPAddresses | Format-Table -Auto[/box]

Related Articles, References, Credits, or External Links

NA