Thursday, 18 May 2017

Copying files is painfully slow on Windows 10

Today I've been trying to copy files between two very fast SATA SSD drives.

I know that copying a large number of small files is slow on Windows already but this was excruciating.

The first thing I tried helped a lot, which is temporarily turning off Windows Defender. Obviously this isn't ideal but you can see the performance increase from the red line.

Simply click Start and search for Defender

Open Windows Defender Security Centre

Goto Virus & Threat Protection

Goto Virus & Threat Protection Settings

Turn off Real-Time Protection and Cloud-based protection

 Don't forget to turn them back on after copying your files!


Monday, 15 May 2017

Why is FireFox using / listening on port 80

After a short moment today I was wondering why FireFox was listening on TCP port 80 and stopping IIS from starting because of

netstat -anb which gives the following.

  TCP          TIME_WAIT
  TCP              LISTENING

Well it's not it's just the order Netstat reports in, and of course it was Skype blocking the port which can be configured with this checkbox on the connection tab! Sanity restored.

Monday, 8 May 2017

Windows Server 2016 or Windows 10: Date and time "Some settings are managed by your organization".

When you're using the new "Modern" date and time settings in Windows Server 2016 or Windows 10 you may find that you can't set the correct date and time and the value "Some settings are managed by your organization".

The simplest way around this is to go back to the proper control panel using Start, Run, "Control.exe" and searching for "Set the date".

Within here you can set the date and time manually as required

Wednesday, 3 May 2017

Azure cmdlets Get-AzureRmAlertRule and Get-AzureRmRoleAssignment report "api-version=) is required for all requests"

When you use the Azure PowerShell cmdlets such as Get-AzureRmAlertRule and Get-AzureRmRoleAssignment you might see the following

MissingApiVersionParameter: The api-version query parameter (?api-version=) is required for all requests.

This can occur if there are hash symbols in the resource name or resource type parameters.

For example "CDD1EE35DC872C48F799BAC150FBB128E702BB9C##North Europe#'"

You must encode these parameters, replacing the hash # symbols with %23 - for example
"CDD1EE35DC872C48F799BAC150FBB128E702BB9C%23%23North Europe%23'" and then run the command again

Wednesday, 12 April 2017

C#.NET AccountExpirationDate Parameter name: fileTime ---> System.ArgumentOutOfRangeException: Not a valid Win32 FileTime.

So we've found a rather strange bug in .NET Framework from 3.5.1 to the latest version (4.6.2).

When using the System.DirectoryServices.AccountManagement library you may get the following error when reading the AccountExpirationDate of a principal.

Not a valid Win32 FileTime.
Parameter name: fileTime ---> System.ArgumentOutOfRangeException: Not a valid Win32 FileTime.
Parameter name: fileTime
   at System.DateTime.FromFileTimeUtc(Int64 fileTime)
   at System.DirectoryServices.AccountManagement.ADStoreCtx.DateTimeFromLdapConverter(dSPropertyCollection properties, String suggestedAdProperty, Principal p, String propertyName, Boolean useAcctExpLogic)
   at System.DirectoryServices.AccountManagement.ADStoreCtx.AcctExpirFromLdapConverter(dSPropertyCollection properties, String suggestedAdProperty, Principal p, String propertyName)
   at System.DirectoryServices.AccountManagement.ADStoreCtx.Load(Principal p, String principalPropertyName)
   at System.DirectoryServices.AccountManagement.Principal.HandleGet[T](T& currentValue, String name, LoadState& state)
   at System.DirectoryServices.AccountManagement.AuthenticablePrincipal.get_AccountExpirationDate()

This can occur when the account expires value is set to -1 as seen in ADSIEdit.msc.

The solution to this problem is to either correct these values (Never Expires should be 9223372036854775807) or read the accountExpires value directly using the underlying DirectoryEntry object and checking if it is set to -1.


Friday, 24 March 2017

Create a system image backup in Windows 10

After experiencing a rather scary SYSTEM_PROCESS_DIED blue screen error on Windows 10 I decided to look at a system backup image as well as full data backups.

These seem to be being de-emphasised in Windows but you can still do them

Goto Control Panel\System and Security\File History

Click on System Image Backup on the bottom left

Click Create a System Image and select the drive where to create

Windows 10 Critical Process Died Error

So I ran into this today on a fully patched Windows 10 anniversary installation.

Your PC ran into a problem and needs to restart. We're just collecting some error info, and then we'll restart for you.


There are lots of posts about this which involve running sfc /scannow from the recovery console none of which worked. Here's what I found to work

  • Allow Windows 10 to fail and reboot and display the options

  • Goto System Restore - try and restore and it will fail because Windows 10 bugs with System restore with 0x80070091
  • Panic
  • Allow Windows 10 to fail and reboot and display the options
  • Goto Troubleshoot, Advanced Options, Command Prompt
  • Find your *real* C: drive probably by going to D:

  • Type cd "Program Files"
  • Type attrib –h WindowsApps
  • Type ren WindowsApps WindowsApps.old
  • Type rstrui
  • Run Windows restore again - you may get ANOTHER error, but it seemed to work correctly.
  • Immediately go and do a Windows System Image Backup.