Tuesday, December 13, 2011

Configure automatic date and time synchronization on Windows Server 2008 R2

If you like to see your Windows Server 2008 R2 automatically syncing it’s date and time settings, do following:

  • Start console as administrator
  • Stop the service

    net stop w32time

    image
  • Run

    w32tm /config /syncfromflags:MANUAL /manualpeerlist:<list of NTP servers>

    image
    For list of public NTP servers please refer to: http://support.ntp.org/bin/view/Servers/NTPPoolServers
    We use 0.europe.pool.ntp.org to 3.europe.pool.ntp.org
  • Start the service again

    net start w32time

    image
  • Check the system event log for successful configuration:

    The time provider NtpClient is currently receiving valid time data from 0.europe.pool.ntp.org,1.europe.pool.ntp.org (ntp.m|0x1|0.0.0.0:123->85.236.42.140:123).

    image

From now your server will sync the date and time settings automatically.

You can update the configuration of the local time service also without service restart: just run

w32tm /config /update /syncfromflags:MANUAL /manualpeerlist:<list of NTP servers>

If you plan to let other boxes in your network segment sync their date and time settings with the setting of this box, you have to configure the time service on this box as reliable:

w32tm /config /reliable:yes

For more options refer to Microsoft article:
http://technet.microsoft.com/en-us/library/cc773263%28WS.10%29.aspx

Enjoy!

UPD: here the script sample to copy/paste. ATTENTION “w32tm /config…” is one line – remove evtl. line breaks after copy

rem stop w32time
net stop w32time
rem config service
w32tm /config /syncfromflags:MANUAL /manualpeerlist:0.europe.pool.ntp.org,1.europe.pool.ntp.org,2.europe.pool.ntp.org,3.europe.pool.ntp.org
rem restart w32time
net start w32time

Saturday, November 26, 2011

Resize Windows 7 partition on HDD

!!! NOT AN ADVERTISMENT, JUST SUGGESTION !!!

The problem: the partition on the HDD for Windows 7 was measured too small – after a year the system partition was nearby completely exhausted.

Standard tools won’t help. The home users can use a free tool as I did:  EASEUS Partition Master.

Enjoy!

Monday, November 14, 2011

RDP to Windows Server 2008 R2 failed with message: "The connection cannot continue because the identity of the remote computer cannot be verified"

Using RDP to each serve in our development farm, we encountered suddenly following error:

x10sctmp
Error Message: "The connection cannot continue because the identity of the remote computer cannot be verified"

We can still get RDP to the machine using it’s IP address, but not using the machine name – even not fully qualified with domain name etc.

The reason is the difference in time settings:

time settings at the target machine:

x10sctmp0

time settings at the machine with RDP client:

x10sctmp1

20 minutes difference caused the difference. After the time was synchronized, we were able to connect the target machine again.

Also a centralized time synchronization across the farm may be used to avoid the problem.

UPD: the problem seems to be known and mentioned at

http://developers.de/blogs/edin_mulic/archive/2009/08/18/cannot-establish-remote-desktop-connection.aspx

Tuesday, October 11, 2011

Missing tray icon for Windows Live Messenger on Windows Server 2008 (R2) and Windows 7

You may miss the tray icon for Windows Live Messenger on machines running Windows Server 2008, Windows Server 2008 R2 or Windows 7. The process is running, you get – depending on configuration – bubble notifications, but see no tray icon to open messenger window.

Refer to article

http://www.sevenforums.com/tutorials/3794-windows-live-messenger-taskbar-notification-icon.html,

set the compatibility for msnmsgr.exe to Vista (on Windows Server 2008 R2 or Windows 7) or Windows XP (for Windows Server 2008), restart Messenger (just kill the process and restart) and enjoy!

Problem: cannot open PDF attachments using Outlook 2007 / 2010

Using Outlook 2007 or 2010 you may encounter strange problem:  PDF mail attachment won’t be opened with Acrobat Reader X (we monitored the problem with Outlook 2007 and 2010 using Acrobat Reader X 10.1.1).

While the attachment can be previewed in Outlook mail reader pane:
image

