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
# Remove the erroneous temporary flag from any GPO files on the current DC. Fixes issues listed in the DFSR diagnotic log as: | |
# | |
# "DFS Replication does not replicate certain files in the replicated folders listed above because they have temporary attribute set, or they are symbolic links." | |
Get-ChildItem "$env:SystemRoot\SYSVOL\domain\Policies" -recurse | ForEach-Object -process {if (($_.attributes -band 0x100) -eq 0x100) {$_.attributes = ($_.attributes -band 0xFEFF)}} |
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-HtmlFolderReport.ps1 | |
# Author: James Schlackman | |
# Last Modified: October 18 2023 | |
# | |
# Outputs an HTML listing of all files in a specified folder, grouped in order by subfolder | |
Param( | |
[Parameter(Mandatory)] [String] $SearchPath, | |
[Parameter()] [String] $OutputPath = "$((Get-Date).ToString("yyMMdd")) $((Get-Item -Path $SearchPath).Name).html" | |
) |
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-DirectoryAccessDetails.ps1 | |
# Author: James Schlackman | |
# Last Modified: Oct 17 2023 | |
# | |
# Audits all enabled users in specified on-prem AD OUs and combines with it with enabled users from Entra ID. | |
# Outputs a combined list showing which accounts are federated/on-prem only/cloud only along with details of | |
# the most recent date they logged in (either on-prem or cloud, whichever is later), when they last changed | |
# their password, when the account was created, and which AD admin and Entra roles they are assigned (if any). | |
# | |
# Last sign in date for Entra requires an Entra ID Premium license. |
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-AADAccessDetails.ps1 | |
# Author: James Schlackman | |
# Last Modified: May 3 2023 | |
# | |
# Audits all enabled users in Azure AD and outputs the date they last logged in, when they last changed | |
# their password, when the account was created, and which Azure AD roles they are assigned (if any). | |
# | |
# NOTE: Azure AD only began storing account creation dates in June 2018. CreatedDateTime will be blank | |
# for accounts created before that time. | |
# |
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
<?xml version="1.0" encoding="UTF-16"?> | |
<Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> | |
<RegistrationInfo> | |
<Date>2022-11-29T12:00:00</Date> | |
<Author>james@schlackman.org</Author> | |
<Description>Searches for files that were created or modified more than a certain number of days ago and creates/emails an HTML report of any results.</Description> | |
<URI>\Email Old File Details</URI> | |
</RegistrationInfo> | |
<Triggers> | |
<CalendarTrigger> |
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
# Downloads and installs the Windows 10 21H2 enablement package for machines not managed by Windows Update or WSUS. | |
# Requires Windows 10 2004, 20H2, or 21H1 | |
# https://support.microsoft.com/en-us/topic/kb5003791-update-to-windows-10-version-21h2-by-using-an-enablement-package-8bc077be-18d7-4aac-81ce-6f6dad2cd384 | |
# Check if Windows is currently running a valid build number to receive the enablement package | |
If ([Environment]::OSVersion.Version.Build -in 19041..19043) { | |
# Get OS architecture | |
$arch = If (!$env:PROCESSOR_ARCHITEW6432) {$env:PROCESSOR_ARCHITECTURE} |
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
function Save-Download { | |
<# | |
.SYNOPSIS | |
Given either the result of WebResponseObject or a Uri, will download the file to disk without having to specify a name. | |
.DESCRIPTION | |
Given either the result of WebResponseObject or a Uri, will download the file to disk without having to specify a name. | |
.PARAMETER WebResponse | |
A WebResponseObject from running an Invoke-WebRequest on a file to download. | |
.PARAMETER Uri | |
Uri of a file to download in lieu of supplying a WebResponseObject. |
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-DellAdminPwd.ps1 | |
# Author: James Schlackman | |
# Last Modified: March 31 2022 | |
# Function that uses the Dell Command Powershell Provider to set the initial admin password and | |
# prevent further BIOS changes from being made without the password being supplied. | |
# https://www.dell.com/support/home/en-us/product-support/product/command-powershell-provider/docs | |
#Requires -Modules DellBIOSProvider |
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
<?xml version="1.0" encoding="UTF-16"?> | |
<Task version="1.3" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> | |
<RegistrationInfo> | |
<Author>james@schlackman.org</Author> | |
<Description>Disable Idle Power Saving on Realtek USB Ethernet adapters to prevent random network dropouts on Dell WD-series docks</Description> | |
<URI>\Disable Idle Power Saving on Realtek USB Ethernet</URI> | |
</RegistrationInfo> | |
<Triggers> | |
<RegistrationTrigger> | |
<Enabled>true</Enabled> |
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
<?xml version="1.0" encoding="UTF-16"?> | |
<Task version="1.3" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> | |
<RegistrationInfo> | |
<Author>james@schlackman.org</Author> | |
<Description>Restarts the Network Location Awareness following an LDAP authentication failure (typically due to a DC being temporarily unavailable during an update cycle)</Description> | |
<URI>\Remediate Network Location Awareness</URI> | |
</RegistrationInfo> | |
<Triggers> | |
<EventTrigger> | |
<Enabled>true</Enabled> |