Author Archives: geoff

Repairing Windows 2012 R2 Startup

Method 1:

===============
1. Put the Windows Server 2012 R2 installation disc into the disc drive, and then start the computer.
2. Press a key when the message indicating “Press any key to boot from CD or DVD …”. appears.
3. Select a language, a time, a currency, and a keyboard or another input method, and then click Next.
4. Click Repair your computer.
5. Click the operating system that you want to repair, and then click Next.
6. In the System Recovery Options dialog box, click Command Prompt.
7. Type sfc /scannow, and then press ENTER.

Method 2:
===============
1. Put the Windows Server 2012 R2 installation disc in the disc drive, and then start the computer.
2. Press any key when the message indicating “Press any key to boot from CD or DVD …”. appears.
3. Select a language, time, currency, and a keyboard or another input method. Then click Next.
4. Click Repair your computer.
5. Click the operating system that you want to repair, and then click Next.
6. In the System Recovery Options dialog box, click Command Prompt.
7. Type Bootrec /RebuildBcd, and then press ENTER.

Method 3:
===============
1. Put the Windows Server 2012 R2 installation disc into the disc drive, and then start the computer.
2. Press a key when the message indicating “Press any key to boot from CD or DVD …”. appears.
3. Select a language, a time, a currency, and a keyboard or another input method, and then click Next.
4. Click Repair your computer.
5. Click the operating system that you want to repair, and then click Next.
6. In the System Recovery Options dialog box, click Command Prompt.
7. Type BOOTREC /FIXMBR, and then press ENTER.
8. Type BOOTREC /FIXBOOT, and then press ENTER.
9. Type Drive:bootBootsect.exe /NT60 All, and then press ENTER.

Note: In this command, Drive is the drive where the Windows Server 2012 R2 installation media is located.

Disable GwX Notifications via SRP GPO

1. Under Computer Configuration, go to Policies, Windows Settings, Security Settings, then Software Restriction Policies.

2. If you haven’t activated Software Restriction Policies, do it now. Once done, you’ll see the following in the main area when Software Restriction Policies is clicked.
21

3. Right-click on Additional Rules and choose New Path Rule…

4. Create the SRP by copying my configuration below and click OK. Make sure the Path is C:WindowsSystem32GWXGWX.exe and the Security Level is Disallowed.
DisableGwx2

From here on, you can try running a gpupdate /force or restarting a computer that was affected by Microsoft’s GwX popup. The Windows 10 notification icon should be gone on those affected computers.

Find out what printers a user has mapped remotely

Well, you can take a look at the Win32_Printer WMI class,

Get-WMIObject Win32_Printer -ComputerName $Comp

But, I think this will get you even better results:

New-PSSession $Comp | Enter-PSSession
Get-ChildItem Registry::HKEY_Users$UserSIDPrintersConnections
Exit

Without using PS Remoting, you could do this instead:

$Printers = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey(Microsoft.Win32.RegistryHive]::Users, $ServerName)

You get the idea. Basically, you need to access that user’s registry key with whatever method and enumerate whatever you find in PrintersConnections.

ReInstall Group Policy Software

Group Policy Software Installation (GPSI) is one of the greatest gifts that Microsoft has given you! It is a free and semi-robust application deployment solution. Almost any organization can manage their entire application infrastructure with it. GPSI does have a few limitations though. One notable limit is the all or nothing redeployment option.

ReInstall Applications Deployed Through Group Policy Software Installation

Wouldn’t it be awesome if you could selectively reinstall applications for a specific computer or for a small group of computers? Today, we are going to learn how to reinstall an application on a single machine and on multiple computers.

Reinstall a GPSI Application on a Single Machine

When you deploy an application through Group Policy, the local machine stores the GPSI information within HKLMSOFTWAREMicrosoftWindowsCurrentVersionGroup PolicyAppMgmt . Each installed application has a unique ID assigned to it. This ID is the same for every machine. In the screenshot below, you can see an example of a deployed application named Mochasoft. It’s unique registry ID is {606…..}.

ReInstall Applications Deployed Through Group Policy Software Installation

We can trigger an automatic reinstall by deleting the {606….} registry key and rebooting the machine. The Group Policy client will initiate a reinstall of the application at startup. Deleting a registry key this way can be a bit time consuming.

To make this easier, you can use a free app to list and delete these IDs. Before we continue, head over to the Tools page and download the MSI Manager App. It is located under the Active Directory/Group Policy section. Pin it to your Start Menu/Start Screen. You will use it often!