a double click on the same attachment in the same mail brings the Acrobat Reader X Window with error dialog box above saying: “There was an error opening this document. Access denied.”

x10sctmp2

The side effect is: if at least one Acrobat Reader X instance (program window on desktop) is already running, the attachment will be opened properly. Only if there’s no Acrobat Reader X window opened before you try to open a PDF mail attachment from Outlook – the error message appears.

The solution is:

  • open Acrobat Reader X
  • navigate menu Edit->Preferences:
    image
  • uncheck “Enable protected mode at startup”:
    image
  • confirm appearing dialog with “Yes”:
    x10sctmp4
  • close Preferences Dialog with “OK”
  • close Acrobat Reader X
  • retry to open PDF mail attachment
  • …enjoy!

Saturday, October 08, 2011

Microsoft Windows Azure is the best in the cloud speed test

x10sctmp3

Details here:
https://www.cloudsleuth.net/web/guest/global-provider-view

The test Azure account can be obtained here:
https://windows.azure.com/default.aspx

(Windows Live account required).

Build your Azure service and enjoy!

Tuesday, October 04, 2011

Relax 1

This summary is not available. Please click here to view the post.

Thursday, September 15, 2011

Visual Studio reports error: "Installation of this application requires a Windows Store Developer license …"

You downloaded Windows 8 CTP with developer tools, you start pre-installed Visual Studio 11 Express for Windows Developer Preview, you try to create a new application project – and get the error message:

"Installation of this application requires a Windows Store Developer license…"

The reason is: you need to install a developer license locally to your machine to get the development environment working properly.

  • exit Visual Studio
  • make sure your Windows 8 instance is connected to the internet
  • restart Visual Studio and confirm dialog box informing about installation of developer license

The error message must be gone: enjoy it – otherwise the license was not installed properly.

Wednesday, September 14, 2011

Download Windows 8 Preview

Windows 8 Preview can be downloaded here: http://msdn.microsoft.com/en-us/windows/apps/br229516

Facts:

  • available are x86 and x64 ISO (english)
  • additionally x64 with developer tools:
    image
  • OS can be installed virtualized (using Hyper-V)

Download, install and enjoy!

x10sctmp1x10sctmp0

Thursday, September 08, 2011

Hyper-V on Windows 8

Yes, it is true: Hyper-V comes with Windows 8 (x64 version):

http://blogs.msdn.com/b/b8/archive/2011/09/07/bringing-hyper-v-to-windows-8.aspx

Starting with Windows 8 we forget the difficulties to set up a proper virtual development environment, as described here.

Simply setup Windows 8 and enjoy!

Friday, July 29, 2011

Low-budget warm-up for Web application or how to automate ping a Website

In different IT scenarios there’s a need to access a Website just to check if it is available or even to ignite it’s start.

There are some automation tools for this purpose: I’ve seen even a download from Microsoft Website for warm-up of Microsoft CRM Websites – but do not recall where.

The quick and cheap alternative is to use PowerShell script for this purpose and bind it to a scheduled task.

This is the script – quite self-explanatory

    #check and create an eventlog source to report results of website probing
