Accéder au contenu principal

Articles

Send email alert if Reboot or shutdown a Server with Powershell

Articles récents

Monitor a server hard drives with Powershell

Monitor a server hard drives with Powershell Script  This script is used to monitor the disk space of a server and to send an alert email when the remaining disk space reaches the limit set by the administrator. Github Link :  https://github.com/ChrisMogis/MonitoringFreeHardDriveSpace/blob/main/FreeSpaceHardDrive.ps1 #Function create Log folder     Function CreateLogsFolder {     If (!( Test-Path C:\Logs))     {     New-Item -Force -Path "C:\Logs\" -ItemType Directory } else {     Write-Host "This folder " C:\Logs\ " already exists !"     } } #Create Log Folder     CreateLogsFolder #Declaration of script variables $Client = "Client Name" $ListDisk = Get-CimInstance -Class Win32_LogicalDisk $Server = (Get-CimInstance -ClassName Win32_ComputerSystem).Name $SetMinSizeLimit = 600 GB; $LogPath = "C:\Logs\CheckHardDriveFreeSpace.log" $Date = Get-Date #Scan Free Hard Drive Space  Foreach ( $Disk in $ListDisk )     {