Powershell – code snipets

  • delete everything from Recycle Bin
$Recycler = (New-Object -ComObject Shell.Application).NameSpace(0xa)
$Recycler.items() | foreach { rm $_.path -force -recurse }
  • generate GUID
[guid]::NewGuid().ToString()
  • OS version
(Get-WmiObject -class Win32_OperatingSystem).Caption
  • username
[Environment]::UserName
  • SQL instances
(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server').InstalledInstances
Advertisements

IIS error 503: Service unavailable

Very frustrating stuff getting error 503 corroborated with the following entry in the event viewer:

The worker process for application pool ‘DefaultAppPool’ encountered an error ‘Cannot read configuration file
‘ trying to read configuration data from file ‘\\?\<EMPTY>’, line number ‘0’. The data field contains the error code.

This happened to me after a Windows 7 system was upgraded to Windows 10 Pro x64, and enabling IIS. The default IIS page on the localhost wouldn’t show up.

Instead the HTTP error 503 would be front page and center.

Solution: bit of hint to resolve it was from the default IIS pool, DefaultAppPool, which wouldn’t -ever- start!

Navigating on the local file system: C:\inetpub\temp\appPools you should find a folder named DefaultAppPool. In my case I had a shortcut! That needs to be corrected, something like this:

  • run inetmgr
  • locate the default pool (or any other pool that fails to start)
  • click on pool’s name from the right pane chose View Applications
  • change the pool of the application to something else
  • go back to the list of pools and delete the invalid pool
  • then recreate DefaultAppPool / invalid pool
  • click the pool that the application got changed, the View Applications and assign back the default pool to it
  • restart IIS

At this stage the DefaultAppPool foder should appear in the C:\intepub\temp\appPools and the default, or your local website, should load up.

No more pesky error 503!

TeamViewer: Not ready. Please check your connection

TeamViewer proved to be a nice piece of software every now and then.

Have been using it since version 5 and up to it’s latest v12 incarnation, on systems spanning from Linux, OSX and of course Windows.

This morning thou, on a Windows 7 64bit system, the v12 of TeamViewer (which has been up and happy for like forever) refused to SignIn with it’s back-end; the error:

Not ready. Please check your connection.

It just kept throwing this message whatever I was doing:

  • reset the system
  • uninstall and reinstall
  • disable the Antivirus (Webroot secure Anywhere)

One think did help but I’m not happy about it:

  • turning off the system’s Firewall

 

Is the datastore flag /Scenario/GlobalFlags/AreProductFeaturesSupported set did not pass

That’s the error I got when attempting to install SQL Server 2008 R2 on a system running Windows 10 Enterprise x64:

Is the datastore flag /Scenario/GlobalFlags/AreProductFeaturesSupported set did not pass

An extremely easy fix is to run the SqlSupport.msi package, which is part of the installation media from which the SQL Server 2008 R2 is installed (just search it in there).

The SqlSupport.msi runs pretty quickly and on the face of things doesn’t do much.. well apart from fixing the above error.

Then it’s again back to the main installer, in order to catch errors in the act I’m running it like this:

.\setup.exe /CONFIGURATIONFILE=ConfigurationFile.ini

It did run almost normal and up until almost the very end where it stopped yet again with another error:

Condition "Is the user's scenario set to EditionUpgrade" did not pass

Steps I did to get over this second error:

  • run all of the below from an Administrator account
  • backup the user databases (if needed)
  • completely remove all SQL Server 2008 (and related) packages from Control Panel -> Programs and Features
  • backup the registry
  • reboot the computer
  • delete the following registry keys (using regedit): HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server and HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer
  • go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall and delete all the sub-keys referencing SQL Server
  • go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services and delete all keys referencing SQL Server
  • delete the SQL Server folder from: C:\Program Files\Microsoft SQL Server
  • reboot the computer
  • reinstall SQL Server 2008 R2

 

Thoughts on technology

You can chose to play bridge at a club, or online.

If you’re short on time but you’re still keen on staying alert and fresh in your bridge endeavors then it’s a must to play whenever you can.. like you know: on your way forth and back from work, when you’re stuck in traffic, in a queue of your choice, or waiting for the sleep to come.

So your close friends must be the GIB robots from BBO (Bridge Base Online). You can buy them for a period of time (say a day) and use them to play for money. Or you can open a table with 3 other robots for a quickie.. like a game of 4 or an unlimited stream of hands. You get the picture..

But my take is from another angle. So for every one of us lonely and sad players of bridge there is a potential of 3 robots ready and willing. Are they smart enough, well that’s another story. However, they are there!

But let’s extend this: for every one of us sad and lonely human beings there is always a computer waiting (if you don’t have one or yours gets some ransomware.. ha ha – again another subject but still very close), and there’s also another:

  • smartphone waiting
  • smart fridge waiting
  • smart TV waiting
  • smart car waiting.. Tesla
  • smart wearable waiting
  • tablet
  • RF chip
  • something technical smart and ready enough to help us out
  • Software (in all of them)

Help us.. you say!

Hmm, the other day my little one asked an interesting question, when do numbers finish, as in 1, 2, 3..

Well, my question of same sorts would be: where does smart pieces of technology finish?

Are these numbers double / triple (in stocks waiting to be shipped, or live and kicking) more than humans! Somehow we, humans live and kicking, have created a dormant army of devices which at the moment help us out.. still.

 

Prayer for parents

(‘Ruga pentru parinti’ by Adrian Paunescu, he was a Romanian poet, journalist and politician, 1943 – 2010; this is my interpretation from original)

 

Enigmatically silents
Almost finishing their craft
Near us but they’ll depart
Our sweet dear, dear parents.
Oh God please call them, back
All their hardship long and done
Call and make them young once more
Even younger than we are.

 

For the ones who gave us birth
Issue something just because
And delay their passing cross
Bless them start afresh on earth.
They payed off all of their life
For their children’s many bungle
Oh God keep them all alive
Keep them parents who’ll be gone.

 

Pay attention how they go
Pay attention how they’re gone
Candle’s light this crib alone
They are silent like a snow.
Illnesses of soul and flesh
Take us all into our grave
Whilst we’re here, while they are
Hang in near to your parents.

 

And this earth keeps filling in
Saying goodbye rips us apart
Why oh why, my dear father!
Why oh why, my dear mother!
Oh and why these longest faces
My dear daughter and dear son
I’m the one who’s time is closer
My dears I’ll go too in little while.

 

Why oh why, my dear father!
Why oh why, my dear mother!
You be safe, my dear son!
You be safe, my dear daughter!
Oh dear father, oh dear son,
Oh dear mother, dear daughter.

 

Windows XP – update error

We are only days after the latest ransomware attack, and the issue which was hidden in the shallows, for a while now, was brought to life by this attack.

Visiting the Microsoft support web pages pops up first and foremost the following alert:

"A wide-spread ransomware attack, WannaCrypt, targets out-of-date Windows
devices. Given the severity of this threat, immediately update your
Windows devices."

 

And this is where the issue has been hiding.

Since April 2014 MSFT has stopped regular updates to a world-wide-spread-installation of Windows XP. MSFT also did the right thing and offered it’s latest offering, Windows 10, as a free update for a while. It needed people to get off Windows XP wagon.

But hey, easily said than done.

Legacy software and databases for countless companies were not easy to migrate. Time constraints to systems running 24×7 as well as human reluctance to change something that’s running just fine, and here we are 3 years later with Windows XP systems still very much alive. MSFT very much moved along during these years.

Such systems continued their daily grind for 3 years unperturbed by the dismissed system and security updates. Such systems may have developed various issues, due to various other programs being installed on top of the ones already existing. And I’m sure such systems were always somewhere in the minds of their administrators as a disaster waiting to happen.

Case in point:

  • this Windows XP installation which, coincidence or not, since Friday refuses to start the legacy program which was run day in day out for the past 3 years
  • this system didn’t had system updates installed for several years before the April 2014 MSFT deadline
  • this system refuses to connect to any MSFT support web addresses by it’s Internet Explorer, but it does so just fine by Google Chrome
  • that’s a perfect case of “chicken or egg” – disturbingly needing it’s system updates – to which, nicely and promptly, is being refused access by MSFT
  • no Googled solution worked: IE stats reset and history cleared, Winsock stack cleared, .Net 4 installed, proxy disabled, firewall disabled, various programs removed

 

Network diagnostics keep returning, over and over, the same error:

  • HTTPS and FTP: Error 12031 – the connection with the server was reset

 

In conclusion there’s no conclusion: classic case of Windows XP system which needs an update but is not able to get it!

Why has MSFT stopped Windows XP updates!

Is MSFT accountable?