When you first launch MSI Manager, enter a computer name and press Scan. For testing, you can enter in your local machine name. MSI Manager will connect to the machine and list all of the GPSI applications. You can select an application and press Go to remove the registry entry and to trigger a GPUpdate.

ReInstall Applications Deployed Through Group Policy Software Installation

The force reboot option will reboot the machine and allow the application to reinstall without waiting. If you have Verbose Mode enabled, you can even watch the application install. Go ahead and try this out on a machine. It is pretty sweet!


Reinstall a GPSI Application on Multiple Machines

Occasionally, you might need to reinstall an application on a small group of computers. Group Policy Registry Preferences can make this possible! In this example, we are wanting to reinstall our Mochasoft application on a specific lab of computers. In Active Directory, we will create a new security group namedReInstall_APP_Mochasoft and add our computers to this group.

Next, we will edit our APP_Mochasoft GPO which deploys our application. We will expand to Computer Configuration/Preferences/Windows Settings/Registry . Finally, we will create a new Registry Item and set the Action to Delete.

Under the keypath, we will enter SOFTWAREMicrosoftWindowsCurrentVersionGroup PolicyAppMgmtREGISTRY ID

ReInstall Applications Deployed Through Group Policy Software Installation

To streamline this preference, we will click on the Common tab and check Apply once and do not reapply. We also want this preference to apply to our specific group of computers. We will select Item-level targeting and configure a new Security Group target that scopes this preference down to your ReInstall security group.

On the next GPUpdate, our machines will remove the specific GPSI registry key. On the next reboot, they will reinstall the application! This is how I selectively reinstall GPSI applications on specific computers and on computer groups.

Antivirus on HyperV Host Servers

To safely run antivirus on HyperV Hosts you will need to whitelist some locations so they are not scanned by your Antivirus Software:

 

C:\ClusterStorage;
%windir%\SoftwareDistribution\DataStore\DataStore.edb;
%windir%\SoftwareDistribution\DataStore\Logs\*.log;
%windir%\SoftwareDistribution\DataStore\Logs\*.jrs;
%windir%\SoftwareDistribution\DataStore\Logs\*.chk;
%windir%\SoftwareDistribution\DataStore\Logs\*.edb;
%windir%\Security\Database\*.edb;
%windir%\Security\Database\*.sdb;
%windir%\Security\Database\*.log;
%windir%\Security\Database\*.chk;
%windir%\Security\Database\*.jrs;
%SystemRoot%\System32\GroupPolicy\registry.pol;
%ALLUSERSPROFILE%\NTuser.pol;
%PROGRAMDATA%\Microsoft\Windows\Hyper-V;

Slow Logon Remote Desktop after Veeam Restore – Smart Cards

After performing a Bare Metal restore with Veeam for a 2012 R2 server OS you may find logging in remotely via Remote Desktop taking longer than usual.  You may experience a delay at the logon screen for about 10-20 seconds before logging in and the following three errors may be found in the Windows System Event log, all logged as Event ID 7011 with the source Service Control Manager:

A timeout (30000 milliseconds) was reached while waiting for a transaction response from the UmRdpService service.


A timeout (30000 milliseconds) was reached while waiting for a transaction response from the ScDeviceEnum service.


The Smart Card Device Enumeration Service service failed to start due to the following error: The service did not respond to the start or control request in a timely fashion.

The reason for this is the RDP service is attempting to use Smart Cards for authentication when a client attempts to connect.   It seems that the Windows Server OS enables the Smart Card service after a restore to new hardware (partial OOBE). To fix this, change the Startup Type of the the Smart Card Device Enumeration Service from Manual (Trigger Start) to Disabled.  After doing so the unwanted delay on remote logon will be resolved.

 

Disable or Uninstall OneDrive Embedded in Windows 10

OneDrive (previously SkyDrive, Windows Live SkyDrive and Windows Live Folders) is a personal cloud file hosting, storage and sync service from Microsoft. In Windows 10, the OneDrive desktop app is installed and comes natively with the operating system. And if you sign into Windows 10 with a Microsoft Account (MSA), OneDrive is also enabled by default.

However, not everyone uses OneDrive. Some may prefer other similar cloud storage services such as Dropbox, Google Drive, Apple iCloud Drive, Box and many more. Or many may simply not using any cloud storage service or file hosting service at all, especially at computers used in businesses, corporations, enterprises, schools and educational institutions.

