Category Archives: IT Stuff

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.

Suggested Max Memory Settings for SQL Server

It is pretty important to make sure you set the Max Server memory setting for SQL Server to something besides the default setting (which allows SQL Server to use as much memory as it wants, subject to signals from the operating system that it is under memory pressure). This is especially important with larger, busier systems that may be under memory pressure.

This setting controls how much memory can be used by the SQL Server Buffer Pool.  If you don’t set an upper limit for this value, other parts of SQL Server, and the operating system can be starved for memory, which can cause instability and performance problems. It is even more important to set this correctly if you have “Lock Pages in Memory” enabled for the SQL Server service account (which I always do for x64 systems with more than 4GB of memory).

These settings are for x64, on a dedicated database server, only running the DB engine, (which is the ideal situation).

Physical RAM                        MaxServerMem Setting
2GB                                           1500
4GB                                           3200
6GB                                           4800
8GB                                           6400
12GB                                         10000
16GB                                         13500
24GB                                         21500
32GB                                         29000
48GB                                         44000
64GB                                         60000
72GB                                         68000
96GB                                         92000
128GB                                       124000

If you are running other SQL Server components, such as SSIS or Full Text Search, you will want to allocate less memory for the SQL Server Buffer Pool. You also want to pay close attention to how much memory is still available in Task Manager. This is how much RAM should be available in Task Manager while you are under load (on Windows Server 2003):

Physical RAM            Target Avail RAM in Task Manager
< 4GB                               512MB – 1GB
4-32GB                              1GB – 2GB
32-128GB                            2GB – 4GB
> 128GB                              > 4GB

You can use T-SQL to set your MaxServerMemory setting. The sample below sets it to 3500, which is the equivalent of 3.5GB. This setting is dynamic in SQL Server 2005/2008, which means that you can change it and it goes into effect immediately, without restarting SQL Server.

— Turn on advanced options
EXEC  sp_configure‘Show Advanced Options’,1;
GO
RECONFIGURE;
GO

— Set max server memory = 3500MB for the server
EXEC  sp_configure‘max server memory (MB)’,3500;
GO
RECONFIGURE;
GO

-- See what the current values are
EXEC sp_configure;

You can also change this setting in the SSMS GUI, as you see below:

d3ca9ddc3320b216b59350a5daa2d869

Finally, I have learned that it is a good idea to temporarily adjust your MaxServerMemory setting downward by a few GB if you know you will be doing a large file copy on your database server (such as copying a large database backup file).

Change RemoteApp Icon in RDS 2012R2

Browse to %WINDIR%\RemotePackages\CPubFarms\CPubRemoteApps on each server holding the RD Connection Broker role and you will see all the .ico files.

In the following example, I have a RemoteApp called ‘Notepad’.  If i want to change the icon I’d remove “notepad.ico” and copy another .ico file of my choice and rename it to “notepad.ico”.
This will replace the icon for the RemoteApp in your Remote Apps and Desktop Connections application on the next refresh. For RD Web Access you’ll have to stop and start the Web application on the RD Web Access server.

This will only work for .ico files. If your icon is in a .exe or .dll you’ll still have to use powershell.

Cloned machine WSUS error

To fix WSUS errors with a cloned machines that was not sysprepped you will need to firstly delete the machine form the WSUS console then run he following commands on the PC/server that has been cloned:

gpupdate
net stop wuauserv /y
net stop BITS /y
rd C:\WINDOWS\SoftwareDistribution /s /Q
del "c:\windows\windowsupdate.log"
regsvr32 WUAPI.DLL /s
regsvr32 WUAUENG.DLL /s
regsvr32 WUAUENG1.DLL /s
regsvr32 ATL.DLL /s
regsvr32 WUCLTUI.DLL /s
regsvr32 WUPS.DLL /s
regsvr32 WUPS2.DLL /s
regsvr32 WUWEB.DLL /s
regsvr32 msxml3.dll /s
net start wuauserv /y
wuauclt.exe /resetauthorization /detectnow

Then restart the PC/Server and re-run Windows Update

STOP 0x0000007B on P2V Windows 7 upwards

Got a STOP 0x0000007B on booting a VM after you P2V. With automatic reboot on error enabled, it also manifests itself as a Windows Boot Manager error, Status: 0xc0000225, Info: The boot selection failed because a required device is inaccessible.
http://minasi.com/forum/topic.asp?TOPIC_ID=31980

Good old fashioned mass storage driver issue. The hitch is that drivers are there but not enabled in an effort to improve boot performance. The article on Minasi’s site offers a pretty good explanation for Hyper-V, and the same applies to VMware.

