Category: PowerShell

  • Using PowerShell to Disable or Enable a List of Active Directory Users

    I was doing some volunteer work recently when it came to my attention that there was a large number of enabled users in their Active Directory environment. This number was far greater than the amount of active employees. In order to address this, we took a simple approach: Of course, I turned to my favorite […]

  • Administering Azure from PowerShell Core

    Introduction Not long ago Microsoft proclaimed to us that they love Linux. And while many remain skeptical of that assertion (and not without reason), the tech giant is continually pouring more time and resources into the open source world. One of the really exciting products of this (to me at least) is PowerShell Core. Not […]

  • Quickly Copy AD Group Memberships To A New User

    I recently moved into a new role and needed to to be added to a number of AD groups. An often-used method for this is to model a new employee’s permissions after someone already in the same role. For one or two groups it is relatively simple to just do this manually, but as you […]

  • List the Manager Emails for AD Group Members with PowerShell

    Below is a quick script I’ve been working on for a colleague. Its simple purpose is to query an AD group then display each member’s username and the email address of their manager. Hopefully this will help others accomplish this common task with ease. (Update 04/11/2018) I modified the script to include the employee’s full […]

  • Getting Started with PowerShell Desired State Configuration (DSC)

    As I’ve mentioned in other posts, Desired State Configuration (DSC) is a powerful technology with a lot of potential. However, due to how new it is and how rapidly it’s evolving, it can be difficult to get started and figure out how to accomplish your specific goals. My intention here is not to give an […]

  • Installing SQL Server Using Desired State Configuration

    (Update: I’ve since discovered that SqlServerDsc has replaced xSQLServer.) One of my growing passions is using PowerShell Desired State Configuration (DSC) to automate all the things. I started out with simple configurations for testing but wanted to dive into more complex\useful situations for my day-to-day DBA life. To be honest, I was intimidated by the […]

  • My First PowerShell Module – PSOraenv

    Update (04/01/2019): We’ve hit over 100 downloads for PSOraenv! A big thanks to the PowerShell community. Please keep using it and let me know how I can make it better. ******* Most of my experience with Oracle has been on Linux, but recently I began working with it on Windows as well. It came to […]

  • Windows Server Core Jumpstart

    Recently I’ve been looking into the potential that Windows Server Core holds for our environment. Like most eager new Core users, I imagine, I jumped in with grand visions of spinning up a VM quickly and being off to the races administering it from my desktop. The reality wasn’t quite the same, as I ran […]

  • Using Powershell to Refresh a Test SQL Server Instance from Production

    A project I’ve been wanting to work on for a long time is how to automate restores of our Production databases to the Test instance. There are a number of challenges associated with this. First, the restore has to be able to find which backup it needs to use. Secondly, many of our databases do […]

  • Using PowerShell to Perform Availability Group Failovers

    In the past we’ve explored how to use PowerShell to automate failovers on SQL Failover Clusters for Windows Updates and other scheduled maintenance. But what if you’re using Availability Groups instead of the traditional cluster? Fear not, there is still a PowerShell option for that. Usually I would have our night team use SSMS to fail […]