Unlike Windows 8.1, Windows 8, Windows 7 or earlier Windows operating systems, OneDrive desktop app is tightly integrated with Windows 10. OneDrive folder is in File Explorer’s navigation pane right from the moment you starting to use Windows 10. In fact, by default Windows 10 does not provide a way for users to uninstall and remove OneDrive app, whether it’s from “Programs and Features” of “Control Panel” or Windows Store. You simply won’t find any OneDrive entry to initiate the uninstallation process.

However, there are several ways available in Windows 10 to deal with OneDrive app, depending on whether you want to hide, disable, remove or uninstall the OneDrive. The tutorial provides all the options available with step-by-step guide.

Disable OneDrive Everywhere in Windows and Apps Completely

  1. Press Win + R keyboard accelerator to open Run dialog box.
  2. Type GPedit.msc and hit Enter or OK to open Local Group Policy Editor.
  3. Navigate to Local Computer Policy -> Computer Configuration -> Administrative Templates -> Windows Components-> OneDrive.
  4. In the right pane, double click on policy named Prevent the usage of OneDrive for file storage.
  5. Select the Enabled radio button.disable-onedrive-windows
  6. Click or tap OK when done.

That’s it. OneDrive icon is hidden from Explorer, and OneDrive app is completely disabled and prevented from running, and access or work with files on OneDrive from any desktop apps or modern apps is blocked. For example:

  • Can’t access OneDrive from the OneDrive app and file picker.
  • Windows Store apps can’t access OneDrive using the WinRT API.
  • OneDrive doesn’t appear in the navigation pane in File Explorer.
  • OneDrive files aren’t kept in sync with the cloud.
  • Can’t automatically upload photos and videos from the camera roll folder.
  • Sign out and sign in again, or restart the computer.
Registry Settings

The policy above is actually set a setting in Registry, which is useful for people who prefer to use Registry Editor. In addition, Windows 10 Home does not come with Group Policy Editor too.Here’s how to use Registry Editor to turn off OneDrive everywhere completely:

  1. Press Win + R keyboard accelerator to open Run dialog box.
  2. Type RegEdit.exe and hit Enter or OK to open Registry Editor.
  3. Navigate to the following registry key:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows
  4. Right click on Windows and select New -> Key. Name the new key as OneDrive.Note: If OneDrive key already exists, skip this step.
  5. Right click on OneDrive registry key, and select New -> DWORD (32-bit) Value. Name the new value name asDisableFileSyncNGSC
  6. Set the data for DisableFileSyncNGSC registry value as 1.DisableFileSyncNGSCNote: DisableFileSync registry value only works in Windows 7, Windows 8 and Windows 8.1 and does not work in Windows 10.
  7. Close Registry Editor.
  8. Sign out and sign in again, or restart the computer.

Hide and Remove OneDrive from Navigation Pane of Windows Explorer

If you just want to remove the OneDrive entry in the navigation pane (also known as side panel or folder tree) in the File Explorer, or the OneDrive folder still exists in File Explorer after disabling OneDrive, follow the guide to remove OneDrive from Windows 10 File Explorer Navigation Side Panel.

Complete Remove and Uninstall OneDrive

It’s impossible to manually uninstall and remove OneDrive in Windows 10 by the step-by-step guide below. Run the commands to be executed in the process below in an Administrator Command Prompt.

Uninstall OneDrive

  1. Terminate any process of OneDrive by running the following command:
    taskkill /f /im OneDrive.exe
  2. Uninstall OneDrive app by running one of the following command:In 32-bit Windows 10 (x86):
    %SystemRoot%\System32\OneDriveSetup.exe /uninstall

    In 64-bit Windows 10 (x64):

    %SystemRoot%\SysWOW64\OneDriveSetup.exe /uninstall

One you ran the above command, OneDrive desktop app is uninstalled completely and cleanly. Most of the time, no progress bar nor confirmation dialog is shown. However, when you search for OneDrive, the app no longer be found.

Cleaning and Removing OneDrive Remnants

However, as OneDrive is a cloud storage service which is dealing with user data, there are remnants and leftovers from OneDrive app that are still available on the system as uninstallation does not remove user data, most prominently been the OneDrive folder. Run the commands below to clean up those remnants by deleting OneDrive related folders and their contents:

