Przemyslaw Klys
Blogs, Articles, and Posts
Active Directory Health Check using Microsoft Entra Connect Health Service
(evotec.xyz)
Active Directory (AD) is crucial in managing identities and resources within an organization.
By: Przemyslaw Klys submitted:Oct 13 2023
Active Directory (AD) is crucial in managing identities and resources within an organization.
Ensuring its health is pivotal for the seamless operation of various services. Today, I decided to look at Microsoft Entra Connect Health (Azure AD Connect Health) service, which allows monitoring Azure AD Connect, ADFS, and Active Directory. This means that under a single umbrella, you can have an overview of three services health. But is it worth it?
By: Przemyslaw Klys submitted:Oct 13 2023
Advanced HTML reporting using PowerShell
(evotec.xyz)
I've been using HTML reporting in PowerShell for a while. Initially, I would usually build HTML by
By: Przemyslaw Klys submitted:Jun 16 2022
I've been using HTML reporting in PowerShell for a while. Initially, I would usually build HTML by
hand, but the time spent trying to figure out what works and what doesn't drive me mad. With the PSWriteHTML module, a lot has changed. With just a few PowerShell lines, I can create feature-rich reports that change how I show data to my Clients. Today I wanted to show you some advanced HTML reporting without actually complicating PowerShell code. In the last few months, I've added many features that create advanced reports without sacrificing readability.
By: Przemyslaw Klys submitted:Jun 16 2022
Converting Pester V4 to Pester V5 basics
(evotec.xyz)
Now that Pester V5 is out, I decided that I need to make sure that my Pester tests for all my
By: Przemyslaw Klys submitted:Jun 16 2022
Now that Pester V5 is out, I decided that I need to make sure that my Pester tests for all my
modules keep on running correctly. Some substantial changes in Pester add new features, changing some things, but that also means all the tests that you have defined most likely will need a small push to get it up and running again on Pester V5. Starting this blog post, I wanted to mention that I am by no means an expert on Pester, but I do use it for some time now for most of my projects. I am using basic functionality, but even that basic functionality stops working once you upgrade from PesterV4 to PesterV5, so I thought I would save you some time and give you a small overview of how you can quickly fix it. It works for me, but you may have to find your way to fix things.
By: Przemyslaw Klys submitted:Jun 16 2022
Difference between GetTempFileName() and GetRandomFileName() that got my ass kicked
(evotec.xyz)
Today's story is about me making assumptions on how things work based on the method's name.
By: Przemyslaw Klys submitted:Jun 16 2022
Today's story is about me making assumptions on how things work based on the method's name.
By: Przemyslaw Klys submitted:Jun 16 2022
Finding duplicate SPN with PowerShell
(evotec.xyz)
Duplicate SPNs aren't very common but can happen in any Active Directory as there's no built-in way
By: Przemyslaw Klys submitted:Jun 16 2022
Duplicate SPNs aren't very common but can happen in any Active Directory as there's no built-in way
that tracks and prevent duplicate SPN's
By: Przemyslaw Klys submitted:Jun 16 2022
Four commands to help you track down insecure LDAP Bindings before March 2020
(evotec.xyz)
In March 2020, Microsoft will release its monthly updates. With those updates, Microsoft will
By: Przemyslaw Klys submitted:Jun 15 2022
In March 2020, Microsoft will release its monthly updates. With those updates, Microsoft will
disable insecure LDAP Bindings, which is going to break a lot of your systems (hopefully not). But this was already communicated, and you know all about it, right? If not, you should read those two articles that can help you with understanding what is happening and when.
By: Przemyslaw Klys submitted:Jun 15 2022
Function cannot be created because function capacity 4096 has been exceeded for this scope
(evotec.xyz)
I had a long day today when my long-running script (10 hours) gave me weird errors with Microsoft
By: Przemyslaw Klys submitted:Aug 4 2023
I had a long day today when my long-running script (10 hours) gave me weird errors with Microsoft
Graph for Teams. Finally, I solved my mistakes and reran the hand to see if the report would be complete this time. Surprisingly, it gave me an error I'd never seen before. "Function cannot be created because function capacity 4096 has been exceeded for this scope". The error is at least weird because it's shown on a production server where I've just a handful of PowerShell modules installed, and I've never seen it on my development machine where I've over 200 modules.
By: Przemyslaw Klys submitted:Aug 4 2023
Getting file metadata with PowerShell similar to what Windows Explorer provides
(evotec.xyz)
I'm working on a new feature for one of my modules that requires me to know what kind of files I am
By: Przemyslaw Klys submitted:Jun 16 2022
I'm working on a new feature for one of my modules that requires me to know what kind of files I am
working with. It's quite easy in PowerShell, and without a lot of code, you can reasonably quickly get necessary information about data stored on your desktop or anywhere else for that matter.
By: Przemyslaw Klys submitted:Jun 16 2022
How to Efficiently Remove Comments from Your PowerShell Script
(evotec.xyz)
As part of my daily development, I create lots of code that I subsequently comment on and leave to
By: Przemyslaw Klys submitted:Aug 25 2023
As part of my daily development, I create lots of code that I subsequently comment on and leave to
ensure I understand what I tried, what worked, and what didn't. This is my usual method of solving a problem. Sure, I could commit it to git and then look it up, and I do that, but that doesn't change my behavior where I happen to have lots of "junk" inside of my functions that stay commented out. While this works for me, and I've accepted this as part of my process, I don't believe this should be part of the production code on PowerShellGallery or when the code is deployed.
By: Przemyslaw Klys submitted:Aug 25 2023
Image Manipulation, Image Resize, Image Combine and more with PowerShell
(evotec.xyz)
ImagePlayground is a PowerShell module that works in PowerShell 5.1 and PowerShell 7+. It works
By: Przemyslaw Klys submitted:Jan 6 2023
ImagePlayground is a PowerShell module that works in PowerShell 5.1 and PowerShell 7+. It works
partially on Linux and should work on macOS, except for charts. That means it's partially cross-platform, but the end goal is to make it work fully on all platforms. So what can this module do?
By: Przemyslaw Klys submitted:Jan 6 2023
Reading IIS logs with PowerShell
(evotec.xyz)
Today I was reading Twitter, as I am pretty addicted to technology news when Adam Bacon mentioned
By: Przemyslaw Klys submitted:Jun 16 2022
Today I was reading Twitter, as I am pretty addicted to technology news when Adam Bacon mentioned
that he's surprised that no one has rebuilt IIS Parser as pure PowerShell. While this is not entirely true, and some modules can do some parsing, I decided to try my luck. While doing it from scratch in PowerShell is possible, I opted to use an external C# library that does all the heavy lifting and is optimized for speed.
By: Przemyslaw Klys submitted:Jun 16 2022
Remove-Item : Access to the cloud file is denied while deleting files from OneDrive
(evotec.xyz)
I like OneDrive. It allows me to keep my data secure and always synchronized. If things go wrong, I
By: Przemyslaw Klys submitted:Jun 16 2022
I like OneDrive. It allows me to keep my data secure and always synchronized. If things go wrong, I
can always get it back. I use it for almost everything. Even for my PowerShell projects, which are committed to GitHub, so in theory, I shouldn't need that. But every once in a while, I make some stupid mistake and delete a file that has yet not been committed to GitHub, and that's where the OneDrive comes in handy. Quick restore, and we're back. Unfortunately, sometimes things aren't as I would expect them to work. For example, let's have a look at this nice list of markdown files that are documentation for my module called GPOZaurr.
By: Przemyslaw Klys submitted:Jun 16 2022
Restoring (Recovering) PowerShell Scripts from Event Logs
(evotec.xyz)
A few days ago, I was asked to take a look at PowerShell Malware. While I don't know much about
By: Przemyslaw Klys submitted:Jun 16 2022
A few days ago, I was asked to take a look at PowerShell Malware. While I don't know much about
malware, my curiosity didn't let me skip on this occasion, and I was handed and WindowsPowerShell.evtx file. Ok, that's not what I expected! I wanted PowerShell .ps1 files that I can read and asses? Well, you play with the cards you were dealt with. What I was handed over was PowerShell Event Log. By design, PowerShell writes whatever you execute, and it thinks it is risky to Windows PowerShell Operation Event Log.
By: Przemyslaw Klys submitted:Jun 16 2022
Seamless HTML Report Creation: Harness the Power of Markdown with PSWriteHTML PowerShell Module
(evotec.xyz)
In today's digital age, the ability to create compelling and informative HTML reports and documents
By: Przemyslaw Klys submitted:Sep 8 2023
In today's digital age, the ability to create compelling and informative HTML reports and documents
is a crucial skill for professionals in various fields. Whether you're a data analyst, a system administrator, a developer, or simply someone who wants to present information in an organized and visually appealing manner, having the right tools at your disposal can make all the difference. That's where the PSWriteHTML PowerShell module steps in, offering an array of possibilities to suit your reporting needs.
By: Przemyslaw Klys submitted:Sep 8 2023
Strengthening Password Security in Active Directory: A PowerShell-Powered Approach
(evotec.xyz)
PasswordSolution uses the DSInternals PowerShell module to gather Active Directory hashes and then
By: Przemyslaw Klys submitted:Jun 2 2023
PasswordSolution uses the DSInternals PowerShell module to gather Active Directory hashes and then
combines that data into a prettified report. If you have ever used DSInternals, you know that while very powerful, it comes with raw data that is hard to process and requires some skills to get it into a state that can be shown to management or security.
By: Przemyslaw Klys submitted:Jun 2 2023
Upload and Download files from Azure Blob Storage using Connection String
(evotec.xyz)
They say there is a first time for everything. For me, it's how to download and upload files to
By: Przemyslaw Klys submitted:Jan 20 2023
They say there is a first time for everything. For me, it's how to download and upload files to
Azure Blog Storage using Connection String. Recently I was given Connection String, Container name and had to download some files from Azur Blog Storage. After some research and trying Connect-AzAccount, I found that the proper way to go is thru New-AzStorageContext.
By: Przemyslaw Klys submitted:Jan 20 2023
Using Win32_UserAccount WMI filter in PowerShell/Group Policies and what to avoid
(evotec.xyz)
Some months ago, I created PowerShell Script to create local administrative users on workstations -
By: Przemyslaw Klys submitted:Jun 16 2022
Some months ago, I created PowerShell Script to create local administrative users on workstations -
Create a local user or administrator account in Windows using PowerShell. It's a bit overcomplicated, but the goal was it should work for Windows 7 and up, and that means supporting PowerShell 2.0. As part of that exercise, I've been using Win32_UserAccount WMI based query to find local users and manage them to an extent. While Get-LocalUser exists, it's not suitable for the PowerShell 2.0 scenario. I also use the same query in GPO for WMI filtering. You can say it's been a good friend of mine - until today! Let's take a look at this basic WMI query:
By: Przemyslaw Klys submitted:Jun 16 2022
Visually display Active Directory Nested Group Membership using PowerShell
(evotec.xyz)
In the Active Directory PowerShell module, you have two commands to your disposal that help display
By: Przemyslaw Klys submitted:Jun 16 2022
In the Active Directory PowerShell module, you have two commands to your disposal that help display
group membership. Those are Get-ADGroup and Get-ADGroupMember. The first command contains property Members, which gives you DistinguishedName of all members, and Get-ADGroupMember can provide you either direct members or with Recursive switch all members recursively (skipping groups). Till a few weeks ago, I was a happy user of those commands until I noticed two things. Member property for Get-ADGroup sometimes misses elements for whatever reason.
By: Przemyslaw Klys submitted:Jun 16 2022
Working with VirusTotal from PowerShell
(evotec.xyz)
Virus Total is an excellent service. It's a single place where hundreds of antivirus engines can
By: Przemyslaw Klys submitted:Aug 12 2022
Virus Total is an excellent service. It's a single place where hundreds of antivirus engines can
verify if the file, URL, domain name, or IP Address is trusted or not. Of course, it's not a silver bullet, but it brings tremendous value, and I often verify files I download before executing. Since I release a lot of new or updated PowerShell modules on a weekly/monthly basis, I thought it would be great to send newly released versions straight to Virus Total so I can have them checked before anyone executes them. I also hope to prevent false positives from some antivirus vendors that may tag my modules as malware because they haven't seen the DLL or PowerShell module in this form before. I've seen it happen to DBATools, so why not try and push my modules before users even use them?
By: Przemyslaw Klys submitted:Aug 12 2022
Projects, Scripts, and Modules
Active Directory Replication Summary to your Email or Microsoft Teams
(evotec.xyz)
Active Directory replication is a critical process that ensures the consistent and up-to-date state
By: Przemyslaw Klys submitted:Apr 19 2024
Active Directory replication is a critical process that ensures the consistent and up-to-date state
of directory information across all domain controllers in a domain. Monitoring this process is important as it helps identify any issues that may arise and resolve them quickly. One way to monitor Active Directory replication is by using the Repadmin command-line tool. Repadmin provides a wealth of information about the replication status and health of a domain. However, manually checking the Repadmin output can be time-consuming and tedious, and running it manually every 30 minutes just to check if everything is great doesn't seem like a great idea. While PowerShell has its own commands around replication I've not found something as fast and reliable as repadmin /replsummary.
By: Przemyslaw Klys submitted:Apr 19 2024
Comparing advanced objects
(evotec.xyz)
Let's take two or more objects with the same structure but different data. It's pretty easy to
By: Przemyslaw Klys submitted:Jun 16 2022
Let's take two or more objects with the same structure but different data. It's pretty easy to
compare it if the object is one-dimensional, but things are not that obvious once you try to reach more complicated objects. Below, I have two objects that look the same at first, but I've changed a few values.
By: Przemyslaw Klys submitted:Jun 16 2022
Easy way to connect to FTPS and SFTP using PowerShell
(evotec.xyz)
FTPS and SFTP are two ways to send and receive files from remote sources. While the name suggests
By: Przemyslaw Klys submitted:Jun 16 2022
FTPS and SFTP are two ways to send and receive files from remote sources. While the name suggests
both do the same thing, those are different protocols, in the end, having the same goal. A few weeks back, I had to make sure I can reliably download files from FTPS server using PowerShell, and since I couldn't find anything straightforward to use, I decided to write my own.
By: Przemyslaw Klys submitted:Jun 16 2022
Easy way to send emails using Microsoft Graph API (Office 365) with PowerShell
(evotec.xyz)
When you're using Office 365 and want to send an email, you have two choices SMTP or Microsoft Graph
By: Przemyslaw Klys submitted:Oct 14 2022
When you're using Office 365 and want to send an email, you have two choices SMTP or Microsoft Graph
API, which is a "new" kid on the block. For some time, I've used Microsoft Graph exclusively to send emails in favor of SMTP as it's much easier to manage and generally works over HTTPS.
By: Przemyslaw Klys submitted:Oct 14 2022
Encrypting and decrypting PGP using PowerShell
(evotec.xyz)
Some time ago, I decided that having an easy-to-use PGP PowerShell module is a way to kill my
By: Przemyslaw Klys submitted:Jun 16 2022
Some time ago, I decided that having an easy-to-use PGP PowerShell module is a way to kill my
boredom. Four months have passed, and I decided to share it with the world, as it may be helpful to some of you. Today I would like to introduce you to PSPGP - PowerShell module that provides PGP functionality in PowerShell.
By: Przemyslaw Klys submitted:Jun 16 2022
Introducing PSTeams 2.0
(evotec.xyz)
PSTeams PowerShell module has been on the market for a while now. It supports sending notifications
By: Przemyslaw Klys submitted:Jun 16 2022
PSTeams PowerShell module has been on the market for a while now. It supports sending notifications
to Microsoft Teams channels via Incoming WebHooks. You could send a pretty message to the team's channel with just a few lines of code. With PSTeams 2.0, support for Adaptive Cards, Hero Cards, List Cards, and Thumbnail Cards was added. In PSTeams 1.0, you could send a message to Teams Channel using the following code
By: Przemyslaw Klys submitted:Jun 16 2022
Mailozaurr
(github.com)
Mailozaurr is a PowerShell module that aims to provide SMTP, POP3, IMAP and few other ways to
By: Przemyslaw Klys submitted:Jun 16 2022
Mailozaurr is a PowerShell module that aims to provide SMTP, POP3, IMAP and few other ways to
interact with Email.
By: Przemyslaw Klys submitted:Jun 16 2022
Mastering Active Directory Hygiene: Automating Stale Computer Cleanup with CleanupMonster
(evotec.xyz)
Have you ever looked at your Active Directory and wondered, "Why do I still have computers listed
By: Przemyslaw Klys submitted:Aug 30 2024
Have you ever looked at your Active Directory and wondered, "Why do I still have computers listed
that haven't been turned on since World Cup 2016?" Yeah, we've all been there. Keeping AD clean and up-to-date is like trying to organize your garage-it's easy to put off until it becomes a total mess.
By: Przemyslaw Klys submitted:Aug 30 2024
PowerBGInfo – PowerShell alternative to Sysinternals BGInfo
(evotec.xyz)
When I created ImagePlayground, I thought about how to show its usefulness to the general community.
By: Przemyslaw Klys submitted:Jan 6 2023
When I created ImagePlayground, I thought about how to show its usefulness to the general community.
On how to deliver what PowerShell can do. Then I saw on some forum people asking BGInfo to expand and allow running PowerShell scripts so that the data on the BGInfo Wallpaper can be gathered from PowerShell rather than VBS. I thought this was a great idea to create BGInfo using PowerShell without the necessity of using BGInfo at all.
By: Przemyslaw Klys submitted:Jan 6 2023
PowerQualys v 0.3.0
(powershellgallery.com)
Helper module for Qualys
By: Przemyslaw Klys submitted:Jun 14 2024
Helper module for Qualys
By: Przemyslaw Klys submitted:Jun 14 2024
PSSharedGoods v 0.0.278
(powershellgallery.com)
Module covering functions that are shared within multiple projects
By: Przemyslaw Klys submitted:Mar 1 2024
Module covering functions that are shared within multiple projects
By: Przemyslaw Klys submitted:Mar 1 2024
TheDashboard v 0.0.24
(powershellgallery.com)
TheDashboard is a module that allows you to create a dashboard for your HTML reports
By: Przemyslaw Klys submitted:Apr 12 2024
TheDashboard is a module that allows you to create a dashboard for your HTML reports
By: Przemyslaw Klys submitted:Apr 12 2024
Community
Unlocking PowerShell Magic: Different Approach to Creating ‘Empty’ PSCustomObjects
(evotec.xyz)
Today I saw an article from Christian Ritter, "PowerShell: Creating an "empty" PSCustomObject" on X
By: Przemyslaw Klys submitted:Aug 11 2023
Today I saw an article from Christian Ritter, "PowerShell: Creating an "empty" PSCustomObject" on X
that got me curious. Do people create empty objects like Christian proposes? I want to offer an alternative to Christian's article, which uses OrderedDictionary and converts to PSCustomObject.
By: Przemyslaw Klys submitted:Aug 11 2023