Send-MailMessage: The PowerShell Way to Send Email

For this PowerShell cmdlet of the day, we're covering the PowerShell cmdlet Send-MailMessage. This PowerShell cmdlet serves one purpose and one purpose only; to send email in a lot of different ways.

Adam Bertram Avatar Adam Bertram

6 min. read

Learn How to Code or Else: An IT Pro Guide

Are you still manually creating new virtual machines? Are you going into the Active Directory Users and Computers tool and creating, modifying or resetting passwords? If so, you may be looking for a new job in 5 years.

Adam Bertram Avatar Adam Bertram

3 min. read

Using PowerShell to Copy to the Clipboard

When writing code in PowerShell the last thing you might think about isthe Windows clipboard. We all probably know the infamous Ctrl-C and Ctrl-V keyboard shortcuts to copy and paste from the clipboard but this is typically done via the GUI. In our PowerShell scripts, it's not too useful. However, did you know that you can use PowerShell to copy to the clipboard and retrieve it's contents?

Adam Bertram Avatar Adam Bertram

3 min. read

Active Directory Database Size Monitoring: Building a Monitor

The Active Directory (AD) database is, by far, the most important piece of AD. After all, without the database, AD wouldn't be much good at all. AD needs to be up and active 24 hours a day. It's being depended on for many different services.

Adam Bertram Avatar Adam Bertram

2 min. read

DSC Without the Configuration: Using Invoke-DscResource

Prior to Windows Management Framework (WMF) v5, people that wanted to use Desired State Configuration (DSC) to apply configurations to their machines were forced to go through the same procedure if they wanted to provision an entire server or just install a single Windows feature.

Adam Bertram Avatar Adam Bertram

3 min. read

How to Create External Help for your PowerShell Module Functions

One of the most overlooked tasks of a PowerShell scripter is writing documentation and help. Scripters just want to write code and writing help to provide the user information on how to execute that code is an often neglected feature. Help, however, is a critical piece of any good PowerShell tool especially when it's being released for public consumption or is part of an important business process.

Adam Bertram Avatar Adam Bertram

3 min. read

How to Create your First Chocolatey Package

As automation becomes more of necessity rather than a nicety, it's important we IT folk look at better ways to perform menial tasks; one of those tasks is installing software. Rather than download an MSI, double-click on it and run through the wizard, it would behoove you to think of a better way. In this blog post, learn how to create a Chocolatey package (a popular Windows packaging manager).

Adam Bertram Avatar Adam Bertram

2 min. read

How to Deal with Dependencies in Your Pester Infrastructure Tests

When writing Pester infrastructure tests, you'll ultimately run across a common problem; dealing with dependencies. Unlike unit tests, infrastructure tests actually run real code and touch the real environment. A real environment is complicated and full of dependencies on compute, networking, storage, etc.

Adam Bertram Avatar Adam Bertram

3 min. read

How to Find Active Directory Admin Accounts Authenticated by RODCs

Introduced in Windows Server 2008, read-only domain controllers (RODC) were a secure way to deploy DCs in remote locations. RODCs were read-only which meant that nothing could be directly written to them. This meant that a malicious attacker couldn't add his own user account and have it replicated back to all of the other DCs in an environment. It was much more secure than traditional domain controllers which allowed someone with the appropriate permissions to add objects at will to Active Directory.

Adam Bertram Avatar Adam Bertram

2 min. read

How to Connect to SQL Server from Linux

In a perfect database administrator world, everything would be the same. All servers would be identical and run the same workloads. They're easier to manage. But, that's not the case. Nowadays, System administrators have to manage different environments. This couldn't be more evident in need to perform SQL queries from a Linux machine. In this post, you'll learn how to connect to SQL Server from Linux!

Adam Bertram Avatar Adam Bertram

3 min. read

How to Manage and Automate AWS EC2 Snapshots with PowerShell

Amazon Elastic Block Store (EBS) is a service that provides storage for Amazon EC2 instances. EBS is what every volume on your EC2 instances runs on. When you rely on a service to run important infrastructure it's wise to ensure that data is backed up. In this blog post, learn how to manage and automate AWS EC2 snapshots using the PowerShell scripting language.

Adam Bertram Avatar Adam Bertram

5 min. read

How to use Python on Linux to Query Windows WinRM Hosts

PowerShell Remoting was a huge time-saver when it was introduced with PowerShell v2. Although PowerShell Core has introduced support for SSH, it's still possible to connect to Linux hosts over WinRM from Windows hosts using Python. In this blog post, you're going to learn how to connect to Windows hosts over WinRM using Python on Linux.

Adam Bertram Avatar Adam Bertram

3 min. read

How to Check for a Pending Reboot in the Registry (Windows)

Whenever you install software, updates or make configuration changes, it's common for Windows to need a reboot. Many OS tasks sometimes force Windows to require a reboot. When a reboot is pending, Windows add some registry values to show that. In this blog post, you're going to learn how to check for a pending reboot and how to build a PowerShell script to automate the task.

Adam Bertram Avatar Adam Bertram

7 min. read

How to Check your PowerShell Version (All the Ways!)

In PowerShell, there are a zillion ways to do the same thing (or close to it). In this blog post, you'll learn every way check your PowerShell version on local and remote computers. We'll cover the bad ways and my recommended way.

Adam Bertram Avatar Adam Bertram

4 min. read

How to Sync AD using PowerShell and a CSV File

Learn how to use a community PowerShell module called PSADSync to sync AD with PowerShell (users). We will cover how to set up a simple AD sync with a CSV file in this tutorial blog post.

Adam Bertram Avatar Adam Bertram

3 min. read

Understanding and Using AWS Profiles in Windows PowerShell

In this tutorial, you're going to learn how to work with AWS profiles in PowerShell. You'll see how to create and manage profiles including using the default profile, creating your own and more!

Adam Bertram Avatar Adam Bertram

4 min. read

Windows 10: Hibernate vs Sleep

When you leave your Windows 10 computer, it's important to ensure it's not simply left powered on. There's no need to add unnecessary charges to your electric bill. If you're going to come back to it soon you probably don't want to simply shut it down completely. You'll then have to wait for it to boot back up. Luckily, you don't have to.

Adam Bertram Avatar Adam Bertram

4 min. read

How to Rename Amazon S3 Folder Objects with Python

To rename a folder on a traditional file system is a piece of cake but what if that file system wasn't really a file system at all? In that case, it gets a little trickier! Amazon's S3 service consists of objects with key values. There are no folders or files to speak of but we still need to perform typical file system-like actions like renaming folders.

Adam Bertram Avatar Adam Bertram

3 min. read

Using PowerShell to set DNS search order on Windows

Do you need to set the DNS search order on a whole bunch of workstations or servers? Do you have PowerShell? Then you're in luck because I'm about to show you how to use PowerShell to set DNS search order on lots of machines at once!

Adam Bertram Avatar Adam Bertram

3 min. read

How to Manage Docker Volumes on Windows

Docker volumes are the preferred way for handling persistent data created by and used by Docker containers. Let's take a look at how this works by covering how to manage Docker volumes on Windows.

Adam Bertram Avatar Adam Bertram

6 min. read

Subscribe to Adam the Automator

Get the latest posts delivered right to your inbox