Important
Make sure that the following folders no longer contain any user data before proceeding with the following commands.
rd "%UserProfile%\OneDrive" /Q /S
rd "%LocalAppData%\Microsoft\OneDrive" /Q /S
rd "%ProgramData%\Microsoft OneDrive" /Q /S
rd "C:\OneDriveTemp" /Q /S

Delete and Remove OneDrive in File Explorer Folder Tree Registry Key

OneDrive has registry keys which add itself to the Navigation Pane of File Explorer in Windows 10. After uninstalling OneDrive, these registry keys are orphaned, and can be removed.

REG Delete "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f
REG Delete "HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f

Remove Windows 10 Builtin Apps

So you’ve installed Windows 10 on an older device and want to get rid of some of the bloat, or you just want your Windows 10 installation to be less complicated or cluttered you can remove most of the inbuilt applications that ship wit the OS.

To remove the applications, Open a PowerShell window as Admin and run he following commands:

Get-AppxPackage *3dbuilder* | Remove-AppxPackage
Get-AppxPackage *windowsalarms* | Remove-AppxPackage
Get-AppxPackage *windowscommunicationsapps* | Remove-AppxPackage
Get-AppxPackage *officehub* | Remove-AppxPackage
Get-AppxPackage *skypeapp* | Remove-AppxPackage
Get-AppxPackage *getstarted* | Remove-AppxPackage
Get-AppxPackage *zunemusic* | Remove-AppxPackage
Get-AppxPackage *windowsmaps* | Remove-AppxPackage
Get-AppxPackage *bingfinance* | Remove-AppxPackage
Get-AppxPackage *zunevideo* | Remove-AppxPackage
Get-AppxPackage *bingnews* | Remove-AppxPackage
Get-AppxPackage *onenote* | Remove-AppxPackage
Get-AppxPackage *people* | Remove-AppxPackage
Get-AppxPackage *windowsphone* | Remove-AppxPackage
Get-AppxPackage *bingsports* | Remove-AppxPackage
Get-AppxPackage *bingweather* | Remove-AppxPackage
Get-AppxPackage *xboxapp* | Remove-AppxPackage
Get-AppxPackage *soundrecorder* | Remove-AppxPackage
Get-AppxPackage *photos* | Remove-AppxPackage
Get-AppxPackage *windowsstore* | Remove-AppxPackage
Get-AppxPackage *solitairecollection* | Remove-AppxPackage
Get-AppxPackage *windowscamera* | Remove-AppxPackage
Get-AppxPackage *windowscalculator* | Remove-AppxPackage

You can use any or all of the above commands to remove specific packages.

Network Location to Private in Windows 8.1/Server 2012 R2

One of those annoyances that sometimes happen with the new Network Location in Windows 8.x is that the network gets mis-identified as Public when it should be Private, or the other way around. Changing this in the GUI is certainly possible, but annoying, so let’s take advantage of the improved Windows PowerShell support in Windows 8.1 and do it quickly and easily. First, let’s open up an elevated PowerShell window from our limited user session:

PSH> Start-Process WindowsPowerShell.exe -verb RunAs

Now, in that window, let’s find out what our current network location is set to:

PSH> Get-NetConnectionProfile
Name : Unidentified network
InterfaceAlias : vEthernet (Local-10)
InterfaceIndex : 18
NetworkCategory : Public
IPv4Connectivity : LocalNetwork
IPv6Connectivity : LocalNetwork

From this, we see that the problem interface has an Interface Index of 18, so:

PSH> Set-NetConnectionProfile  -InterfaceIndex 18 -NetworkCategory Private

And we’re done.

Customise the System Tray Icons in Windows 10

1385252928546277415

In Windows 7 and 8, you could customise icons in the “system tray” to permanently show on the taskbar, or hide them away in the pop-up drawer. These options have moved in Windows 10.

Previously, you could click the “Customize” button at the bottom of the system tray popup. In Windows 10, you have to right-click on the Taskbar, choose Properties, and then click the Customize button.

From here, click “Select which icons appear on the taskbar”. Now you can switch an app to “on” to permanently show it on the right-hand side of the taskbar. You can also move items like Network and Volume to the system tray popup. You can also select “Turn System Icons On or Off” from the original Customize screen to remove icons like Volume or Notifications entirely.

Strangely, these options aren’t as flexible as they were in Windows 7 or 8—there’s no “Show Only Notifications” option like there was before—but at least most of the main options are still available. They’ve just moved.