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

OpenTechTips

Short Guides for IT Professionals

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

PowerShell


Show Error Details – PowerShell

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

How to Test Open Port in PowerShell

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

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: 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: How to Reverse an Array

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

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]

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: 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]

Grep command in PowerShell (recursive)

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

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 – How to Decrypt a SecureString

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

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]

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]

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]

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 – 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: 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]

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]

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]

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]

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]

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]

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]

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]

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 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 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]

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]

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]

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]

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