Event ID 4227

Warning: Before making any registry changes or system change make sure you have backed up you system and registry.

The issue:

Log Name:      System
Source:        Tcpip
Date:          12/2/2013 11:52:26 AM
Event ID:      4227
Task Category: None
Level:         Warning
Keywords:      Classic
User:          N/A
Computer:      xxxxxxxx
TCP/IP failed to establish an outgoing connection because the selected local endpoint was recently used to connect to the same remote endpoint. This error typically occurs when outgoing connections are opened and closed at a high rate, causing all available local ports to be used and forcing TCP/IP to reuse a local port for an outgoing connection. To minimize the risk of data corruption, the TCP/IP standard requires a minimum time period to elapse between successive connections from a given local endpoint to a given remote endpoint.

The fix:

  • First use TCPview or netstat to view how many ports and connections are in use

Fix 1:

You can check the registry and via the command line to see the dynamic port pool size. And change it as need be.

To do it via registry key view HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\MaxUserPort and see what that value is set to. Note this key might not exist you can create it if need be. http://technet.microsoft.com/en-us/library/cc938196.aspx. To do this as command line “netsh int ipv4 show dynamicport tcp” you can see more examples at http://support.microsoft.com/kb/929851/en-us if you are running out of ports you can use the command to increase the pool or change the reg key to complete this task.

Fix 2:

This might also be caused by the connection wait delay, if you have this problem you will find lots of connections in a time_wait status in TCPview or netstat.

If this is your problem you can adjust the HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\TcpTimedWaitDelay http://technet.microsoft.com/en-us/library/cc938217.aspx to resolve this issue. Note again this key might not exist


Additional helpful link:



Task Scheduler error {0}

The Error:

“The selected task “{0}” no longer exists. to see the current task, click refresh”

The Problem:

A task is out of sync with task scheduler

The Fix:

  1. make sure you have a backup of your C drive before you try the below steps
  2. Open task scheduler
  3. click the top most tree
  4. Count the number of errors you click ok on.
  5. close task scheduler (must do this step as you will only get the error once)
  6. Open task scheduler
  7. expand the task tree (don’t click on the top of the tree)
  8. start going down the tree task by task and click on each one. Record what tasks give you the errors and until you find all of them you counted in step 3
  9. go to %SystemFolder%\Tasks
  10. find the tasks that gave you the error and delete them.
  11. reopen task scheduler and the errors should be gone if completed correctly.

In my case I only had one with an error and it was disk defrag, so I opened up disk defrag and disabled the schedule and re-enabled it to recreate the window task.

Server hangs from RDP reboot


Do a GUI reboot from RDP session, and RDP closes/no longer works but never reboots server because windows hung. (mostly found out by checking console)

Best way to try and prevent:

use shutdown command

“shutdown /r” may need /f option, also switches could be different depending on  your windows version.

RDP Access Denied do to licensing

WARNING: as always use at your own risk and take a backup of your registry before trying.


RDP Access Denied when logging in.

What is needed:

  • Windows 2008 R2
  • Remote Desktop Services role
  • AD logins
  • May also have failed to renew license events in the event log

Log Name: System
Source: Microsoft-Windows-TerminalServices-RemoteConnectionManager
Date: xxxxxxxx
Event ID: 1028
Task Category: None
Level: Warning
Keywords: Classic
User: N/A
Computer: xxxxxx
The remote session could not be established from remote desktop client xxxxxx because its license could not be renewed.

How to check for bug: connect to server via RDP console mode (mstsc /admin) with same login if it works you are getting this bug.


There is a known bug with Windows 2008R2 and the Terminal Services Role with Remote Desktop. Once installed if the following is not performed any user trying to log onto the server using AD credentials will not be allowed to logon.

The registry key affecting this behavior must be created and set. This change is only required on those servers hosting the Remote Desktop Role.

  1.  Go to start menu, run , and type regedit and choose enter.
  2. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server
  3. Create a DWORD value called (IgnoreRegUserConfigErrors) and assign the value 1 to this property.

No reboot required will work for any new RDP connections

This could also be related to token size too, may want to check if you are getting kerberos errors because of token size

How to restart RDP without rebooting windows

