Friday, March 22, 2013

How to get plesk account information using mysql

1. Getting all the domain account information from Plesk

mysql -uadmin -p`cat /etc/psa/.psa.shadow` -D psa -e "select
login,password,home from sys_users INNER JOIN accounts on;"

2. Get client login details from Plesk.

mysql -uadmin -p`cat /etc/psa/.psa.shadow` -D psa -e "select
login,password from clients INNER JOIN accounts on;"

3. Getting all mail account login information

mysql -uadmin -p`cat /etc/psa/.psa.shadow` -D psa -e "SELECT
CONCAT_WS('@',mail.mail_name, as email ,accounts.password
FROM domains,mail,accounts WHERE AND ORDER BY ASC,mail.mail_name ASC;"

4. Creating/deleting/updating mail accounts using command line

create mail account

/usr/local/psa/bin/mail -c USER@DOMAIN.COM -passwd PASSWORD -mailbox
true -cp-access true

update mail account

/usr/local/psa/bin/mail -u USER@DOMAIN.COM -passwd NEWPASS

remove mail account

/usr/local/psa/bin/mail --remove USER@DOMAIN.COM

5. Mailing list management

creating mailing list

/usr/local/psa/bin/maillist --create MYLIST -domain DOMAIN.COM
-passwd_type plain -passwd PASS -notify false -email LISTADMIN@DOMAIN.COM

Adding/removing members to the mailing list.

/usr/local/psa/bin/maillist -u MYLIST -domain DOMAIN.COM -members

/usr/local/psa/bin/maillist -u MYLIST -domain DOMAIN.COM -members

Getting list members

/usr/local/psa/bin/maillist -i MYLIST -domain DOMAIN.COM

Removing list

/usr/local/psa/bin/maillist -r MYLIST -domain DOMAIN.COM

6. Managing databases.

create database

/usr/local/psa/bin/database --create DBNAME -domain DOMAIN.COM -server
localhost:3306 -add_user DBUSER -passwd PASS

remove database

/usr/local/psa/bin/database -r DBNAMe

No comments:

Post a Comment