To fix:

  1. Mount the Windows install disk and boot to it.
  2. At the first screen (Language Selection), hit Shift-F10 for a command prompt.
  3. Run Regedit.
  4. Load the system hive from the VM’s disk:
    1. Highlight HKEY_LOCAL_MACHINE
    2. File > Load Hive
    3. Select &lt c: &gt \Windows\System32\config\system (name it something like “asdf”)
  5. Expand HKEY_LOCAL_MACHINE\asdf\ControlSet1\Services\intelide
  6. Change the data for value “Start” from “3” to “0”.
  7. File > Unload Hive.
  8. Exit regedit.
  9. Reboot the VM.

 

P2V Using DISK2VHD for HyperV

The ability to convert existing Physical hosts to Virtual machines is often the biggest return on investment benefit to justify the case for virtualisation.  Taking a legacy platform often on older, unsupported hardware and software, and converting it to a virtual machine running with many other machines, but on new, high capacity hardware taking up less space and power is a key driver for virtualisation.

Older systems consuming a relatively high amount of energy and space for what is now very low processing power, can be converted to VM’s hosted on much more powerful hardware for a similar footprint but with much increased agility through the well understood benefits of virtualisation.

A recent project The Full Circle (www.thefullcircle.com) undertook as part of our private cloud practise, was to rationalise several older HP ProLiant DL360 servers (one had a BIOS dated 08/03/2001 – over 10 years old!) each taking 1U of rack space, some with dual power supplies, dual network adaptors, mirrored disks, etc. all generating high heat output (which in turn has high cooling costs).

Online Windows server capture using Sysinternals Disk2vhd utility

If you haven’t got Microsoft’s Virtual Machine Manager suite and you don’t want to spend many hours backing up the source server, creating a blank VM, installing a base O/S and then hoping a restore will work without hours of troubleshooting disparate hardware issues… really?!?!  there is a handy alternative from those clever folks at Sysinternals – disk2vhd.

From Sysinternals “Disk2vhd is a utility that creates VHD (Virtual Hard Disk – Microsoft’s Virtual Machine disk format) versions of physical disks for use in Microsoft Virtual PC or Microsoft Hyper-V virtual machines (VMs). The difference between Disk2vhd and other physical-to-virtual tools is that you can run Disk2vhd on a system that’s online. Disk2vhd uses Windows’ Volume Snapshot capability, introduced in Windows XP, to create consistent point-in-time snapshots of the volumes you want to include in a conversion.”

 

Overall P2V process as easy as 1,2,3…

Of course it’s not as easy as 1,2,3… this process may take from only a couple of hours to a couple of days per server but its a straightforward process with no fundamental ‘gotchas’ – although in-between application licensing, network infrastructure issues, and later VM contention (disable those traditional backup agents!) – this part may prove to be the simplest part of the process, which is:

  1. Capture of source physical host/server
    1. Audit hardware and software build
      (recommend paid tools such as Belarc, but also include built-in such as systeminfo – knowing the local machine Administrator account rather than a domain account could be useful although not mandatory although you do need an admin account)
    2. Full Backup! (whilst no changes planned to source machine a backup maybe useful later)
    3. Clean-up the source machine (old profiles, programs, recovery points, temp files (could use CCleaner or just cleanmgr.exe), and always defrag! – great tip from Khwajakhurram in the comments))
    4. Disk conversion from physical source to Virtual Hard Disk file target (VHD)
  2. Build of Virtual Machine / VM hardware to be a near-as match to the source hardware in terms of major physical resources such as CPU, Memory, Disk, and Network
    1. Attach the created VHD file, note this will be one Disk that may contain multiple partitions (recommend capturing individual volumes to separate VHDs)
  3. Clean-up of new virtual machine hardware and system software
    1. Install the Hyper-V Integration Services (may have pre-reqs..) and restart
    2. remove superfluous hardware devices, drivers, and system software (may require several restarts)
    3. Setup networking (you will have lost the physical adapters)
    4. May wish to change storage properties e.g. converting from a Basic to Dynamic Disk in order to Shrink a volume, etc…
    5. Check the event logs for any errors to determine if serious or can be ignored
    6. Test, test, test!
    7. Activate Windows (the ‘hardware’ will have changed significantly)
Steps in more detail..
Running disk2vhd

You don’t even need to permanently install the tool on the source machine, simply browse to http://technet.microsoft.com/en-us/sysinternals/ee656415 and click ‘Run Disk2vhd

image44

choose your source drives, enter a suitable target destination with sufficient space and click create – this may take some time (as in several hours depending on size, speed, network, etc.)

Setting up the captured hard disk

The disk captured by disk2vhd will be a single hard disk image of the selected partitions/volumes, this may be fine if they combine less than 127GB as the first Hyper-V bootable disk has to be attached to the IDE controller (with a disk limit of 127GB)

However, for production use we recommend splitting your disks in the virtual world as you would in the physical – capture each volume to a separate VHD e.g. HOSTNAME-diskN-c_system.vhd, HOSTNAME-diskN-d_data.vhd, etc.

image13

 