$eventLogSource =
"ProbeWeb";
if (![system.diagnostics.eventlog]::SourceExists($eventLogSource))
{
new-eventlog -logname Application -source $eventLogSource
}
#create webclient
$webClient = new-object System.Net.WebClient
$output = "";
$webSite = “http://winmike.blogspot.com”;
$startTime = get-date
#probe thewebsite
$output = $webClient.DownloadString($webSite)
$endTime = get-date
#test website response for desired character sequence
if ($output -like "*Mike*")
{
$message = $webSite + " succeeded " + $startTime.DateTime + " " + ($endTime -$startTime).TotalSeconds +
" seconds"
}
else
{
$message = $webSite + " failed " + $startTime.DateTime + " " + ($endTime - $startTime).TotalSeconds +
" seconds"
}
#record the results
write-eventlog -logname Application -source $eventLogSource -eventID 42
-message $message
Save this script in a file on the disk (for exampe, in c:\scripts\probeweb.ps1).
Start the script from powershell
x10sctmp0
and you will see the output in the eventlog - smth like that:
x10sctmp
Well, now bind it to a scheduled task. Open the Task Scheduler Library (via computer management) and select “Create Basic Task…”:
x10sctmp1
Enter task name and description, then select time period to repeat the task:
x10sctmp2 x10sctmp3
Select “start a program! as a task action:
x10sctmp4
Enter program name as follows
c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe
(check the %SystemRoot% – your drive letter and path may vary)
and
c:\scripts\probewe.ps1
as argument (or alternate path to your script):
x10sctmp5
Review summary of the task:
x10sctmp6
…and confirm the task. You will see the task in the list of your task library:
x10sctmp7
Open the task properties and assure “Run whether user is logged on or not” is selected and the correct user account is used as execution context.
x10sctmp9
Confirm the password if requested.
Run newly created task to make sure it works:
x10sctmp10
Analyze the results
x10sctmp11
…and enjoy!

Monday, July 11, 2011

CD/DVD/Data Recovery source (hints and utilities)

Neither an advertisement, nor announcement. No my personal warranty. Only recommendation.

I was looking for help to rescue some data on my older CDs and HDDs. Found here: RLAB.

x10sctmp

You’ll find there many useful data recovery utilities – and numerous freeware among them.

Used with success:

R.Viewer – creates list of the disk files in different formats. This utility is very useful to get a snapshot of the file list on your drive: for example, to compare it with an earlier backup set or for other purposes. Supports CSV, HTML, XML formats – the result can be used in Microsoft Excel for filtering,sorting and further processing.

CHKParser32 – supports recovery of the damaged data, found after running chkdsk utility. Check Disk (chkdsk) utility collects “orphaned” or other way damaged files in .chk files. CHKParser32 helps to join them into meaningful data files (pictures, texts etc.).

Saturday, June 25, 2011

How to: perform page break by printing ASP.NET Web forms

Once we created an ASP.NET Web Application having web forms the next request was to organize carbon copy of these forms: do print them and support page breaks.

The solution is:

  • declare dedicated div style class for separate print pages
  • add page-break-after: always; property to this class
  • enclose the print pages in separate div elements and set their style to the class declared above

Example:

the ASP.net Form:

<%@PageLanguage="C#"AutoEventWireup="true"CodeFile="WebForm.aspx.cs"Inherits="WebForm"%>
<!DOCTYPEhtml PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
htmlxmlns
="http://www.w3.org/1999/xhtml">
<
headrunat
="server">
    <
styletype="text/css"media
="screen">
      
.formLabel
      
{
            min-width: 100px;
            color: Blue;
        }
       
.formTextBox
      
{
            width: 200px;
        }
    </style
>
    <
styletype="text/css"media
="print">
      
.formLabel
      
{
            min-width: 100px;
            color: Black;
        }
       
.formPage
      
{
            page-break-after: always;
        }
       
.formTextBox
      
{
            width: 200px;
        }
    </style
>
    <
title>Department Form</title
>
</
head
>
<
body
>
    <
formid="form1"runat
="server">
    <
div
>
        <
divclass
="formPage">
            <
asp:LabelID="LabelName"runat="server"Text="Name:"CssClass="formLabel"Width="100px"></asp:Label
>
            <
asp:TextBox ID="TextBoxName"runat="server"CssClass="formTextBox"></asp:TextBox
>
            <
br
/>
            <
asp:LabelID="LabelPhone"runat="server"Text="Phone:"CssClass="formLabel"Width="100px"></asp:Label
>
            <
asp:TextBox ID="TextBoxPhone"runat="server"CssClass="formTextBox"></asp:TextBox
>
            <
br
/>
        </
div
>
        <
divclass
="formPage">
            <
asp:LabelID="LabelAddress"runat="server"Text="Address:"CssClass
="formLabel"
              
Width="100px"></asp:Label
>
            <
asp:TextBox ID="TextBoxAddress"runat="server"CssClass="formTextBox"></asp:TextBox
>
            <
