This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Active Directory Domain Services (AD DS) Health and User Reports. | |
.DESCRIPTION | |
This script performs various AD DS health checks, DNS diagnostics, replication status checks, | |
and extracts domain admin and password expiry reports. | |
.PARAMETER LogPath | |
Directory to store log and report files (default: C:\ADDS_Checks). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Tracks system shutdown and reboot events. | |
.DESCRIPTION | |
This script retrieves event ID 1074 from the System log to identify shutdown and reboot events. | |
It can generate reports for a single server or multiple servers. | |
.PARAMETER Computer | |
The target computer name (default: local computer). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Retrieves logon and logoff events from a local or remote computer. | |
.DESCRIPTION | |
This script queries the Windows Event Log for logon (7001) and logoff (7002) events. | |
The results are sorted in descending order by date and displayed in a table. | |
.PARAMETER Computer | |
The target computer name (Default: Local computer). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Get all home directories from /etc/passwd | |
HOMEDIRS=$(awk -F: '$6 !~ /^$/ {print $6}' /etc/passwd | sort -u) | |
# Loop through each home directory | |
for dir in $HOMEDIRS; do | |
MAILDIR="$dir/Maildir" | |
# Check if the Maildir exists |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# =========================== | |
# Service Configuration | |
# =========================== | |
# Format: "<Service Name>;<Check Command>;<Expected String>" | |
SERVICES=( | |
"apache;apachectl configtest;Syntax OK" | |
#"haproxy;haproxy -c -f /etc/haproxy/haproxy.cfg;Configuration file is valid" | |
"nginx;nginx -t;syntax is ok" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Configuration: Define recipients (space-separated emails) | |
RECIPIENTS="[email protected]" | |
# Constants | |
DASHES="##############################" | |
# Function: Check for updates | |
check_updates() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Define parameters at the top | |
USERNAME="max.mustermann" # Username for which to set the password | |
USER_PASSWORD="" # Leave empty to generate a password automatically | |
EXPIRATION_MINUTES=60 # Password expiration time in minutes | |
PASSWORD_LENGTH=6 # Length of the generated password | |
USE_SPECIAL=false # Set to false to exclude special characters in the password | |
# Function to check if the user exists and provide output |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Filter parameter for the home directory | |
filter_string="home" | |
# Optional filter parameter for the user group (default is empty) | |
group_filter="users" | |
# Default dry-run flag (true) | |
dry_run=true | |
# Function to display usage information |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Parameters | |
REMOTE_PATH="/home" # Source path on the remote server | |
LOCAL_PATH="/mnt/sdb/" # Destination path on the local system "DO NOT REPEAT" destination folder | |
CERT_PATH="/root/id_rsa_root_hostname.priv.crt" # Path to the SSH certificate | |
REMOTE_SERVER="host.domain.com" # Hostname or IP address of the remote server | |
CHECK_MODE="--dry-run" # Use "--dry-run" for a dry run, leave empty for normal operation | |
# File permission options |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script to update deprecated MySQL commands in the automysqlbackup file. | |
# The automysqlbackup project can be found at: https://sourceforge.net/projects/automysqlbackup/ | |
# | |
# The following warnings have been observed when using automysqlbackup: | |
# | |
# mysqldump: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb-dump' instead | |
# mysqlshow: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb-show' instead | |
# mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead |
NewerOlder