Here’s a grab of a SCSI based system which had 2x73GB SCSI disks as a single RAID disk

image14

P2V for Windows Server 2003 onto Hyper-V

Windows Server 2003 machines require Service Pack 2 to be installed before the Hyper-V Integration Services can be installed – get ready to install using the keyboard as until the IS bits are installed you have no mouse!

Removing superfluous hardware devices, drivers, and system software

You need to get familiar with removing hidden devices and how to show non-present devices by following the Microsoft KB ‘Device Manager does not display devices that are not connected to the Windows XP-based computer’ basically:

set devmgr_show_nonpresent_devices=1

start devmgmt.msc

And then show hidden devices, to allow removal of the no longer supported devices, below shows the main areas to cover from a HP ProLiant server to VM:

image8

I’m fairly confident to remove ALL hidden/greyed-out devices, especially if its a device that has been replaced by another ‘active’ / non-hidden instance of the same name e.g.

image6

Note – this is a tedious process working through all greyed-out devices – suggest using the keyboard to save time (cursor to device, delete, enter, use of home & end keys, then repeat – many times! 😉

If you delete something in error don’t worry – you can always re-scan for hardware changes or restart the machine – you’ll be doing a few restarts during the process anyway…

Some things should be removed that are not hidden

Some devices won’t be hidden, but if you know your hardware and device drivers fairly well you should be able to spot the obvious candidates for removal, e.g. the Compaq Smart Array Controller drivers used for managing the hardware disk array.. cpqarry2 is definitely one to go..

image12

but most will (be hidden), including related components…

image9

(I think the Pentium III chip can go in this case! Winking smile)

Note – some of these may prompt for a restart, I normally bank several restarts together, but some system software to be removed may require a restart to uninstall cleanly..

System software uninstallation and many restarts

Most server systems may also have significant software components to uninstall, in this case several HP components that talk to proprietary HP systems management components that will no longer be present in the virtualised machine.

image3

 

HP Network Teaming Utility – where is that software?

The HP Network Teaming Utility – easily spotted on most HP Windows server systems by the image10  logo in the system-tray, however the software is not that easily found as doesn’t appear in Add/Remove Programs nor is removed from Device Manager.

Open network connections (ncpa.cpl) and select the ‘HP Network Configuration Utility’ then select Uninstall – you should be prompted to uninstall per:

image15

You’ll be prompted for a restart, and by now the system probably deserves one!

 

Recreate your Network connections

Its time to dig out that systeminfo report, as that’s going to have a concise listing of the source server’s network settings in terms of IP addresses, etc. – if you’re converting from large-frame/iSCSI with VLANs etc. then that scenario is slightly beyond the scope of this post – sorry, but some things have to be billable!

Errors on start-up?

You are bound to get some start-up errors at the end of the process, although hopefully these should be insignificant such as a w32tm service unable to update from NTP or a domain controller due to network changes (e.g. still testing on a private network).  You may also have dependency components that still require removal such as a System Management Controller via the Service Control Manager (typical event id 7000 stuff).

Fire up the Event Viewer (eventvwr) regardless and have a trawl through the event logs, even if you didn’t get a error starting service alert on start-up you may find issues that require further investigation – effort here will be worthwhile for a stable and error free machine.

At the end of the process…

When you’re finished, sit back crack open a can (if you won’t get caught with food and drink in the data center) and have a think what nice new tin you’ll replace all those gaps in the rack with… mine would be Stella… Winking smile  Better still, for you, the company and the planet, return a few racks to the data center manager / co-lo provider, and ask for a bonus from all the carbon you’ve saved Smile

 

Stoarge Spaces – Storage Pool Is Read Only

With Storage Spaces, if you want to re-use a drive in a new PC the drive will recall the last Pool it was a member of. When you try to erase the disk the following error is shown:

Error deleting virtual disk: The storage pool could not complete the operation because its configuration is read-only.

Get the name of the Storage Pool, also known as the friendly name – for example ‘Pool 1’. Then run in PowerShell:

Get-StoragePool –FriendlyName “Pool 1” | Set-StoragePool –IsReadOnly $false

Then you can delete the storage pool:

Get-StoragePool –FriendlyName “Pool 1” | Remove-StoragePool

The Disk can now be used as a normal drive.

URL HyperLink opens with VMWare Tools instead of Web Browser

Had a strange issue where clients to a RDS Host server were not able to open hyperlinks from Outlook or Word documents.  When clicking a hyperlink Windows would attempt to open it with VMWare Tools instead of the web browser despite what setting was present in default programs.

It turns out that when VMTools is installed to a VMWare Virtual Machine it will create a URL Association that hijacks the default URL handler.  The fix is as follows:

Open regedit on the affected virtual machine.

Navigate to

HKLM\SOFTWARE\VMware, Inc.\VMwareHostOpen\Capabilities\UrlAssociation

Remove the entries there.