A way to get an emailable report of all mailboxes in a domain, their quota, usage and account status, so a domain admin can review their accounts without having to login to zimbra. (most of this is the same as viewing quota usage in zimbra admin, but this was easier, as it can then be emailed on a schedule)
I saved this file in /opt/zimbra/backup/scripts/ as usagereport.sh, owned by zimbra.zimbra chmod 755 accountusage.sh
#!/bin/bash
SMTP="10.0.0.2"
FROM="user@yourdomain.com"
TO="user@yourdomain.com"
SUB="Mailbox Usages"
MSG="Mailbox Usages"
output="/tmp/accountusage.csv"
domain="yourdomain.com"
SendTo="user@yourdomain.com"
rm -f $output
touch $output
server=`zmhostname`
/opt/zimbra/bin/zmprov gqu $server|grep $domain|awk {'print $1" "$3" "$2'}|sort|while read line
do
usage=`echo $line|cut -f2 -d " "`
quota=`echo $line|cut -f3 -d " "`
user=`echo $line|cut -f1 -d " "`
#status=`/opt/zimbra/bin/zmprov ga $user | grep ^zimbraAccountStatus | cut -f2 -d " "`
#with status
#echo "$user; `expr $usage / 1024 / 1024`MB; `expr $quota / 1024 / 1024`MB; ($status account)" >> $output
# without status
echo "$user; `expr $usage / 1024 / 1024`MB; `expr $quota / 1024 / 1024`MB" >> $output
done
#cat $output | mail @SendTo -s"Mailbox Usages for $domain"
sendemail -q -o tls=no -f $FROM -t $TO -u $SUB -m $MSG -s $SMTP:25 -a $output
Export/import windows server DNS zones
You can use Export-DnsServerZone and Import-DnsServerZone . Export: Export-DnsServerZone -Name "test.com" -Filename "test...
Mais vistos
-
Find Users Who Have Never Logged On Use the following PowerShell Command; Get-ADUser -Filter { LastLogonDate -notlike "*" -and En...
-
Java Keytool Command These commands allow you to generate a new Java Keytool keystore file, create a CSR, and import certificates. A...
-
First you have to configure a wpad site in your IIS Open the proxypac.pac file you have previously created and save as wpad.dat. Copy wpa...