br
/>
            <
asp:LabelID="LabelRegPlate"runat="server"Text="Reg. Plate:"CssClass
="formLabel"
              
Width="100px"></asp:Label
>
            <
asp:TextBox ID="TextBoxRegPlate"runat="server"CssClass="formTextBox"></asp:TextBox
>
            <
br
/>
        </
div
>
    </
div
>
    </
form
>
</
body
>
</
html
>

The form in browser:
image

The form in print view:

imageimage

Enjoy!

Wednesday, June 22, 2011

Troubleshooting Firefox 5 and delicious bookmarks

Firefox 5 is here, and the problem described here appears again.

Use the same “cure”: change “4.*” to “5.*” and enjoy!

Wednesday, June 15, 2011

TFS 2008 Problem: Unable to connect to the Windows SharePoint Services

Assume, you plan to create a new TFS project using TFS 2008. Everything goes well up to the last step - then an error dialog appears saying “Unable to connect to the Windows SharePoint Services at <URI>”:

image

The reason is, the TFS instance cannot create the Sharepoint Portal for the project. More information is to find in the error log file on the TFS server.

Most popular problem are changed connection properties to Sharepoint instance (for example, port number). In this case the log file contains message, that the server rejects the connection on used URI.
(We discounter this error due to uncoordinated change in Sharepoint configuration, where the port number was altered in mistake).

OK, two things to take away.

1. Show the current TFS settings.

Log-in to TFS server, got to the TFS program files folder, the to the “Tools” subfolder – here you find the TfsAdminUtil: administration utility for TFS.

Start it using following command line:

TfsAdminUtil configureconnections

You see all the important current settings for local TFS instance:

image

2. Change required setting

For this task TfsAdminUtil offers set of keys/options:

x10sctmp0

For example, use /SharepointAdminUri: to change Sharepoint Administration URI:

TfsAdminUtil configureconnections /SharepointAdminUri:http://myserver:myport/_vti_adm/admin.asmx

Think about full path to the administration service file (.asmx), not just admin site URL!

image

Use TfsAdminUtil to view changed settings as shown above, restart TFS server and enjoy!

Tuesday, May 31, 2011

Online virus check: http://www.virustotal.com

Online tool to check any file or web site for viruses and malware:

http://www.virustotal.com

x10sctmp

Enjoy!

Friday, May 20, 2011

How Internet Explorer versions handle bad-formed XML files

Following the change from Beta to RTM Version of IE 9 in display of XML files feature we continue to work with IE using it to display XML files in certain situations.
Well, after the IE9 RC version turned back to “traditional” XML data display format, the problem seems to be solved.
But there’s a significant change in this functionality of Internet Explorer 9 and Internet Explorer CTP 10 in XML data display policy: this time it is about the bad-formed XML files.
Assume a well-formed XML file:
<root>
<element name="3" />
sample text
<element name="1" />
<element name="2" />
</root>
 
This file is displayed properly in IE8:
 
x10sctmp2
in IE9:
 
x10sctmp0
 
and in IE10:
x10sctmp1
 
Then we try following bad-formed XML data:
<root>
sample text
<element name="1" />
<element name="2" >
<element name="3" />
</root>

(the element [element name=”2”] has no closing tag)

This file is displayed in IE8 as expected:

x10sctmp3

The IE9 displays the same data as follows:

x10sctmp4

Neither the error notification nor any explanation are presented to the user. Via the option “View Source” you can see the source XML data, but again – no error information exists:

x10sctmp5

The same for HTML view in Developer Tools Window (activated by F12):

x10sctmp6

And only Console view:

x10sctmp7

and Script view provide us with error information:

x10sctmp8

Same behavior shows also the IE10 CTP:

x10sctmp9 x10sctmp10

Using “Force IE7” … “Force IE9” mode doesn’t affect this behavior.

The FireFox 4 displays the same well-formed XML:
x10sctmp11

and bad-formed as expected from previous FF versions:
x10sctmp12

This difference in handling of bad-formed XML data may be essential for a custom application using web browser to display XML data. Just keep it in mind…