Category: PowerShell5.1

  • PS ISE PROFILE

  • Step-by-Step Guide to Troubleshooting Windows Server 2016 Active Directory Replication Issues

    Step-by-Step Guide to Troubleshooting Windows Server 2016 Active Directory Replication Issues

    To force replication, run the command:    repadmin /syncall /e /d /A /P

  • THANK YOU KEVIN BROWN

    THANK YOU KEVIN BROWN

    http://rtsnetworking/demo Kevin is the consummate professional Windows, Azure, AWS, Cisco, Security Instructor!WOW have we learned allot from him! -Patrick and Ryan Burwell

  • Microsoft: Standardize PS Modules Development By Using Versioned Sub-Folders

    Microsoft: Standardize PS Modules Development By Using Versioned Sub-Folders

    This strategy could be instrumental in fostering a more modular and resilient PowerShell ecosystem.

  • PowerShell Module Bloat

    PowerShell Module Bloat

    #PLEASE GOD, Microsoft, USE STANDARDS in your PowerShell module development ..

  • Find Password Change Source

    Find Password Change Source

    CoPIlot suggests these changes: Centralized error handling Instead of inline try/catch with Write-Warning, capture failures into a structured object so you can see which DCs failed and why. Timeouts and fallbacks Get-WinEvent can hang if RPC is flaky. Use Invoke-Command with -AsJob or Parallel to query DCs concurrently, with a timeout per job. That way…

  • Remote PWSH Session with PSEXEC64

    Remote PWSH Session with PSEXEC64

    You have installed PWSH (PS7) and have the path. You try to ‘enter-pssession’ and that’s when discover a remote session with PWSH shell will not work without being set native on the server operating system. But you can always use a remote PWSH session using PSEXEC64.

  • Upgrade to PWSH Without Being Destructive (even for DCs)

    Upgrade to PWSH Without Being Destructive (even for DCs)

  • Upgrade Windows 11 at Home

    Upgrade Windows 11 at Home

  • Update and Restart System

    Update and Restart System

    Something I was playing with to ensure my system updates every day, so I run this at the end of the day…

  • Enable AD RDC Rules on Domain Controllers

    Enable AD RDC Rules on Domain Controllers

  • GPOs: List-GPOs-EnabledandLinked-AndBackup

    GPOs: List-GPOs-EnabledandLinked-AndBackup

    How to backup the Group Policies you are actually using

  • Easy(er) Windows 11 Upgrade

    Easy(er) Windows 11 Upgrade

    1. Install kb50626912. Reboot3. Run Windows11InstallationAssistant.exe If you get a TPM error you need a new system

  • Install PowerCli from PS 5.1 Shell

    ‘Install-PowerCLI-2.ps1’#Install DOTNet Framework 4.7.2 first#Get DotNet Framework Install here and put in $ENV:USERPROFILE\downloads#”https://support.microsoft.com/en-us/topic/microsoft-net-framework-4-7-2-offline-installer-for-windows-05a72734-2127-a15d-50cf-daf56d5faec2″$url = “https://go.microsoft.com/fwlink/?linkid=863265″$output = “$ENV:UserProfile\Downloads\dotnet-framework-installer.exe” Invoke-WebRequest -Uri $url -OutFile $output #>. $ENV:USERPROFILE\downloads\\NDP472-KB4054530-x86-x64-AllOS-ENU.exe /q /norestart’Wait for the task to finish – watch with tasklist”…and then run this”Install-module -force -Name VMware.PowerCLI -AllowClobber -SkipPublisherCheck -AcceptLicense -AllowPrerelease|Out-Null”Import-Module VMware.PowerCLI -PassThru -FORCE -Verbose|Out-null”Update-module VMware.PowerCLI -Force -Verbose -PassThru|Add-PSSnapin’

  • Step-by-Step Procedure to Analyze Group Policies

    …be careful to be confident

  • Check-WinEvents-Prompted.ps1

    Check-WinEvents-Prompted.ps1

    ‘Check-WinEvents-Prompted.ps1’ #************************************************************************************************************* # Script Name : Get-Latest-WinEvent-Prompted-DCs # Purpose : Check Latest Event log for DCs chosen # Date : #.\Get-UpdateDate.ps13:32 PM 3/13/2024 # – Initial version # Date : #.\Get-UpdateDate.ps11:12 PM 3/14/20244 # – Updated to reflect specific events, added credentials, added prompts # Author : Patrick Burwell #************************************************************************************************************* #Set location first set-location D:\PowerShell…

  • Confirm Windows Server In-place Upgrade to 2025

    From 4SysOps: Confirm Windows Server in-place upgrade to 2025 Current version Upgrade to Windows Server 2025? Windows Server 2012 ❌ No Windows Server 2012 R2 ❌ No Windows Server 2016 ✅ Yes Windows Server 2019 ✅ Yes Windows Server 2022 ✅ Yes https://4sysops.com/archives/check-the-windows-server-version-to-determine-if-an-in-place-upgrade-to-server-2025-is-supported

  • AI Automation for PowerShell

    AI Automation for PowerShell

    “You may have experimented with Microsoft’s AI Shell for PowerShell and felt that you didn’t need another chatbot. However, AI Shell isn’t a shell at all. Like many of Microsoft’s Copilots, it functions merely as a chatbot attached to your terminal, providing enhanced copy-and-paste capabilities.” “The AI Shell is compatible with Windows, macOS, and Linux. Please ensure…

  • Check-Uptime-DC-Prompt.ps1

    Check-Uptime-DC-Prompt.ps1

    Sometimes a simple script makes life easier…

  • FRS to DFSR Migration Can Be Reset!

    FRS to DFSR Migration Can Be Reset!

    The FRS migration to DFSR can be restarted, even after Eliminiated state… The simple steps to get back is to reset the DFSR Global Settings value from 48 to 0 using ADSIEdit: You then delete the entire “Migrating Sysvols” key on the DFSR services registry: Then, once every RWDC in the domain or forest isn…

  • Get-Pagefile

    Quickly get the remote pagefile of a window server

  • Log Specific IPV4 Traffic When Found

    Log Specific IPV4 Traffic When Found

  • Looper

    Looper

    Having a good looper is a great script to keep available… I wish I could remember where I got this form, but I thank you, Anony-Mouse scripter! [::mouse::]

  • Check for GPO or run GPupdate Remotely

    Check for GPO or run GPupdate Remotely

    This script does lots of things that are handy when group policy (SysVol) replication is a problem… (like an environment still using FRS) My Thanks to Microsoft’s CoPilot for the help in sorting the logic of the try-else-catch commands…

  • Reverse Ping a 255.255.254 Scope

    Reverse Ping a 255.255.254 Scope

    To quickly obtain the devices using an IPv4Address in a scope reverse ping the scope in PowerShell (5.1) ‘#’ReverseLookup-Ipv4Address-By23Range.ps1’$subnet = read-host -Prompt “What IP scope with /23 range? -leave off the last octet numbers – like this 10.228.30. “for ($i=0; $i -le 511; $i++) { $ip = $subnet + $i Resolve-DnsName -name $ip -ea SilentlyContinue|select…

  • Find and Install SSH Module

    Find and Install SSH Module

    $Module = (FIND-Module SSH).name Install-Module -Name $Module -AllowClobber -Verbose -SkipPublisherCheck -Repository PSGallery -AcceptLicense -PassThru|` Import-Module -NoClobber -DisableNameChecking -PassThru -Verbose|Update-Module -Verbose -AcceptLicense -PassThru|Get-Module

  • Remove Revoked Certificates

    Remove Revoked Certificates

    The removal of revoked certificates is not automatic…

  • Set PS 5.1 to use PS 7 PSModulePath

    Set PS 5.1 to use PS 7 PSModulePath

    …might as well prepare by using the D:\PowerShell path now with PS 5.1…

  • Set PowerShell Credential

    Set PowerShell Credential

    …you can make the script prompt you for you admin credential or you can type it in manually, or adjust from your username for more elevation

  • Update ADSS Subnets

    Update ADSS Subnets

    The real advantage of this script is the ability it gives you to update your ADSS subnets quickly #Import the Active Directory moduleImport-Module ActiveDirectory -NoClobber -DisableNameChecking -Scope Local#Import the CSV with headers$csvData = Import-Csv -Path D:\powershell\input\subnets.csv#Checks for any count and breaks if not $nullif(!($csvData.Count)){break}#Loop through each row in the CSVforeach ($row in $csvData) {#Get the…