This file contains 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 | |
Gets a list of Computer Objects in the supplied domain, including if they're online (pingable). | |
.DESCRIPTION | |
This script uses the ActiveDirectory module to get a list of all computer objects (optionally filtered). | |
It will also add an Online boolean attribute showing if the Computer is pingable or not. | |
.PARAMETER Domain | |
A String specifying the domain you'd like to audit | |
.PARAMETER Filter | |
A standard Filter to reduce the Computer Objects returned. By default all Computers object will be returned/ |
This file contains 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 | |
Finds and removes file duplicates from the Downloads folder | |
.DESCRIPTION | |
Single .ps1 to clean up files stored in Downloads. It removes items opens to view (e.g. JPG and PDF) and Clears Duplicates. Based on Winston McMiller Duplicate File Finder and Remover | |
.PARAMETER DownloadPath | |
Specifies the folder used to store Chrome's Downloads. Default: %USERPROFIKE%\Downloads |
This file contains 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 | |
Tests the connection to the supplied host or IP and reports back on changes to its status. | |
.DESCRIPTION | |
This script will check the connection to the supplied hostname or IP address every 5 second's to | |
monitor its status. If the status changes, a message is recorded, the Eventlog is update (optional), and an email is sent | |
to a supplied email address (optional). | |
If a TCPPort parameter is suppied the script will attempt to connect to this port. Otherwise a simple ICMP Ping is used. |
This file contains 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 | |
Scans for RAW drives attached to the computer and formats them. | |
.DESCRIPTION | |
Drive Letters are assigned sequentially from D:\ on, except on computers with SQL in the Computername where | |
Drive 2 will become L drive for Logs. Subsequent drives are lettered sequentially. | |
.PARAMETER UnitSize | |
An Int specifying the AllocationUnitSize used when formatting | |
.PARAMETER FileSystem | |
Specifies the file system with which to format the volume. The acceptable values for this parameter are:NTFS, |
This file contains 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
'Powershell OneLiner to encrypt a password to file: | |
' ConvertTo-SecureString -String "ThisIsMySecurePassword" -AsPlainText -Force | ConvertFrom-SecureString > .\Password.txt | |
'Powershell OneLiner to decrypt that password | |
' (New-Object PSCredential "user",(ConvertTo-SecureString (Get-Content .\Password.txt))).GetNetworkCredential().Password | |
'You could then embed this into VBScript so the password is not stored in the script | |
'powershell.exe -NonInteractive -NoLogo -Command "(New-Object PSCredential 'user',(ConvertTo-SecureString (Get-Content .\Desktop\Password.txt))).GetNetworkCredential().Password" | |
Set oShell = WScript.CreateObject("WScript.Shell") |
This file contains 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 | |
Crawls evtx files and gathers events based on predefined searches. | |
.DESCRIPTION | |
This script uses LogParser 2.2 from Microsoft to to build a list of logon events. | |
Supply a path to EventPath which contains the evtx files you'd like to scan. You'll want to grab Security.evtx from | |
C:\Windows\System32\WinEvt\Logs on all servers to scan. | |
.PARAMETER LogParserLocation | |
The full path to logparser.exe |
This file contains 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 | |
Gathers the Security.evtx files from each DC in your Forest | |
.DESCRIPTION | |
This script will query your forest for a list of all Domain Controllers. It'll then connect to the C$ share on each server and | |
get a copy of Security.evtx from C:\Windows\System32\Winevt\Logs\. These will then be output to the folder supplied as OutputFolder | |
.PARAMETER OutputFolder | |
Required - The folder where the evtx files should be collected. | |
.EXAMPLE | |
./Get-DCSecurityLogs.ps1 E:\LogFiles\ |
This file contains 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
[CmdletBinding()] | |
param() | |
#Main Variables adjusted | |
$Dest = "F:\" | |
$LogFile = "C:\Admin\RobocopyBackup.log" | |
$ReportTo = @("admin1@Company.co.nz","admin2@Company.co.nz") | |
$LogSummary = "" | |
$Region = "Auckland" |
This file contains 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 | |
Uses information from NZ Government to identify if a date is a New Zealand public holiday. | |
.DESCRIPTION | |
This script pulls the lastest iCal from employment.govt.nz to confirm if a date is a public holiday. | |
If a public holiday is found, it's name is returned. | |
There is an assumption that the holidays supplied are single day events. | |
.PARAMETER Date | |
The date to be checked. |
This file contains 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 | |
if ! [[ "$1" =~ ^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$ ]] | |
then | |
echo "Email address $1 is invalid." | |
exit 1 | |
fi | |
npm=`npm list -g --depth=0 | sed 's/$/<br \/>/'` | |
config=`cat /var/homebridge/config.json | sed 's/$/<br \/>/'` |
OlderNewer