Monday, November 21, 2011

Access Plesk Database

Below are the ways to access different types of Plesk database

MS SQL: 


The database can be accessed using the following CLI command:

C:\Program Files\Microsoft SQL Server\80\Tools\Binn\osql –E

Or you can use the Microsoft SQL Server Management Studio Express


MySQL

Run the following command in 'command prompt'

cd %plesk_dir%\MySQL\bin

mysql -P8306 -uadmin -p psa



MS ACCESS DB (JET)

Use any utility that can used with MS ACCESS (.mdb) files


The Plesk database file is located in %plesk_dir%\admin\db\psa.mdb


Thanks :)

Find Database type used by Plesk

Here is the way to find which type of database is used by Plesk to store its information:

Run Registry editor by typing 'regedit' in the Run prompt

Find the below key:

HKEY_LOCAL_MACHINE\SOFTWARE\PLESK\PSA Config\Config


For X64 OS


HKEY_LOCAL_MACHINE\SOFTWARE\wow6432node\PLESK\PSA Config\Config

Under this, find the value

"PLESK_DATABASE_PROVIDER_NAME"

It could be any of the below 3 types:

- Jet  (MS ACCESS)
- MySQL
- MSSQL




Friday, November 11, 2011

Update Hardware Changes in Plesk 10.x Health Monitor

Sometimes, when you add new hardware to your server, those changes may not get reflected on the Plesk panel. Here is a method to manually update it.

Windows

Go to Command Prompt and enter these:
cd %plesk_bin%
php.exe -d auto_prepend_file="" "%plesk_dir%\admin\plib\scripts\setup-health-monitor.php"

Unix

# /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/scripts/setup-health-monitor.php 


:) 

Saturday, November 5, 2011

Retrieve SQL Server 2008 Product Key

Open Power Shell and Paste the foll: script:

-------------------------------------------------
function Get-SQLserverKey {
    ## function to retrieve the license key of a SQL 2008 Server.
     param ($targets = ".")
    $hklm = 2147483650
    $regPath = "SOFTWARE\Microsoft\Microsoft SQL Server\100\Tools\Setup"
    $regValue1 = "DigitalProductId"
    $regValue2 = "PatchLevel"
    $regValue3 = "Edition"
    Foreach ($target in $targets) {
        $productKey = $null
        $win32os = $null
        $wmi = [WMIClass]"\\$target\root\default:stdRegProv"
        $data = $wmi.GetBinaryValue($hklm,$regPath,$regValue1)
        [string]$SQLver = $wmi.GetstringValue($hklm,$regPath,$regValue2).svalue
        [string]$SQLedition = $wmi.GetstringValue($hklm,$regPath,$regValue3).svalue
        $binArray = ($data.uValue)[52..66]
        $charsArray = "B","C","D","F","G","H","J","K","M","P","Q","R","T","V","W","X","Y","2","3","4","6","7","8","9"
        ## decrypt base24 encoded binary data
        For ($i = 24; $i -ge 0; $i--) {
            $k = 0
            For ($j = 14; $j -ge 0; $j--) {
                $k = $k * 256 -bxor $binArray[$j]
                $binArray[$j] = [math]::truncate($k / 24)
                $k = $k % 24
         }
            $productKey = $charsArray[$k] + $productKey
            If (($i % 5 -eq 0) -and ($i -ne 0)) {
                $productKey = "-" + $productKey
            }
        }
        $win32os = Get-WmiObject Win32_OperatingSystem -computer $target
        $obj = New-Object Object
        $obj | Add-Member Noteproperty Computer -value $target
        $obj | Add-Member Noteproperty OSCaption -value $win32os.Caption
        $obj | Add-Member Noteproperty OSArch -value $win32os.OSArchitecture
        $obj | Add-Member Noteproperty SQLver -value $SQLver
        $obj | Add-Member Noteproperty SQLedition -value $SQLedition
        $obj | Add-Member Noteproperty ProductKey -value $productkey
        $obj
    }
}

---------------------------------------

Now enter the below command

Get-SQLserverKey

Press Enter (may be twice)... Details will be shown in the Power Shell Window itself.. It worked for me :)

Friday, February 4, 2011

Error on Plesk File Manager (FileList::init() failed: ls_dir_wrapper() failed: Unable to logon user)

The issue happened to me on Plesk 10. Here is the work around:



Make sure that the account associated with the domain is active on the server. If it is disabled, you just need to enable it from the Computer Managements --> Users

If account is enabled, the most possible reason of the issue is that the password of domain owner account is not synchronized with corresponding record in Parallels Panel database.
To fix that take the following steps:

1. Retrieve the password of the domain owner from Parallels Panel database with the command below (where USER1 is an owner of the domain, it can be taken from the error):

C:\> "%plesk_bin%"\dbclient --direct-sql --sql="select su.login, a.password from accounts a, sys_users su  where a.id=su.account_id and su.login='USER1'"

login       password
USER1       p@ssw0rd


2. Synchronize system password with accordance of retrieved one as follow:

C:\> net user USER1  p@ssw0rd

 
Good Luck

Tuesday, January 18, 2011

Export Data Sources (ODBC)

1. Start regedit.exe
2. Go to HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI
3. Select the desired Data Source folder --> Right click it --> Export
4. Save it.

5. Go to your target machine
6. Copy the saved 'reg' file to target machine
7. Double click it to restore.

Note : Take a backup of your current ODBC folder before applying the exported registry settings.