Skip to content

Instantly share code, notes, and snippets.

View Jackbennett's full-sized avatar

Jack Jackbennett

View GitHub Profile
@Jackbennett
Jackbennett / scan AD computers.ps1
Created September 26, 2017 13:20 — forked from anonymous/scan AD computers.ps1
Improve the run performance of this script.
# Get All PCs in Domain, Export to ServerList.txt
# Call get-inventory.ps1 logic on created Serverlist.txt
# dk / 22.09.2017
import-module activedirectory
$domain = "carpentier.local"
$tempfile = "c:\temp\tmpfile.csv"
$outfile = "c:\temp\Serverlist.csv"
Get-ADComputer -Filter * |
select-object Name |
@Jackbennett
Jackbennett / Remove.ps1
Last active February 7, 2017 10:55 — forked from anonymous/Remove.ps1
#Remove-MailQueueObjects.ps1
Param(
$Path = "D:\tst",
$pattern = "TextString",
$filter = "*.eml"
}
Get-ChildItem -Recurse -Path $Path -File -Filter $filter |
where {
get-content $psitem.fullname -ReadCount 0 |