Posts

Showing posts with the label PowerShell

A Systems Engineer’s Tale: Simplifying Remote Commands with PowerShell

A Systems Engineer’s Tale: Simplifying Remote Commands with PowerShell As a systems engineer, one of your daily challenges is running commands across a network of machines. Maybe it’s updating Group Policy with gpupdate /force , restarting a service, or pushing out a quick configuration tweak. Whatever the task, the prospect of executing it one machine at a time can make your to-do list feel insurmountable. Enter PowerShell, the Swiss Army knife for IT professionals. With the right script, you can execute commands remotely across all systems in your network with ease. Today, let’s explore how to take a task like updating Group Policy—or any other repetitive command—and turn it into a quick, automated process. The Problem: Running Commands on Multiple Systems Suppose you’ve been asked to ensure all systems in your network update their Group Policy settings immediately. This means executing gpupdate /force on every machine, from desktops to servers. Doing this manu...

Clearing the Group Policy Cache

Clearing the Group Policy Cache When troubleshooting Group Policy issues, especially on Windows machines, clearing the Group Policy cache can often resolve inconsistencies or errors that occur when applying new policies. This article will guide you through manually clearing the Group Policy cache using PowerShell. Why Clear the Group Policy Cache? Group Policy objects (GPOs) are stored locally in the cache, and at times, corruption or outdated information may linger. By clearing this cache, you force the system to retrieve fresh copies of GPOs from the domain controllers. Common reasons for clearing the cache include: Group Policy not applying correctly. GPO changes not reflecting after updates. Errors indicating corrupted policy files. The Location of Group Policy Files The Group Policy settings on a Windows machine are stored in the following directories: C:\Windows\System32\GroupPolicy This folder contains the cached policies that are applied to the ...

Invoke-Reprofile

Image
Invoke-Reprofile Fix Corrupted User's Profiles with PowerShell By Michael J. Thomas Troubleshooting a user's profile is sometimes hard to pin point out where the problem is and that is why a lot of us techs will use the technique of re-profiling the user's profile and copying just their data back. To do this process of re-profiling a user manually, I will demonstrate this process with a user account named Ed. I would do the following steps to fix his corrupted profile: Logoff Ed Login with an Admin Account Rename C:\Users\Ed to C:\Users\Ed.old  Edit the Registry HKLM:\Software\Microsoft\Windows NT\CurrentVersion\ProfileListNow\SID and find Ed's SID and rename it to the SID.old.  Logoff Admin Account Login Ed to Create a New Profile for him. Copy Ed's Data from Ed.Old Folder to his New User Profile. I automated the process by creating a PowerShell Script that can fix it remotely. The script renames the user's profile to user.old, backups the...

Invoke-Speak

Image
Invoke-Speak Speak with Microsoft Speech using PowerShell by Michael J. Thomas So, it's time again for a cool little script that you can use and have some fun with your co-workers. Warning, using this code  inappropriately can lead to disciplinary actions by your employer.  Code Wisely my Friends Download Script from GitHub <# .Synopsis    Invoke-Speak    Created by Michael J. Thomas    Date:    06/15/2019    Updated: 06/15/2019 .DESCRIPTION     Invoke-Speak allows you to speak to a remote computer with Microsoft Speach     Invoke-Speak -Words $Words -ComputerName $Computers -Speed (-10 to 10) Slow to Fast     Default Speed is 2.      .EXAMPLE    Invoke-Speak "Hello World!"    Invoke-Speak "Hello World! -ComputerName "Computer01", "Computer02" -Speed 2 #> function Invoke-Spea k { [cmdLetBinding()] Param( [str...