Reserved disk space on the root partition in Linux
Các hệ thống linux sử dụng file system như ext4,ext3-2 mặc định dành ra 5% disk cho phân vùng root. Việc này nhằm đảm bảo người quản trị còn có […]
Các hệ thống linux sử dụng file system như ext4,ext3-2 mặc định dành ra 5% disk cho phân vùng root. Việc này nhằm đảm bảo người quản trị còn có […]
Umask là gì thì xem lại bài này Umask là gì Câu hỏi này nếu thi LPI sẽ bị hỏi, mình note ra đây để ghi nhớ cho bản thân. […]
Script tìm và disable các account không đăng nhập trong vòng 90 ngày trên AD
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# disableUsers.ps1 # Set msDS-LogonTimeSyncInterval (days) to a sane number. By # default lastLogonDate only replicates between DCs every 9-14 # days unless this attribute is set to a shorter interval. # Also, make sure to create the EventLog source before running, or # comment out the Write-EventLog lines if no event logging is # needed. Only needed once on each machine running this script. # New-EventLog -LogName Application -Source "DisableUsers.ps1" # Remove "-WhatIf"s before putting into production. Import-Module ActiveDirectory $inactiveDays = 90 $neverLoggedInDays = 90 $disableDaysInactive=(Get-Date).AddDays(-($inactiveDays)) $disableDaysNeverLoggedIn=(Get-Date).AddDays(-($neverLoggedInDays)) # Identify and disable users who have not logged in in x days $disableUsers1 = Get-ADUser -Filter {Enabled -eq $TRUE} -Properties lastLogonDate, whenCreated, distinguishedName | Where-Object {($_.lastLogonDate -lt $disableDaysInactive) -and ($_.lastLogonDate -ne $NULL)} $disableUsers1 | ForEach-Object { Disable-ADAccount $_ #Write-EventLog -Source "DisableUsers.ps1" -EventId 9090 -LogName Application -Message "Attempted to disable user $_ because the last login was more than $inactiveDays ago." } # Identify and disable users who were created x days ago and never logged in. $disableUsers2 = Get-ADUser -Filter {Enabled -eq $TRUE} -Properties lastLogonDate, whenCreated, distinguishedName | Where-Object {($_.whenCreated -lt $disableDaysNeverLoggedIn) -and (-not ($_.lastLogonDate -ne $NULL))} $disableUsers2 | ForEach-Object { Disable-ADAccount $_ #Write-EventLog -Source "DisableUsers.ps1" -EventId 9091 -LogName Application -Message "Attempted to disable user $_ because user has never logged in and $neverLoggedInDays days have passed." } |
1. OpenVPN là gì? OpenVPN là một phần mềm thương mại mã nguồn mở thực hiện kỹ thuật mạng riêng ảo (VPN) để tạo ra các kết nối điểm-tới-điểm hoặc […]
Trước khi đi vào phần chính, xin phép chia sẻ quá trình triển khai từ đầu con zabbix này. Hiện con cũ đang xài 5.0, được upgrade nhiều lần từ […]
Khi hiển thị biểu đồ trên zabbix, các giá trị >1000 sẽ tự quy đổi sang 1K.,2K ví dụ dung lượng ổ cứng, giá trị item là byte nhưng graph […]
Máy chủ có 500GB ổ cứng, theo nhu cầu cần mở rộng lên 1TB Máy chủ chạy centos 7 trên VMware 1, Lên VMWare, edit disk của máy chủ lên […]
Mục tiêu, cần 1 server NFS để lưu trữ dữ liệu (chủ yếu là dữ liệu ảnh từ web upload lên) Công nghệ lựa chọn là DRBD 2 node, export […]
Khi gọi http request trên ubuntu, ở đây là ubuntu 20 thì hay gặp lỗi curl: (35) error:141A318A:SSL routines:tls_process_ske_dhe:dh key too small (các ngôn ngữ khác như java, python báo […]
Một ngày đẹp trời rà soát máy chủ, hệ điều hành ubuntu 20 và thấy thư mục /var/log/journal/ to tổ chảng
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
root@mefin-ntl-rke-03:/var/log/journal/c27b494019ba448580a9cc1dce75e9c6# ll -h total 4.1G drwxr-sr-x+ 2 root systemd-journal 4.0K Apr 19 09:04 ./ drwxr-sr-x+ 3 root systemd-journal 4.0K Dec 25 03:57 ../ -rw-r-----+ 1 root systemd-journal 32M Apr 19 20:13 system.journal root@mefin-ntl-rke-03:/var/log/journal/c27b494019ba448580a9cc1dce75e9c6# |
Những log này do systemd sinh ra, có thể […]