This file contains hidden or 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-ExpiringPasswords.ps1 | |
# Author: James Schlackman | |
# Last Modified: Sep 28 2017 | |
# | |
# Checks all enables users in a given OU to see if their password is going to expire during | |
# a given date range. Exports a list of those affected. | |
# Useful for finding out who to remind about changing their password before long vacations. | |
# | |
Import-Module ActiveDirectory |
This file contains hidden or 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-VulnerablePasswords.ps1 | |
# Author: James Schlackman | |
# Last Modified: Sep 28 2017 | |
# | |
# Checks a CSV of breached email addresses (e.g. from https://haveibeenpwned.com/) and checks if there | |
# is an enabled user in AD with a matching email address and password that is older than the reported date | |
# of the breach. | |
# | |
Import-Module ActiveDirectory |
This file contains hidden or 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
# Sync-GSuite2SV-Users.ps1 | |
# ----------------------- | |
# Syncs the list of users currently enrolled in 2-step verification in G Suite with an AD group. | |
# Reading the user list from G Suite requires a working install of the GAM tool (https://github.com/jay0lee/GAM) | |
# User account used to run script must have write acess to the folder contianing g | |
# | |
# Author: James Schlackman | |
# | |
# V1.1 - 2017-10-30 - Write last sync time to group for diagnostics | |
# V1.0 - 2017-10-11 - First version |
This file contains hidden or 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: Create-BulkRandomPasswords.ps1 | |
# Author: James Schlackman | |
# Last Modified: Nov 11 2017 | |
# | |
# Creates a text file containing a bulk number of passwords made up of a specified length of random | |
# alphanumerics and special characters. | |
$PassLength = 16 | |
$NumPasswords = 253 | |
$OutputPath = "BulkRandomPasswords.txt" |
This file contains hidden or 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
# Disable 'Automatically detect proxy settings' in Internet Explorer. | |
# Read connection settings from Internet Explorer. | |
$regKeyPath = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\" | |
$conSet = $(Get-ItemProperty $regKeyPath).DefaultConnectionSettings | |
# Index into DefaultConnectionSettings where the relevant flag resides. | |
$flagIndex = 8 | |
# Bit inside the relevant flag which indicates whether or not to enable automatically detect proxy settings. |
This file contains hidden or 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
New-ADSyncRule ` | |
-Name 'In from AD - Use msDS-cloudExtensionAttribute1 instead of msExchHideFromAddressLists' ` | |
-Identifier '57244c63-9b0d-45bc-a107-3a35b427037d' ` | |
-Description 'Check msDS-cloudExtensionAttribute1 attribute for the word "hidden" and use that to set msExchHideFromAddressLists, since the msExchHideFromAddressLists is not present in AD' ` | |
-Direction 'Inbound' ` | |
-Precedence 50 ` | |
-PrecedenceAfter '00000000-0000-0000-0000-000000000000' ` | |
-PrecedenceBefore '00000000-0000-0000-0000-000000000000' ` | |
-SourceObjectType 'user' ` | |
-TargetObjectType 'person' ` |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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. |
OlderNewer