Ps-scripts

Collection of some handy scripts.


Project maintained by rahulduggal18 Hosted on GitHub Pages — Theme by mattgraham

PS-Scripts

Collection of multiple scripts, utilities and tools under one directory.

1. SystemInventory

A Power Shell script/tool that collects critical info about servers and emails the report.

The following information is gathered :

The initial source of the script is https://www.simple-talk.com/content/article.aspx?article=1459.

However, this script is optimised using PowerShell remoting , so it gives very good performance. Also, it has Error Handling and some other features.

Future Features (Please Contribute)

Usage

Help

Get-Help .\SystemsReport.ps1 -Full

Help

Create a file having the list of servers of which report needs to be generated. Enter one server name in one line. See Example file : ServerNames.txt .\SystemsReport.ps1 -ConfigPath .\ServerNames.txt

Also, set the following variables as per environment :

#region Variables and Arguments
$fromemail = "youremail@yourcompany.com"
$users = "boss@company.com" # List of users to email this report to (separate by comma)
$server = "yourmailserver.yourcompany.com" #enter SMTP server DNS name / IP address here

$computers = Get-Content $ConfigPath #grab the names of the servers/computers to check from the config file

# Alternatively, set below variable
<b># $Computers = "Server1", "Server2"</b>

# Set free disk space threshold below in percent (default at 20%)
$thresholdspace = 20
[int]$ProccessNumToFetch = 10
$ListOfAttachments = @()
$Report = @()
$CurrentTime = Get-Date
#endregion