WARNING: Test this process before you try it on an production system, to make sure you like the results and have the process down.


RDP has stopped working but your server still work just users can’t connect to modify applications

The most common fix is to reboot windows, because “Remote Desktop Services” aka TermService can’t be restarted at least thats the case on 2003 as the option is grayed out. This will also create an outage just for a remote control issue and thats not always desirable.

The fix: (remotely)

from command line

  1. tasklist /s \\servername /svc /fi “imagename eq svchost.exe” (locate PID for TermService)
  2. taskkill /s \\servername /pid xxxx (may need /f to force, UAC might give problems as well)
  3. sc \\servername start TermService

The Fix: (local, using remote admin card/other remote control software/other remote command line)

From command line

  1. tasklist /svc /fi “imagename eq svchost.exe” (locate PID for TermService)
  2. taskkill /pid xxxx (may need /f to force, UAC might give problems as well)
  3. sc \\servername start TermService

more helpful RDP troubleshooting


WER folder too big


C:\ProgramData\Microsoft\Windows\WER is large possibly GB’s of data.


The configuration of Windows Error reporting is configured wrong. Large amounts of data are stored in this location before the error’s are reported to microsoft. If the setting is not to send automatically then this folder is just going to grow.


Windows Error reporting is used to report errors to microsoft and then pooled and the largest offenders are repaired via patches etc. Also reports solutions if your problem has already been fixed.

Solution 1: (recommended)

  1. change Windows Error reporting setting’s to auto send (found in server manager)
  2. open control panel>problem reports and solutions
  3. select all>right click> check for solution
  4. the folder should be small after this

Solution 2: (if you are worried about security)

  1. disable windows error reporting
  2. open control panel>problem reports and solutions
  3. select all>right click> delete
  4. folder should be small

winsxs and installer out of control

WARINING: doing anything to the folders below could inpact your system. Make sure you know what your doing and have a full back up and OS image created. This could make your system unusable. 

So if your here I’m guessing your running out of space on your C drive. And used a tool (windirstat) to scan your C drive and find out what folders are using all your space up. Well I’m also guessing that C:\Windows\winsxs and C:\Windows\Installer (this is basically the old $NTUninstall and $NtServicePackUninstall on XP/2003) are at the close to the top if not the top.

Well some back story on what the two folders do and what can you do to get some of you space back

Folder winsxs:

Well this folder is your “component store” for the “add and remove component” or “server roles” features of windows. They look up the required files from this folder and all other OS files hard link back to this folder. Every patch or SP will add a new copy of ever changed core file to this folder kinda like a version repository.

What to do with Winsxs:

  1. Well first off DONT DELETE IT you might as well wipe your harddrive
  2. Make your SP level Permanent, you can run VSP1CLN.EXE (Vista SP1)/COMPCLN (2008 SP2)/DISM (2008),  to make your service pack permanent and then will remove all files needed before that service pack (note: this exe might be named different on each OS version or SP release, look at item 4 under sources)
  3. or you can compress the folder (right click>properties>advanced>compress contents to save disk space) Doing this will take a lot of time based on the size, and with any compression will slow down the input and output speed of the reads and writes to this location. And based on the function of this folder might slow your OS down as long as this folder is compressed.
  4. nothing and expand your partition or backup and restore on a new larger disk


  1. http://blog.dampee.be/post/2011/12/04/Remove-Service-Pack-on-Windows-Server-2008-R2-(Compcln).aspx
  2. https://blogs.technet.com/b/askcore/archive/2008/09/17/what-is-the-winsxs-directory-in-windows-2008-and-windows-vista-and-why-is-it-so-large.aspx?Redirected=true
  3. http://answers.microsoft.com/en-us/windows/forum/windows_vista-files/to-use-or-not-to-use-compclnexe-that-is-the/cd93be4b-6e09-4419-b74e-0417f1273dc0
  4. http://support.microsoft.com/kb/2592038

Folder installer:

