Posted: November 15, 2010 in Front Page

Very welcome to my personal web blog. Here you will find various web contents that may be helpful. Please do not hesitate to provide feedback or ask any question you may have during the visit.

Usually you would like to know last time a database was restored. This is very handy script to show you the details.

WITH LastRestores AS
DatabaseName = [d].[name] ,
[d].[create_date] ,
[d].[compatibility_level] ,
[d].[collation_name] ,
RowNum = ROW_NUMBER() OVER (PARTITION BY d.Name ORDER BY r.[restore_date] DESC)
FROM master.sys.databases d
LEFT OUTER JOIN msdb.dbo.[restorehistory] r ON r.[destination_database_name] = d.Name
FROM [LastRestores]
WHERE [RowNum] = 1

You can simply get the details from dbo.restorehistory from MSDB databases. However, the above script will provide more details.

To setup the MFA for the first time follow the steps below.

Your company should provide you with a login details to Office 365. The access is usually through the Office 365 portal or SharePoint Online. Once you have the link and credentials follow the steps below:

1.Go to the provided URL (http://portal.office.com or http://companyname.sharepoint.com)

2. Type in Work username and password then click “Sign in”









3. You will get the below message to setup MFA click on “Set it up now”











4. Another window opens that asks you – How should we contact you? Fill the details and click “Contact me”.










There are different options here. I have chosen to send me a text message.

5. You will receive a text message with a verification number. Enter the number on the new window and click “Verify











6. Once the verification is completed you will see the Additional security verification. You should copy the password somewhere safe you will use this password to login to Skype for Business and other apps. Once completed click “Done”











7. You will be logged into the Office 365 portal or SharePoint site depending on what link you have used.

Any subsequent logins will require you to use a verification code which will be sent to the phone you have selected initially or choose a different verification method.



To resolve the error go to Network Connection and right click on the VPN connection then click on properties:

2016-01-25 10_37_31-WIN7 on HP650HNO - Virtual Machine Connection Go to Security tab and change the Data encryption to Maximum strength encryption:

2016-01-25 10_37_31-WIN7 on HP650HNO - Virtual Machine Connection

Click OK and try again.

Error Definition: 

The error has been observed on AX2009 Kernel (5.0.1600.3090) with Managment Reporter 2012 RU13  both databases installed on SQL 2012 SP1.

When running a Management Reporter 2012 report this error is shown in the Report Queue Status:

2016-01-25 10_28_19-WIN7 on HP650HNO - Virtual Machine Connection

Try  going into Column Definitions and open any column definition. If you get error “The operation could not be completed due to a problem in the data provider framework” check Windows Event logs.

2016-01-25 10_31_50-WIN7 on HP650HNO - Virtual Machine Connection

On the event logs the very first error on Management Reporter may show something like “One functional currency code must be defined”

2016-01-25 10_37_31-WIN7 on HP650HNO - Virtual Machine Connection


To resolve the issue you must enable the secondary currency in Dynamics AX and set the secondary currency for all existing companies. -If you need help on this feel free to drop a message.


SQL Server preformance

Posted: April 11, 2015 in SQL Server

Turn on flag – DBCC TRACEON 1222

Start monitoring the SQL Server Event Logs.

There are enough online resources available to encourage  you prepare for CCNA. I would suggest get your hands on ICND1 and ICND2 books written by Wendell Odom. These two books are very well detailed and provide you a great insight to CCNA and teach you everything you need to know to pass CCNA.

There are other resources that could be of immense help while preparing for CCNA like Chris Bryant Video Boot Camp. And Pual Browning new site howtonetwork.com.

Make sure you install GNS3 on your machine. It is a unique graphical network simulator. You would need ISO images to be able to use the routers in GNS3 and you can find them online. There is one thing that no software simulator can provide, a full switch mode you would need a real cisco switch to practice some of the commands.

For the well-know port numbers click here.

The procedure below only works for Window OS  but the same method  should work for other operating systems.

Start command-line: keyboard shortcut Windows+r then type cmd OK

runas /user:postgres cmd 

You will need to enter postgres user’s password if you are not sure what the password is you should be able to change it through Computer Management under control panel. Please ask if you are not sure.

Once you successfully logged in as postgres user you will need to open Regional and Language settings via the command-line:

control intl.cpl

Make all the required configurations then restart postgresql service.

For this tutorial you would need at least 1GB USB stick and fast internet. The USB stick will be formatted so don’t use a USB stick with your important files or photos stored. Your current operating system should be Windows if you are using other operating systems this will not work.

To start with you would need to get a Linux distribution (they are open source) there are large number of Linux distributions available but easiest and commonly used distribution is Ubuntu the current stable version is 12.04 you can download it from their website.

Once you have the Ubuntu downloaded then you can use Universal USB installer to load the Ubuntu on to the USB. ImageOpen the Universal USB Installer in Step 1: select Ubuntu 12.04 Desktop. Step 2: click the Browse button and find the Ubuntu distribution (ubuntu-12.04.1-desktop.iso) you downloaded before. On Step 3 it is important to select the correct USB drive in the drop down (go to My Computer and see the drive letter for your USB stick). Then click Create to make the live Ubuntu USB stick. It depends on your computer specs and the USB speed on how long would it take but it should never take longer than half an hour.

Once the USB stick is ready you can either install Ubuntu into your computer or just try running your computer via the USB you just created. To start your computer with the USB your computer should have the capability to start from a bootable USB drive.

Nowadays most desktop and laptop computers have the option to allow you select the media you would like to start your computer with by pressing the F12 button on the startup screen. However, if this doesn’t work then you would need to go to the BIOS and set the boot priority.  You can start the BIOS by pressing F2 or DEL button the startup screen. Then go to the Boot Tab on the top and make the USB the first option.

If you successfully configured your computer to start with USB you should see the image below:

ImageClick Try Ubuntu to start Ubuntu without installing or changing anything in your computer. If you would like to install Ubuntu on your computer then choose install and follow the instruction here.

Aside  —  Posted: October 21, 2012 in Front Page, Linux, Technology
Tags: , , , ,

Run the commandline as administrator.


Type cmd on the search box, right click on the cmd icon and Run as administrator.

Then copy and paste command below:

REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" /v postgres /d 0 /t REG_DWORD /f

original post here.

Aside  —  Posted: October 19, 2012 in Front Page, postgresql, Technology, Windows

After setting up the samba make sure you add root

smbpasswd -a root

If you get the above error try this:

smbpasswd -a -m $machinename

(the machine you are trying to join to the domain)

you might get the error the group ‘machines does not exist.

addgroup machines

try again now you should be able to add the machine name and join the doamin.

Look at the /var/log/samba/log.machinename for more details of the errors you get.