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
object-group network Guest_Access_Printers | |
range 10.0.50.51 10.0.50.61 | |
host 10.0.50.90 | |
! | |
interface GigabitEthernet0/1.99 | |
encapsulation dot1Q 99 | |
ip address 172.16.0.1 255.255.0.0 | |
ip access-group Guest_Restrictions in | |
! |
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
# Name: Send-Inventory.ps1 | |
# Author: James Schlackman | |
# Last Modified: Oct 13 2018 | |
# | |
# Creates a basic hardware inventory of the current computer from WMI and emails it as a formatted HTML report. | |
# Configure your mail relay and destination email address here | |
$MailRelay = "smtp.contoso.com" | |
$FromAddress = "youraccount@contoso.com" |
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
# Name: Update-WorkstationUsers.ps1 | |
# Author: James Schlackman | |
# Last Modified: Oct 17 2018 | |
# | |
# Updates a given AD group with a list of users who have been assigned to a workstation via the computer account's managedBy attribute | |
# Group to update | |
$userGroup = "CN=Workstation Users,OU=Mail Groups,DC=contoso,DC=com" | |
# Get all users assigned to an active computer via the computer account's managedBy attribute |
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
# Name: ProvisionedApps-Remediation.ps1 | |
# Author: James Schlackman | |
# Last Modified: Nov 05 2018 | |
# | |
# Check for the presence of unwanted provisioned apps and removes them from the current system image if found. | |
# | |
# This does NOT remove them for any current user who has already logged in, since provisioned apps | |
# are installed again at the user-level at first login. This will only prevent them from appearing | |
# for new users. |
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
# Name: Set-netbootGUID.ps1 | |
# Author: James Schlackman | |
# Last Modified: Nov 04 2018 | |
# | |
# Sets the netbootGUID attribute for computers in AD, for use with Windows Deployment Server. | |
# Reads a CSV and adds a netbootGUID to existing computers where the attribute is blank. | |
# | |
# For computer names that appear in the CSV but are not present in AD, a Computer object is | |
# prestaged so WDS can auto-name new computers with a matching MAC address. |
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
# Name: Convert-GeforceOverlayScreenshots.ps1 | |
# Author: James Schlackman | |
# Last Modified: Nov 20 2018 | |
# | |
# Looks for PNG files in subfolders of the output folder used by GeForce Overlay, saves them | |
# as JPEG files in the user's Screenshots folder (in subfolders by game name) and then moves | |
# the PNG files to the Recycle Bin. | |
$overlayFolder = "$([environment]::GetFolderPath("MyVideos"))\Captures" | |
$screenshotFolder = "$([environment]::GetFolderPath("MyPictures"))\Screenshots" |
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
# Retrieves the first MX record for a given email address (usually the one with the lowest preference number in DNS) | |
function Get-MailAddressMx { | |
[cmdletbinding()] | |
param([Parameter(Mandatory=$true, ValueFromPipeline=$true)] [string]$MailAddress) | |
process{ | |
$mailDomain = $MailAddress.Substring($MailAddress.IndexOf('@') + 1) | |
If ($mailDomain) { | |
$mailMx = Resolve-DnsName -Type MX -Name $mailDomain | |
If ($mailMx) { |
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
# Name: Config-SystemRestore.ps1 | |
# Author: James Schlackman | |
# Last Modified: May 1 2018 | |
# | |
# Checks if System Restore is enabled for the system drive (normally C:). If not, turn it on. | |
# Also ensures the usage quota for system restore points is set to at least 5% of disk space (minimum 10GB). | |
$RegPath = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SPP\Clients' | |
$SysDrive = (Get-Volume | Where-Object {$_.DriveLetter -eq "$($env:SystemDrive[0])"}) |
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
# Name: Email-DormantAccountDetails.ps1 | |
# Author: James Schlackman | |
# Last Modified: June 4 2020 | |
# Looks for enabled AD accounts that meet one of the following criteria: | |
# - Last used more than x days ago | |
# - Created more than x days ago and have never been used | |
# - Account expired date has passed | |
# | |
# Emails an HTML report of any accounts found to a specified address. |
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
# Name: Get-ADAccessDetails.ps1 | |
# Author: James Schlackman | |
# Last Modified: May 4 2023 | |
# | |
# Audits all enabled users in specified OUs and outputs the date they last logged in, when they last changed | |
# their password, when their password expires, and whether they are a member of any AD administrator groups. | |
$checkOUs = "OU=People,DC=contoso,DC=com","OU=Robots,DC=contoso,DC=com" | |
$AuditUsers = @() |