Tuesday 14 January 2014

How to resolve SSL error "A specified logon session does not exist. It may already have been terminated. (Exception from HRESULT: 0x80070520)" on IIS

When attempting to bind an SSL certificate to a website, you get the error :  "A specified logon session does not exist. It may already have been terminated. (Exception from HRESULT: 0x80070520)"
The most likely cause of this error is a private key not being installed for the SSL certificate.
This means that the "Mark Exportable" check box was not selected when importing the SSL certificate.  To resolve this issue, re-import the SSL certificate from MMC certificate console and make sure the "Mark Exportable" check box is selected.

Monday 9 December 2013

Migrating DNS Zones from one server to another

Follow the steps to migrate dns zones from one windows server to another.

1. Stop the DNS service on source server.

2. Open registry editor using command "regedit" and export the dns zones in .reg from the registry path HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\Cu rrentVersion\DNS Server\Zones 

3. Install DNS service on destination server.

4. Create testing.com DNS zone manually (you can delete it after migration)

5. Copy all .dns files from "c:\windows\System32\dns" and exported .reg file from source server to destination server, .dns files should be copied under "c:\windows\System32\dns" of destination server and double click on the .reg file to import dns zones in the registry of destination server.

6. Restart DNS service on destination server so that you can see all migrated DNS zones in DNS management console.

Please Note: - If you want to replace the IP addresses of your source server to destination server, you do not need to edit the dns records. If you are using new IP addresses for destination server then you can download any tool from google to edit all dns records at one time.

Thursday 7 November 2013

SQL Server 2012 installation error "'ExecuteWorkflowAction' is not valid for the WorkflowIdentity element"

While installing SQL server 2012 we get the error :

"The action type 'ExecuteWorkflowAction' is not valid for the WorkflowIdentity element. The only valid action type is ExecuteWorkflowAction"

This is caused because setup file is unable to execute certain workflow identity stored under the installation files. 
Simple and best workaround to solve this issue is to extract the installation files and run the setup file. You will not get this error again and installation will be completed without problem.

Website Panel error "Login failed for user 'sa'."

Some times while accessing website panel, you get the below error :

Server Error in '/' Application.
Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.
The request failed with the error message:
--
<html>
<head>
<title>Login failed for user 'sa'.</title>
<style>

This error is usually caused by incorrect password.

Inorder to resolve this issue, you need to correct/update the password in web.config file. Follow the steps given below to resolve this issue:

1. Login to your windows server
2. Open IIS and locate the 'Enterprise server'.
3. Explore it and edit the web.config file in "Enterprise server" directory of website panel installation.
4. In web.config you will see the below lines :

<add name="EnterpriseServer" connectionString="server=(local);database=WebsiteP anel;uid=sa;pwd=PASSWORD;" providerName="System.Data.SqlClient" />

5.Check the password, if the password is incorrect and you are not sure of the correct password. Reset the  'sa' password and update the web.config file with correct password.

This will resolve your website panel issue.

Sunday 14 July 2013

How to schedule a PHP script in task scheduler

Quiet often there is a need to execute/run php script on some time interval at server side. And that php scripts should run automatically on windows server. You can add a task in windows task scheduler to run PHP script. 

PHP script can be executed easily on command prompt using the below command:
ex. C:\Path\to\php.exe -f "C:\Path\to\file.php"    
where -f is file attribute - parse and execute file.


Follow the below given steps to configure the PHP script to run in task scheduler.

1. To open task scheduler, click on Start >> Administrative Tools >> Task Scheduler.

2.Click on "create task" from "Actions" menu bar on right pane.




















3. In General tab, enter the name of the task.

4. In triggers tab, click on New and schedule the time at which script should execute, as per your requirements.




5.In Action tab, click on new and select 'Start a program' from Action option.Enter the path of PHP.exe in program/script field. Now enter the file option ex: -f c:\pathToHtdocs\fileName.php in Add Arguments field and click on Ok.



6. In condition tab, it is recommended all the option to default.




7. In settings tab, you can configure the options as per your requirements.


8. You are done with scheduling the PHP script, now you can select 'Run' option from options menu, to execute the task.

Tuesday 14 May 2013

Reset Mysql root Password using my.ini


Follow the below given steps to reset the Mysql root password :

1.Browse to your MySQL installation directory.

2. In there, go to "Data" directory. 

3. Find and Open the file named "my.ini"

4. Please ensure that you take a backup of the file "my.ini" prior making any changes. Between the 1st line "[MySQLD]" and 2nd "PORT=" enter "skip-grant-tables"

5. Restart MySQL Service.

You should now be able to login to MySQL prompt without Password.

Once you are at MySQL Prompt,its time to reset the existing password.

Type in
"UPDATE mysql.user SET Password=PASSWORD('New_password') WHERE User='root';"

This will give something like "Query OK, 0 rows affected (0.04 sec)
Rows matched: 1 Changed: 0 Warnings: 0"

7. Type "FLUSH PRIVILEGES;" and hit enter.

You have just reset your MySQL root password.

Now,Do not Forget to undo the changes made in "my.ini" file.

8. Remove "skip-grant-tables" from "my.ini" and restart MySQL Service.

Now you are ready to use your MySQL Service with New Password.


Remove logs or Entries from the Remote Desktop Connection


I found that most people have no idea how to delete a cached entries from Remote Desktop Connection (RDC) on a Windows OS based computer. In fact, I had no clue how to do this. Even after you log out and select delete profile from the RDC, it will still show up in the Connections drop down next time someone open it. This is a problem because if a user with wrong intent to attack your computer or server open the RDC, it will provide them with half of the solution to hack your system, the IP or domain name!
 I have no idea why a great user friendly software company like Microsoft doesn't explain well on their help sites on registry editing for intermediate to advance users. May be because they don’t want novice users to pick up that information from their site and damage the OS in the process of regedit. Yes, it include the path and how to edit it, but there are no clear cut step by step instructions on how to properly do it.
The following method is the easiest way to delete an entry from Remote Desktop Connection:
-Open regedit: Type regedit on the general search (on the start menu) of the computers running Windows Vista and up. If you have a older OS, then open Run, and type regedit.exe.
-Find this parth: Go in to the Terminal Server Client using, HKEY_CURRENT_USER–>Software–>Microsoft–>Terminal Server Client–>Default
-Delete the entry: You will see all the entries with their respective IP address or domain names recorded on the system history. Pick the one you want to delete and hit delete on your keyboard OR right click and delete it.
Make sure you close the regedit.exe BEFORE you open the RDC because this change may not reflect on the client.
Now you will not see the entry in the RDC client when you open it the next time.