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:



Windows User profiles

This is going to be a mixed topic about user profile management.

Note: never delete a user profile out of Documents and Settings or Users. This will only remove the profile’s data, but not its information in the registry. This will cause errors later like unknown profiles.

How to correctly remove Windows profiles

  1. Open System in Control Panel.
  2. On the Advanced tab, under User Profiles, click Settings.
  3. Under Profiles stored on this computer, click the user profile you want to delete, and then click Delete.

Automated way to remove profiles

  • Use command line tool “delprof.exe”, works great for a terminal server’s with hundreds of profiles.
  • Tool can be downloaded from Microsoft https://www.microsoft.com/en-us/download/details.aspx?id=5405
  • You can find some good scripts as well just make sure they delete the registry data for the profile as well.

How to delete profiles with “NTUSER.DAT in use

  1. Make sure the user is not logged in
  2. reboot system, if reboot did not unlock ntuser.dat move on
  3. download “User Profile Hive Cleanup Service” from Microsoft https://www.microsoft.com/en-us/download/details.aspx?id=6676
  4. install
  5. reboot
  6. ntuser.dat should no longer be in use.
  • Note: this sometimes will also clean up profiles listed as unknown
  • Note: most “unlock” utilities will not unlock this .dat file.

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


How to hide unwanted accounts from windows login screen

How to hide a windows account from the login screen list

NOTE: Make sure your system is backed up before making changes to your registry!

  1. From Run launch regedit.exe
  2. Move to key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList” NOTE: that most likely SpecialAccounts and UserList will not be there so just create two new sub-keys.
  3. Under UserList create a new DWORD (32bit) Value, and name it the userID of the account you want hidden (this is not the display name)
  4. Make sure the value is set to 0 (this should be the case by default)
  5. To enable the account again just change the value to 1
  6. Log off or restart for this setting to take effect.

How to debug a VM with a serial port

  1. Get your VM in Vmware workstation or Vmware server (with windows running as the host)
  2. Add a serial port to the vm
  3. Configure the serial port as


  4. Configure Msconfig


  5. Reboot
  6. Configure BIOS (may not be needed) change serial port A and B


  7. Install Debugging Tools for Windows
  8. Open Windbg
  9. Configure Symbol path (srv*c:\windows\symbols*http://msdl.microsoft.com/download/symbols)
  10. save workspace


  11. Configure Kernel Debug


  12. Save workspace
  13. Go to debug>break
  14. And it should connect

How to align Windows disks in VMware with Netapp disk

alertWarning: Always have a backup before you perform disk alignments in windows

How to check Drive alignment in windows:

  1. run “System Information” (msinfo32.exe in Start-> Run)
  2. and select Components .. Storage .. Disks
  3. scroll to the bottom and you will see the Partition Starting Offset information.
  4. This number needs to be perfectly divisible by 4096.
  5. The default .vmdk, you will see the Partition Starting Offset set to 32,256  (32,256 / 4096 = 7.875)
  6. and thus this file system is not correctly aligned.

 Align C Drive

To do this after a P2V or after the fact

http://blogs.netapp.com/storage_nuts_n_bolts/2009/01/mbrscanmbralign.html to use mbrscan and mbralign in the ESX console to align, you will need to go to the host the VM is running on to do the steps (not for ESXi because they are part of netapp host tools that needs to be installed)

New VM

create your vm and use a boot disk before you install the OS to align the disk (follow align other disk section)

How to align other windows disks

alertImportant warning: If you do these steps on C drive you will lose your data

Note: if you have a misaligned disk you will need to create a new disk perform the steps and migrage the data, After you have added a new disk to your VM and NOT formated it follow the below steps, this might work with the align C drive steps to save recreating and migrating data, but have not tried it.

  1. CMD>diskpart
  2. DISKPART> list disk (disks should be listed)
  3. DISKPART> select disk # (This selects the disk drive)
  4. DISKPART> list partition (This step should result in a message stating “There are no partitions on this disk to show.” This message confirms the disk is blank)
  5. DISKPART> create partition primary align=64
  6. Viewing the disk using “System Information” the Partition Starting Offset is now 65,536… 65,536 / 4096 = 16, and thus this file system is properly aligned to the storage blocks.
  7. Format it

Another note: is currently VMware converter does not align your harddrives this will need to be done after you do your P2V, and you do not need these steps for Windows 2008 it should be aligned from the install.

How to merge split PDF’s for Free

PDFTK http://www.pdfhacks.com/pdftk/ is a command line free opensource tool that can do many things to PDF’s like merge and split them and you can get PDFTK Builder http://angusj.com/pdftkb/ that is a GUI for the main functions of the tool. This is better then spending lots of money for a tool and its small if you want the command line version. It is also available for other OS’s too.

XP SP2 BlueScreen BSOD and DFS

Problem: Using Windows XP SP2 that is mapped to a DFS share will bluescreen when saving documents.

Recorded Microsoft KB artical: 906866  http://support.microsoft.com/kb/906866

Other related post: http://www.tech-archive.net/Archive/Windows/microsoft.public.windowsupdate/2007-04/msg00848.html

Fix: SP3 Fixes this problem, or you can follow the steps lisked in the two articals.

Windows Logon Message

Windows Logon Message for systems connecting to a Active Directory Domain.

Error: “The system cannot log you on now because the domain <name> is not available”

Cause: This is caused by low system memory or pagefile is full.

Fix: a reboot should fix the connection, then the memory leak needs to be fixed or space problem need attention.


Rocket dock

Looking for a extra dock or like the dock for mac but have windows well rocket dock might be what your looking for.