NEW: Run as Automate Script, Report sent directly to Client Teams Maintenance Channel
- Runs Server Maintenance against list of servers
- args:
- listpath - location of servers.txt (default path: 'c:\ksmc\scripts')
- DeployPSCore - Deploys PowerShellCore:latest before running maint
- run as administrator
- args:
- Downloads updated copy of ServerMaint.ps1 from GitHub and copies to target machines, runs on each machine
- Copies Maintenance Reports back to server you run it on, creates master report
- Runs maintenance functions against each server
- Outputs report as .txt
- Exports Event Logs and Clears
- Current Supported Functions:
- Get-HWInfo
- Returns Phys/VM, Serial, Activation, Hardware Make/Model
- Get-NetInfo
- Returns Network Adapters- IPs, MAC Addr
- Get-NetPortInfo
- Returns Established, Listening, and Open ports
- Get-EventArchive
- Archives and Clears Event Logs from 'System', 'Application', and 'Security'
- Get-FailedLogons
- Checks current exported 'Security' Log for Failed Logons and returns Source Address, UserName, Time, and Failure Reason
- Get-EvtLogsSummary
- Checks current exported 'Application' and 'System' logs, returns log stats and summary
- Get-SchTasks
- Pulls scheduled tasks and returns status
- Get-NTPConfig
- Returns results of 'w32tm /query /status'
- Get-Certs
- Pulls certs from LocalMachine store and checks for any expiring in next 30 days
- Get-SrvUptime
- Returns uptime
- Get-PSVersion
- Pulls and returns PSVersion
- Get-DiskInfo
- Pulls disks, returns free space stats and frag status
- Get-AV
- Returns AV status depending on OS
- Not supported on all Server OS older than 2016
- Works best on Workstations
- Get-Roles
- Returns installed Server Roles, checks for specific roles and returns if installed (ADDS,DHCP,DNS,Print-Server,SMTP-Server)
- Start-ADMaint
- Pulls down latest copy of ADMaint.ps1 from GitHub and runs maint against PDCe
- Start-Maintenance
- Runs all functions and assembles report
- Get-HWInfo
- Runs AD Maintenance info gathering
- Get-ForestInfo
- Returns Forest,Domains,FSMO Holders,Sites,GCs
- Get-FRSState
- Returns if sysvol is replicating using 'FRS' or 'DFSR'
- Get-Users
- Audits users for accounts that have:
- Never logged-in
- Not logged-in in over 30 days
- Password is expired
- Password set to never expire
- Disabled Accounts
- Audits users for accounts that have:
- Get-Computers
- Audits computers for accounts that have:
- Never Logged-in
- Not logged-in in over 30 days
- Disabled Accounts
- Audits computers for accounts that have:
- Get-ReplStatus
- Returns results of:
- repadmin /replsummary
- repadmin /queue
- repadmin /showrepl
- Returns results of:
- Get-DCDiag
- Returns results of 'dcdiag /q'
- Start-ADMaint
- Runs all functions and creates report
- Get-ForestInfo
- Navigate to Client Servers in Automate Control Center or Web Client. Select Server(s) to run against
- Run Script under "Maintenance > Monthly Server Maintenance"
- Report will be emailed to email address of tech that initiated script, as well as Client's 'Maintenance' channel in Teams
- Download copy of "Run-ServMaint.ps1" to management machine -> put in "c:\ksmc\scripts"
- Create "servers.txt" in "c:\ksmc\scripts" on management machine, list all hostnames in the file, one on each line
- Run "Run-ServMaint.ps1" as admin
- easiest method - open Powershell ISE as admin
- browse and open script
- Output will report when scripts finshes
- Logs save to "c:\ksmc\scripts\maint\logs"
- Reports save to "c:\ksmc\scripts\maint\reports"
- "master-report-all" will be combination all reports from this run