VM mới từ Rocky template

Tạo VM mới từ template Rocky đã có

Mở Gitlab > Build > Pipelines > bấm [New Pipeline]

Chọn PLAYBOOK: new_server, LIMIT: VM name > bấm [New Pipeline] > deploy

Sau khi deploy xong, vào console login root

cd /etc/ssh

sudo vi sshd_config

Sửa PasswordAuthentication no thành PasswordAuthentication yes

:wq 

Tạo tài khoản riêng:

sudo useradd -m username
sudo passwd username

sudo usermod -aG wheel username

Tạo bot telegram gửi alert

Tìm @BotFather (có dấu tích verified)

/start

/newbot

Đặt tên bot mới, yêu cầu đặt tên có _bot ở cuối, tối đa 32 char, chữ + số + gạch dưới. Ví dụ: Site_Alert_Devices_bot

/mybot chọn bot đã tạo

API Token => lấy key API, dạng 8443315929:AAFw0tzxo8eUScBL5Xw_729_FLv7262OwHn

Back to settings 

Bot settings > Group privacy > Turn off (cần check phần này có cần thiết không - chỉ để bot có thể đọc được tin nhắn trong group - và phục vụ check getUpdates)

Chat với bot, START

Tạo Group mới, đặt tên, add bot vào group, chat vài tin, sử dụng URL để check xem đã đọc được tin mới chưa, đọc được là ok

https://api.telegram.org/bot[thay API token vào đây, không bao gồm dấu ngoặc]/getUpdates 

Đồng thời khi truy cập URL trên cũng sẽ lấy được chat_id của group, lưu lại

chat_id thường là số âm: -100xxxxxxxxxx

Test cho bot gửi tin nhắn vào group (cmd):

curl -s -X POST "https://api.telegram.org/bot[thay API token vào đây, không bao gồm dấu ngoặc]/sendMessage" -d chat_id=[chat_id của group] -d text="Test từ server alert thành công!" 

VeeamOne: edit trên C:\script

Zabbix: 

  • Alerts > Media types > chọn và edit botToken
  • Users > Admins > Media > chọn và edit chat_id của group 

PRTG: vào noti như email thông thường, add thêm thao tác Execute HTTP Action rồi dùng link API sendmessages của telegram 


 

Các loại group, group email trên Microsoft 365

 Nơi quản trị:

1. Microsoft 365 admin center:

- Menu: Home > Active teams & groups > Active teams and groups 

- Các loại group: 

  • Teams
  • Microsoft 365 group
  • Distribution list
  • Security group

2. Exchange admin center:

- Menu: Home > Recipients > Groups

- Các loại group

  • Microsoft 365
  • Distribution list
  • Dynamic distribution list
  • Mail-enabled security

Quản lý member:

- Với group Microsoft: https://myaccount.microsoft.com/groups/groups-i-own

  • Microsoft 365

- Dành cho user có quyền owner: https://admin.exchange.microsoft.com/#/groups 

  • Distribution list
  • Mail-enabled security 

 

Export danh sách member trong group email 365

Get-DistributionGroupMember -Identity "tên group" | Select Name, PrimarySmtpAddress | Export-Csv -Path "D:\DanhSach.csv" -NoTypeInformation

Self host xibo trên Debian 13

Tải Debian 13: https://www.debian.org/download

Tạo VM, xác định dung lượng VM cần thiết để chứa media trên server 

Cài đặt lên VM, khi cài tích chọn thêm SSH Server phục vụ remote sau này, cài GRUB bootloader

Add user hiện tại (xiboadmin) có quyền Administrator (trên GUI - Settings) 

Mở terminal: gõ lệnh

su  =>chuyển qua root

/usr/sbin/usermod -aG sudo xiboadmin 

=> cho xiboadmin quyền sudo

Add/remove license bằng CLI - 2

Thực hiện xóa lic Teams Ent, thay bằng Teams Ess:

#Connect-MgGraph -Scopes User.ReadWrite.All

# User
$userId = "user@domain.com"

# SKU ID
$teamsEss = "3ab6abff-666f-4424-bfb7-f0bc274ec7bc"   # Teams Essentials
$teamsEnt = "7e31c0d9-9551-471d-836f-32ee72be4a01"   # Teams Enterprise

# Remove Teams Ent + Add Teams Ess
Set-MgUserLicense -UserId $userId `
    -AddLicenses @(@{SkuId = $teamsEss}) `
    -RemoveLicenses @($teamsEnt)

Write-Output "Removed Teams Ent, Added Teams Ess"

Patch 60 cam cho nas xpenology

 
cài xong, bật SSH, ssh vào nas chạy quyền root (sudo -i), rồi chạy lệnh này, chờ patch chút là xong:
 

Cho phép external user gửi all

Thực hiện các bước:

- Invite external user làm guest

- Vào azure portal đổi type từ guest thành member

- Chờ cập nhật

- Add user đó vào danh sách cho phép gửi all 

Add hàng loạt member vào Distribution group trên MS 365

Owner tự quản lý member theo link:

Exchange admin center 

Add hàng loạt member vào Distribution List group trên MS 365

Áp dụng cho cả mail-enabled security group (cloud only) - không sử dụng được cho group sync từ AD on-premise lên

Nâng cấp PowerShell lên bản mới ( PowerShell 7)nếu vẫn đang ở 5.1: mở PS, chạy lệnh:

winget install --id Microsoft.PowerShell

Nếu làm việc nhiều dòng, đổi sang Visual Studio Code

winget install --id Microsoft.VisualStudioCode

Cài xong vào Extension => tìm PowerShell và cài thêm

Add hàng loạt member vào group Microsoft 365

Owner quản lý member tại link:

https://myaccount.microsoft.com/groups/groups-i-own 

Chú ý với group Microsoft 365: không add được group khác làm member, chỉ có add user.

Add hàng loạt member vào group Microsoft 365

Cài Graph và import module dành cho Group: 

Install-Module Microsoft.Graph -Scope CurrentUser -ForceImport-Module Microsoft.Graph.Groups 

Connect tới Graph:

Connect-MgGraph -Scopes "Group.ReadWrite.All","User.Read.All"

Kiểm tra các module khả dụng :

VM mới từ Rocky template

Tạo VM mới từ template Rocky đã có Mở Gitlab > Build > Pipelines > bấm [New Pipeline] Chọn PLAYBOOK: new_server, LIMIT: VM name ...