Skip to content

Instantly share code, notes, and snippets.

@theagreeablecow
theagreeablecow / Get-PasswordGenerator.ps1
Last active August 29, 2015 14:05
Creates random passwords of varying complexity from ASCII table of characters or phrases from random words selected from on posts on Reddit
<#
.NAME
Get-PasswordGenerator.ps1
.DESCRIPTION
Creates random passwords of varying complexity from ASCII table of characters
or phrases from random words selected from on posts on Reddit
Ref: http://www.asciitable.com/ & http://www.reddit.com
@theagreeablecow
theagreeablecow / SetupPrinters.hta
Created May 26, 2012 07:28
Network Printers App
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<!-- Printer Installation -->
<title>Printers App</title>
<HTA:APPLICATION ID="PrintHta"
@theagreeablecow
theagreeablecow / PsListKill.vbs
Created May 28, 2012 03:45
Process List and Kill
' Produces list of process info from a remote computer. Optionally kill a running process based on PID.
' Requires PsList and PsKill from PsTools http://technet.microsoft.com/en-us/sysinternals/bb896649.aspx
' TheAgreeableCow 2012
dim objShell : Set objShell = WScript.CreateObject ("WScript.shell")
dim fileSys : Set fileSys = CreateObject("Scripting.FileSystemObject")
dim strComputer, strCMD, strLog, intAnswer, strProcess, strBatchFile, strDate
strComputer = InputBox("Enter name of Server/PC to capture process list")
@theagreeablecow
theagreeablecow / logparameters.ps1
Created June 2, 2012 02:27
Event log Parameters
ForEach ($LogEntry in $EventLog)
{
$entry = [xml]$LogEntry.ToXml()
$docName = $entry.Event.UserData.DocumentPrinted.Param2
}
@theagreeablecow
theagreeablecow / filterxml.ps1
Created June 2, 2012 02:23
Event Log XML Filter
$filterxml = '<QueryList>
<Query Id="0" Path="Microsoft-Windows-PrintService/Operational">
<Select Path="Microsoft-Windows-PrintService/Operational">*[System[(EventID=307)]]</Select>
</Query>
</QueryList>'
$EventLog = Get-WinEvent -Filterxml $filterXml
@theagreeablecow
theagreeablecow / Lync_GetUnassignedNumbers.ps1
Created June 6, 2012 05:09
Get Unassigned Numbers in Lync 2010
<#
.SYNOPSIS
Find assigned or unassigned numbers in Lync
.DESCRIPTION
This script uses uses the 'Unassigned Number' ranges in Lync to look number usage, including:
- User numbers (including Private Number)
- Analogue Devices
- Common Area Phones
- AutoAttendant numbers
@theagreeablecow
theagreeablecow / MultiRobocopy.vbs
Created June 6, 2012 11:31
Multiple Robocopy Streams
Option Explicit
On Error Resume Next
Dim Source1, Source2, Source3, Destination1, Destination2, Destination3, BatchFile1, BatchFile2, BatchFile3
'******************************************
'Root Source folders to parse
Source1 = "\\server1\c$\folder1"
Source2 = "\\server1\share1"
Source3 = "\\server1\share2"
@theagreeablecow
theagreeablecow / lyncClients.sql
Created June 8, 2012 03:19
Lync Client Discovery
declare @user varchar(20)
set @user = ''
declare @ClientVer varchar(100)
set @ClientVer = ''
declare @server varchar(10)
@theagreeablecow
theagreeablecow / PasswordExpiryReport.ps1
Created June 13, 2012 12:17
Password Expiry Email Report
<#
.SYNOPSIS
Reports on Users whose passwords are about to expire
.NOTES
Requires Quest.ActiveRoles.ADManagementsnapin to get the AD attributes.
.LINK
http://www.theagreeablecow.com/2012/06/preventing-password-expirations-with.html
#>
# --------------------------------------------------
@theagreeablecow
theagreeablecow / DepartingUser.ps1
Created May 26, 2012 00:55
Disable a user is AD, Exchange and Lync
# This script manages the process for a departing user, using data retrived from a CSV file
# Requires the Active Directory module for Windows Powershell and appropriate credentials
# CSV file with corresponding header and user(s) info:
# UserName,DisableWindows,ArchiveFiles,DisableVoice,ArchiveMailbox,MailboxAccessTo,DisableEmailAddress,AutoReplyContact,ReminderInDays
#LOAD POWERSHELL SESSIONS
#------------------------