This folder is used for some program uninstallers and patch uninstallers

  1. I don’t recommend you delete this
  2. It can be moved until needed. (don’t really recommend moving this off your computer, most like you will lose it) If you have a D drive you can move it over to that drive. You might want to zip/7zip it or use some other archive program to make it smaller
  3. use msizap utility to remove orphaned files, this is a developer tool and is dangerous if you dont know what your doing.
  4. Compress it (right click>properties>advanced>compress contents to save disk space) could slow down installing and uninstalling software
  5. nothing and expand your partition or backup and restore on a new larger disk

Folder SoftwareDistribution (bouns topic #1)

This folder is used for Windowupdate and on older systems will keep failed patch installers in this folder. So if this folder has a few GB of data in it, you might want to do something about it

  1. stop the windows update service, move it to a different drive, start windows update service. It will then recreate this folder
  2. Compress it if you dont really want to mess with it

$NTUninstall and $NtServicePackUninstall (bouns topic #2)

The older version of the installer folder

  1. Move and compress to a different drive incase you need them later. Or just compress it

Other system space saving you can try “Disk Cleanup” http://windows.microsoft.com/en-US/windows-vista/Delete-files-using-Disk-Cleanup


$hf_mig$ (bouns topic #3)


Used for window updates and migration “When a security update, critical update, update, update rollup, driver, or feature pack installs GDR version files, the hotfix files are also copied to the %windir%\$hf_mig$ folder. This supports migration to the appropriate files if you later install a hotfix or service pack that includes earlier versions of these files.”

  1. you can compress the folder if its two large.

How to create custom computer policy adm from registry

The problem:

Had to change the default regional settings on windows server 2003 so an application would show data correctly, it was installed as US regional settings but was used in EU. So come to find out that windows does not have a system-wide regional setting. At installation the default profile is set with what was picked at installation. And that default profile is used for all user accounts that get created so after an account is created it stores its own regional settings (currency, date, time, etc). Well come to find out that this is all stored in the registry and we have the option to do a login script, local GPO, domain level GPO, or just delete all the current user profiles. I went with local GPO as it was only for a few systems.

Waring: Make sure you backup your system before you do the steps below and if you don’t know what you’re doing in the registry you may not want to do this as it could destroy your system.

The fix:

  1. Make a copy of registry as a backup
  2. Make the change as the current user, to the regional settings you want (control panel>regional and language options) on advanced tab check apply all settings to current user and default profile (this will change it for your userid and all new ones)
  3. Make a copy of new changes (export reg key HKEY_CURRENT_USER>Control Panel>International) Note: HKEY_USERS>.DEFAULT>Control Panel>International is the default user settings but you DON’T want to copy this one.
  4. user a reg to .adm converter tool or create the .adm yourself (RegToADM from the nuts.exe package from http://yizhar.mvps.org/)
  5. copy new adm file to C:\windows\inf
  6. open gpedit.msc
  7. add your new .adm file to the User Configuration>Administrative Templates (right click add/remove templates, then add and find your new .adm file)
  8. change your filter options (have administrative templates highlighted and view>filtering, uncheck only show policy settings that can be fully managed. Otherwise you will not see your settings)
  9. enable all your new settings (go to your newly created folder under User Configuration>Administrative Templates that the .adm file created, this will now update all current user profiles with the new settings after they login)
  10. May need to reboot if its not working well with your applications

Helpful links if you need more help


VERITAS Storage Foundations error V-76-58628-3

When tring to write a disk signiture to a new disk and you get error V-76-58628-3

If you click on the blue link in the error it will take you to symantec’s site and tell you to restart, well that did not work for me.

First look at your new disk and see if it looks like the below screenshot.

If your disk looks like the second one with a “blue i” then your disk is offline you need to online the disk to make it look like the top disk from the screenshot.

Then you should be able to write your disk signature after you online the disk.

Enable Godmode in Windows

Note: The below where created for windows developers as shortcuts, so they may not be useful to some people; also please make a backup of your system be for enabling any of the undocumented items below. Not all of they work with all versions of windows and may cause different effects if you try.

To create the Godmode folder:

  1. create a new folder where you want it to be
  2. rename it “GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}”

This was tested in Windows 7 Ultimate 64Bit

Note: that xxxxx.{xxxx-xxx-xx-x-xxx-x-x} the xxxxx. in front can be any name you want that is what the folder will really be named at the end, dont modify the data in the {}.

Other items you can create: