Posts

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

Image
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 principalP...

Create a system image backup in Windows 10

Image
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. CRITICAL_PROCESS_DIED 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 ...

Chromecast streaming stopped when locking the iPhone or the screen automatically locks on TalkTalk player (BlinkBox player).

Image
I've recently had a problem streaming content from the TalkTalk player (which was BlinkBox) to my TV through my Google Chromecast from an iPhone. The issue was the streaming would work fine, then as soon as the phone went to sleep or automatically locked the screen the streaming would stop. This seems to be an issue with the TalkTalk player specifically, the easiest way I found around this was to switch to the Google Home application and click the play button in here, the streaming would continue and you can then lock the phone without the stream stopping. Also I'd like to give Nocturnal Animals a rating of 10%, as this is the approximate length of the film I managed to watch before giving up on it.

Visual Studio 2010 Code Snippets fail on VS 2015 with "Object reference not set to an instance of an object"

Image
We've recently had a problem with some old Visual Studio 2010 code snippets written in C# failing when used in Visual Studio 2015 with an "Object reference not set to an instance of an object" error. It appears that the code snippets now require the title value to be set. < CodeSnippet Format = " 1.0.0 " >   < Header >     < Title > Add collection editor attribute </ Title >     < Shortcut > coledit </ Shortcut >   </ Header >   < Snippet >     < Code Language = " csharp " >       <![CDATA[ [Editor(typeof(AdvancedCollectionEditor), typeof(UITypeEditor))] ]]>     </ Code >   </ Snippet > </ CodeSnippet > Setting the title will immediately remedy the issue, but another gotcha is.... Any code snippet in the document missing the title element will cause subsequent code snippet...

Using PowerShell New-WebServiceProxy to access Web Services with Client Certificate Authentication

We've recently been looking into helping our customers implement two factor authentication with client certificates. This was going very well, until writing the help to consume our ASP.NET soap web services with a client certificate. Here's the problem... It seems that the New-WebServiceProxy cmdlet does not support passing client certificates when it generates the compiled WSDL. $uri = "https://centrel-ws02/xiaconfiguration/webservice/xiaconfiguration.asmx" $proxy = New-WebServiceProxy $uri -UseDefaultCredential  The following error is returned New-WebServiceProxy : The request failed with HTTP status 403: Forbidden. This limitation is confusing because the following command would help, however the cmdlet requires that a connection is immediately made, which is then too late to add the certificate $proxy . ClientCertificates . Add( $certificate ) This is somewhat annoying given that the Invoke-WebRequest cmdlet does have client cetific...