Happy Admin Tools
Easy ping with timestamp, log, email notifications, etc.
.\pinger.ps1 -destination ip_or_name [-wait count] [-alarm] [-email] [-help]
Options | Explanation | Default value |
---|---|---|
-destination | Destination to ping | |
-wait count | Wait between pings in seconds | 1 |
-log | Write to CSV log file (to %TEMP%) | False |
-alarm | If -log is enabled than save log file and create new at HH:mm (one per day). Syntax: 08:05 or 8:05 | False |
Send email with log file at alarm time (-log and -alarm must be enabled) | False | |
-help | Help screen. No options at all to have the same. | False |
Keyboard shortcut | Explanation |
---|---|
D |
Destination |
H |
Help |
P |
Pause |
S |
Statistics |
W |
Wait time between pings |
Ctrl + C or Q |
Quit |
You can use ready oui.txt
from this repository or make your own fresh OUI (Organizationally Unique Identifier) text file with Notepad++ for hash table:
-
Open
oui_macro.txt
and copy/paste all from it to%AppData%\Notepad++\shortcuts.xml
-
Open downloaded
oui.csv
in Notepad++. You see somethig like this:... MA-L,94DC4E,"AEV, spol. s r. o.",Jozky Silneho 2783/9 Kromeriz CZ 76701 MA-L,1442FC,Texas Instruments,12500 TI Blvd Dallas TX US 75243 ...
-
Run from "Macro" menu "oui_macro"
-
After it you will see:
... 94DC4E=AEV 1442FC=Texas Instruments ...
-
Delete strange dublicates (delete and leave only one):
- 080030
- 0001C8
-
Save file as
oui.txt
-
Example of using on Powershell
$oui = Get-Content -raw .\oui.txt | ConvertFrom-StringData $MAC=("cc-b1-1a-5b-c1-b9").ToUpper() $vendor = $oui[$MAC.replace(':', '').replace('-', '')[0..5] -join ''] Remove-Variable $oui $vendor Samsung Electronics Co.
-
Macro actions
Replace every pair of lines (set radio button 'Regular expression') MA-L, <nothing!> ([0-9a-fA-F]{6},)("(.*?)")((,".*")|(.*)) \1\2 ^([0-9a-fA-F]{6}), "\1", ^("[0-9a-fA-F]{6}",)(.*?)$ \1\2" ^("[0-9a-fA-F]{6}",)([^"](.*?))$ \1"\2 "," = " <nothing!> ^(.*=[^,]*)(.*) \1
Wake-on-LAN
.\wol.ps1 -mac mac_address [-ip ip_address] [-help]
Options | Explanation | Default value |
---|---|---|
-mac | MAC address to wake up | |
-ip | IP address to check ping after wake up | |
-help | Help screen. No options at all to have the same. | False |
Copy files from one directory (with other directories) to only one.
.\copy_folders_to_one.ps1 -source source_path -destination destination_path [-include extention(s)] [-realname] [-help]
Options | Explanation | Default value |
---|---|---|
-source | Source path | |
-destination | Destination path | |
-include | Copy only file with this extension(s) | |
-realname | Didn't rename filenames | False |
-help | Help screen. No options at all to have the same. | False |
Date-time converter
Convert "26 апреля 2022 г. 9:29:42"
to "20220426_092942"