• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
OpenTechTips

OpenTechTips

Comprehensive IT Guides for Pros and Enthusiasts

MENUMENU
  • HOME
  • ALL TOPICS
    • Exchange
    • InfoSec
    • Linux
    • Networking
    • Scripting
      • PowerShell
    • SSL
    • Tools
    • Virtualization
    • Web
    • Windows
  • ABOUT
  • SUBSCRIBE

PowerShell


PowerShell


PowerShell

How to Run a Command Stored in a Variable | PowerShell

May 5, 2025 Zsolt Agoston
Use the & operator to execute the content of a variable in PowerShell ... [Read More]
PowerShell

How to Get Effective Teams User Policies Per User

December 21, 2024 Zsolt Agoston
Query all effective M365 Teams User policies for a particular user. Useful when policies are assigned by M365 groups that makes it hard to determine the correct policy assignment for the user ... [Read More]
PowerShell

How to Create Self-Signed SSL for WebSites with PowerShell

June 1, 2024 Zsolt Agoston
Generate SSL for HTTPS with PowerShell ... [Read More]
PowerShell

How to Create Self-signed Client Authentication Certificate with PowerShell

June 1, 2024 Zsolt Agoston
Generate self-signed SSL certificate on a Windows computer ... [Read More]
PowerShell

How to Get All Teams a User is a Member | M365

March 30, 2024 Zsolt Agoston
List all teams in M365 where a user is a member ... [Read More]
PowerShell

Disable or Enable AzureAD Password Expiration with PowerShell

September 24, 2023 Zsolt Agoston
Use PowerShell to disable or enable AzureAD user account password expiration for a single user or in bulk ... [Read More]
PowerShell

Show Error Details – PowerShell

December 27, 2022 Zsolt Agoston
How to get verbose PowerShell error messages ... [Read More]
PowerShell

How to Test Open Port in PowerShell

December 4, 2022 Zsolt Agoston
Two ways to check open ports with PowerShell ... [Read More]
PowerShell

Easy Password Generator in PowerShell

October 6, 2022 Zsolt Agoston
Use PowerShell to generate randomized passwords in a length and count you want! ... [Read More]
PowerShell

PowerShell: How to parse a large one-line XML

March 1, 2022 Zsolt Agoston
Parse unformatted (one-liner) xml files, adding line breaks and indentation using Linux ... [Read More]
PowerShell

PowerShell: How to Reverse an Array

February 22, 2022 Zsolt Agoston
Learn how to reverse an array of any kind in PowerShell ... [Read More]
PowerShell

How Does UTF-8 Encoding Work

December 29, 2021 Zsolt Agoston
Learn what the UTF-8, UTF-16 and UTF-32 encodings are, how they work, what is BOM and how variable length encoding is utilized to represent over a 100 thousand characters in a simple text file ... [Read More]
PowerShell

How to Move Files from Multiple Subfolders to a Single Folder with PowerShell?

December 19, 2021 Zsolt Agoston
How to move all files that matches a pattern from subdirectories to a cetralized target location ... [Read More]
PowerShell

PowerShell: Extract Pattern from a String

August 11, 2021 Zsolt Agoston
Two methods of extracting text from an input string with PowerShell using regex expressions ... [Read More]
PowerShell

Grep command in PowerShell (recursive)

May 10, 2021 Zsolt Agoston
A simple function to mimic the Unix recursive grep command ... [Read More]
PowerShell

Convert to and from Epoch Time using PowerShell

March 26, 2021 Zsolt Agoston
Converting date and time to Epoch (Unix) time, and Epoch time back to human readable date ... [Read More]
PowerShell

PowerShell – How to Decrypt a SecureString

March 18, 2021 Zsolt Agoston
Two ways to decrypt a SecureString in PowerShell ... [Read More]
PowerShell

Base64 Encode with Fixed Line Length Output in PowerShell

