Powershell script cannot be loaded because the execution of scripts is disabled on this system
August 22nd, 2014Enable running scripts:
set-ExecutionPolicy Unrestricted
Enable running scripts:
set-ExecutionPolicy Unrestricted
Enable SSH access on ESX host
Install vmware vSphere CLI
Go to:
C:\Program Files (x86)\VMware\VMware vSphere CLI\bin
See configuration with:
vicfg-snmp.pl –server 10.0.0.42 -s
Setup snmp:
vicfg-snmp.pl –server 10.0.0.42 -c info -p 161 -t 10.0.0.10@161/public,10.0.0.17@161/public
CIM:
vicfg-snmp -server 10.0.0.42 -y indications
IPMI:
vicfg-snmp -server 10.0.0.42 -y sensors
10.0.0.42 — esx host
161 – port (udp)
10.0.0.10/10.0.0.17 target (HP SIM etc.)
info – my community string
Enable snmp
vicfg-snmp.pl –server 10.0.0.42 -E
Se configuration agin.
vicfg-snmp.pl –server 10.0.0.42 -s
test with snmpwalk:
SnmpWalk.exe -r:10.0.0.42 -c:info
Update:
On a ESXi5.1 and newer, use esxcfg-snmp.pl isted of vicfg-snmp.pl
postqueue -p | tail -n +2 | awk ‘BEGIN { RS = “” } / refund_of_tax@mycomp\.com/ { print $1 }’ | tr -d ‘*!’ | postsuper -d –
Script:
#Bash
while true; do
sleep 5
postqueue -p | tail -n +2 | awk ‘BEGIN { RS = “” } / refund_of_tax@mycomp\.com/ { print $1 }’ | tr -d ‘*!’ | postsuper -d –
done
Block the email:
nano /etc/postfix/recipient_access
[email protected] REJECT
postmap /etc/postfix/recipient_access
/etc/init.d/MailScanner restart