Change the smtp address of a Microsoft 365 Group

In order to create a remote powershell session to 365, open Windows Powershell and run below commands:

$UserCredential = Get-Credential

and enter your 365 credentials when prompted.
Then type:

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session -DisableNameChecking

To add required smtp address:

Set-UnifiedGroup -Identity "Group Name" -EmailAddresses: @{Add ="GroupName@domain.com"}

To promote as a primary smtp address:

Set-UnifiedGroup -Identity "Group Name" -PrimarySmtpAddress "GroupName@domain.com"

To remove the old address from the group:

Set-UnifiedGroup -Identity "Group Name" -EmailAddresses: @{Remove="OldGroupName@domain.com"

To end your Exchange Online Powershell session:

Remove-PSSession $Session
Posted in Windows | Leave a comment

Freenas issue when replacing failed disk

When replacing a failed hard disk from the GUI you get the following error:
“Unable to GPT format the disk ada…”.
From the command line:
sysctl kern.geom.debugflags=0x10

dd if=/dev/zero of=/dev/ada3 bs=512 count=1

Posted in Linux | Comments Off on Freenas issue when replacing failed disk

Install Zabbix on Centos 7

Zabbix requires Apache-Mysql-PHP stack to be installed in order to run. You can follow this previous post.
Let’s download and install Zabbix

rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/7/x86_64/zabbix-release-2.4-1.el7.noarch.rpm
yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent

We have to edit timezone in /etc/httpd/conf.d/zabbix

php_value date.timezone Europe/Athens
service httpd restart

Create a database or Zabbix

mysql -u root -p
create database zabbix character set utf8;
grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by 'password';
flush privileges;
exit
mysql -u zabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-2.4.3/create/schema.sql
mysql -u zabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-2.4.3/create/images.sql
mysql -u zabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-2.4.3/create/data.sql

Edit /etc/zabbix/zabbix_server.conf to set up zabbix database credentials
Start the zabbix-server process

service zabbix-server start
systemctl enable zabbix-server.service

Finally add the necessary firewall rules for snmp and zabbix agent

firewall-cmd --permanent --add-port=161/udp
firewall-cmd --permanent --add-port=10051/tcp
firewall-cmd --reload

Windows agent
Download from:
http://www.zabbix.com/download.php
Unpack and copy to C:\
edit conf/zabbix_agentd.win.conf and add serverip under ‘Passive’ mode
Rename file to zabbix_agentd.conf
Run from command propmt in C:\install_dir –> zabbix_agentd.exe –install

Posted in Linux | Leave a comment

Install LAMP and WordPress on Centos 7

Install Mysql (MariaDB) and set password

yum -y install mariadb-server mariadb
systemctl start mariadb.service
systemctl enable mariadb.service
mysql_secure_installation

Install Apache

yum -y install httpd
systemctl start httpd.service
systemctl enable httpd.service

Open ports in firewall

firewall-cmd --permanent --zone=public --add-service=http 
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload

Install PHP

yum -y install php
systemctl restart httpd.service
yum -y install php-mysql
yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel
systemctl restart httpd.service

Now we are ready to install WordPress. Let’s create a database and a user for wordpress to work with.

mysql -u root -p
CREATE DATABASE wordpress;
CREATE USER wordpressuser@localhost IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
exit

Now let’s download and install WordPress

wget http://wordpress.org/latest.tar.gz 
tar xzvf latest.tar.gz
rsync -avP ~/wordpress/ /var/www/html/
mkdir /var/www/html/wp-content/uploads
chown -R apache:apache /var/www/html/*

Next we will configure WordPress

cd /var/www/html
cp wp-config-sample.php wp-config.php

Now we need to modify the following parameters that hold our database information in “wp-config.php” file

vim wp-config.php
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');

/** MySQL database username */
define('DB_USER', 'wordpressuser');

/** MySQL database password */
define('DB_PASSWORD', 'password');

Now we can complete the WordPress installation through the web interface. In your web browser, navigate to your server’s domain name or public IP address and fill the required information.

Posted in Linux | Leave a comment