March 10, 2021 Zsolt Agoston
Here is an example script that encodes an arbitrary text with Base64 method using PowerShell and breaks up the output into fixed-length lines to make it more easily readable. We use 76 character long rows as the MIME (Multipurpose Internet ... [Read More]
PowerShell

Split a String Into Fixed Length Lines in PowerShell

March 9, 2021 Zsolt Agoston
A one-liner to split up a long string into fixed-length rows in PowerShell ... [Read More]
PowerShell

How to List the Total Size of a Folder with PowerShell

November 29, 2020 Zsolt Agoston
List the total size, the subfolder-count, and the file-count of a folder or subfolder in PowerShell ... [Read More]
PowerShell

How to Clone a Role Assignment Policy in Microsoft Exchange

November 21, 2020 Zsolt Agoston
This script is for cloning a Role Assignment Policy in Exchange. For example, if you want to allow certain users to add/remove members to the distribution groups they own, you need to enable the "MyDistributionGroups" option in the role assignment ... [Read More]
PowerShell

PowerShell – How to add extra column to a CSV Export

November 17, 2020 Zsolt Agoston
Have you ever found yourself in a situation where you wanted to export the output of a PowerShell cmdlet or script, but needed to add an extra column to the output to export to a CSV file? Let's see how ... [Read More]
PowerShell

PowerShell: List Automapped Mailboxes for All Mailboxes in Exchange 2016

November 7, 2020 Zsolt Agoston
This script is for exporting all the mailboxes that have users auto-mapped with FullAccess rights. The script is for on-prem Exchange environments ... [Read More]
PowerShell

How to Export Users from Nested AD Groups

October 17, 2020 Zsolt Agoston
The following GetADGroup function will help to display all users who are a member of an AD or distribution group, no matter how deep they are located in nested structures ... [Read More]
PowerShell

Random Password Generator in PowerShell

October 15, 2020 Zsolt Agoston
A one-liner to generate passwords with PowerShell. Specify the length and the characters that builds up the passwords and off you go! ... [Read More]
PowerShell

Script to Customize the look of a PowerShell Window

September 26, 2020 Zsolt Agoston
A PowerShell window looks pretty unified when it starts up. Especially if there are multiple windows open at the same time it might be helpful if they were distinguishable. Like a different color as the background, or a specific title ... [Read More]
PowerShell

Check folder sizes in Exchange with PowerShell

September 22, 2020 Zsolt Agoston
The script returns the cumulative size of the requested folder with and without subfolders counted in ... [Read More]
PowerShell

Install-PackageProvider: No match found error when installing PowerShell modules | FIX !

August 6, 2020 Zsolt Agoston
The Issue PowerShell - Install-PackageProvider: No match found error when installing PowerShell modules | FIX ! In  a new deployment of Windows Server 2016 or 2019 when using the Install-Module [xxx] command you might be prevented with the following error ... [Read More]
PowerShell

Storing Passwords for PowerShell Scripts – ALWAYS WORKS!

June 7, 2020 Zsolt Agoston
In case you cannot use the CredentialManager PowerShell module to store and retrieve user credentials, but you still need to securely store user passwords or other confidential data there is another way to do so. 1. Securely Encrypt and Store ... [Read More]
PowerShell

Base64 Encoder and Decoder Algorithm in PowerShell – with Examples

May 31, 2020 Zsolt Agoston
The idea of encoding and decoding to- and from Base64 using PowerShell is based on the very same algorithm as we used in our Python example. In this short article we go through the process of encoding and then decoding ... [Read More]
PowerShell

SID to SamAccountName and vice-versa

May 17, 2020 Zsolt Agoston
The quick way to get a user's SID or identify a SID if the username is unknown. First we use the command line to retrieve the reqested values, then a custom PowerShell function that can be used to get any ... [Read More]
PowerShell

PowerShell script for mass-creating Distribution Groups

May 5, 2020 Zsolt Agoston
Do you want to automate distribution group creation, making your job easier? With this script you'll be able to mass-create distribution groups. It takes a simple text file as an input that contains a list of delivery group names, and ... [Read More]
PowerShell

PowerShell Abbreviation Table

May 1, 2020 Zsolt Agoston
Have you ever wondered while typing the same long PowerShell command again and again, that there must be an abbreviation for at least a few of them? Here you go! ... [Read More]
PowerShell

How to SECURELY store credentials for PowerShell scripts

April 30, 2020 Zsolt Agoston
Every day we need to log into hundreds of portals, as it is important for security, there must be a way to script it, automate logins without putting our actual passwords in scripts in plain text, right? Luckily this is ... [Read More]
PowerShell

How to Create and Use Custom Powershell Commads

April 20, 2020 Zsolt Agoston
Custom commands John needs to access Exchange PowerShell a lot. He's tired of logging in the actual Exchange server all the time, he prefers to use his local computer to run cmdlets and manage mailboxes. He created a script, called ... [Read More]
PowerShell

Math: X To The Power of Y in PowerShell

April 13, 2020 Zsolt Agoston
Math in PowerShell is very simple and straightforward, the basic operators work as they usually do in any programming or scripting language: 1 + 1, 64 - 16, 4 * 32, 1024 / 128, etc. However, many times I faced ... [Read More]
PowerShell

Exchange Powershell Login to Office365 and Exchange 2016, 2019

April 4, 2020 Zsolt Agoston
Making the PowerShell connection to the remote Exchange Online Office365 servers and connecting to an on premises server that is local to the organization are slightly different. Connect to Office365 Connecting to Office365 consists of three different, separate connections. One ... [Read More]

Primary Sidebar

Tools

  • Terms of Use
  • Disclaimer
  • Privacy Policy
Manage your privacy

To provide the best experiences, we and our partners use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us and our partners to process personal data such as browsing behavior or unique IDs on this site and show (non-) personalized ads. Not consenting or withdrawing consent, may adversely affect certain features and functions.

Click below to consent to the above or make granular choices. Your choices will be applied to this site only. You can change your settings at any time, including withdrawing your consent, by using the toggles on the Cookie Policy, or by clicking on the manage consent button at the bottom of the screen.

Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Statistics

Marketing

Features
Always active

Always active
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
Manage options
{title} {title} {title}
Manage your privacy
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Statistics

Marketing

Features
Always active

Always active
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
Manage options
{title} {title} {title}