Goatee PFE

Blog of Microsoft Premier Field Engineer Ashley McGlone featuring PowerShell scripts for Active Directory.

Goatee PFE

  • Active Directory PowerShell SIDHistory Module Update 1.5

    I would like to thank everyone who has been using the Active Directory SIDHistory PowerShell module and sending me feedback.  Your input helps guide future releases like the one I am publishing today.

    I’ve been sitting on some updates for a while, because I prefer to release code that has been field-tested.  I also wanted to time this release with the upcoming PowerShell Deep Dives book where I have a chapter discussing the origins of this module.  The last update was version 1.4 in June of 2012.  This is update 1.5 in July of 2013.

    Summary of Changes

    I am excited to announce the following key improvements in this release:

    • SID history updates in ACLs can be added instead of replaced.
    • Create SID map files for security translation without needing SID history.
    • Track down old domains after their trusts have been removed.
    • Get error logging for file server paths that fail the ACL scan.
    • Automate SID history data collection across many servers and shares.
  • Microsoft PFE Ashley McGlone Speaking for MSPSUG Virtual User Group on Tuesday, July 9th at 8:30pm CDT

    Update: Watch the one hour meeting recording on the page below. This is a video tutorial on the Active Directory PowerShell SID history module. If you follow #PowerShell on Twitter you’ve seen Mike F. Robbins . He is a superstar in the PowerShell...
  • How To Use The 2012 Active Directory PowerShell Cmdlets From Windows 7

    Today we have several domain controller operating systems that support the Active Directory module cmdlets. Clients on Windows 7 and 8 can install the Remote Server Administration Tools (RSAT) to script with the Active Directory module against these DCs.

    With all of these versions now the first question that comes to mind is compatibility.

    • Are Windows 8 and Windows Server 2012 compatible with my existing AD PowerShell scripts?
    • Can I use the Windows 8 RSAT AD module against 2008 R2 or 2003 DCs?
    • Can I use the Windows 7 RSAT AD module against 2012 DCs?

    The Windows Server 2012 Active Directory PowerShell module has some handy new cmdlets.  However, many IT shops struggle to stay current on the latest operating system releases due to a variety of issues (budget, resources, compatibility, etc.). They desperately want to use the latest features, but their deployment standards have not caught up yet. This leaves them with workable, but sometimes inefficient, tools from previous releases.

    Today’s article will show you how to use the latest Windows Server PowerShell modules in a legacy Windows 7 environment.  As a bonus we’ll explore compatibility of the AD cmdlets across the different operating systems.

  • Dude, where’s my GPO? Using PowerShell to find all of your Group Policy links.

    Get-GPOReport from the Group Policy PowerShell module can report all GPOs, but it can be a bit overwhelming.  What if you want a simple spreadsheet listing of the same information?   This script gives you a thorough CSV report of all GPO links, where enforced, where blocked, and more.  If you support group policy, then this script is guaranteed to please.

  • Touch-Free PowerShell DCPROMO in Windows Server 2012

    Do you schedule DCPROMO activities for the weekend?  After hours?  Middle of the night?  I remember those days.  Often it was hard to get in the right frame of mind to think through all of the exact procedural steps during those late night change controls.

    Today’s post will show you how to easily promote and demote a Windows Server 2012 domain controller remotely with a script.  You don’t even need to logon to the target server.

    Generally change controls have three plans:

    • Implementation
    • Validation
    • Back-Out

    You have all three of these scripts for DCPROMO in today’s post.

  • Active Directory OU Permissions Report: Free PowerShell Script Download

    In Active Directory we need to know who has the keys to our organizational units (OUs), the place where our users and computers live. Over the years OUs have grown to meet needs. Different teams may have been delegated access for managing users, groups, and computers. Then you come along as the new administrator. You probably have no idea where permissions have been granted to your OUs. And the scary thing is… neither does anyone else.  I know, because I’ve been there.  I hear the same thing from our customers.

    Out-of-the-box we do not have a specific tool to report all of the OU permissions. You have to click each OU and view the security tab one-by-one, and we all know that is entirely impractical.  Today’s post contains a free script download to generate a report of this vital information.

    I would advise all Active Directory shops to review this report on a quarterly basis to make sure there are no surprise administrators lurking in your domain.

  • How to do PowerShell on your phone

    Even Spiderman would envy this web action. Today we're going to walk through setting up a portable PowerShell v3 Web Access demo. Using this demo guide you can explore PowerShell from any web-capable device: your phone, your tablet, or your Raspberry Pi.  The links in this post will guide you to all of the key documentation to build your own PowerShell Web Access lab.

  • Called Out: From 2012 to 2013

    Departing from the usual scripting today's post is a reflection on 2012 and a look ahead at goals for 2013.  The overall theme today is the Heroes To Mentors vision we have embraced within Microsoft PFE.

  • Free Download: CMD to PowerShell Guide for AD

    New Years Resolution

    Hi folks. It's your friendly, neighborhood PFE again. In order to avoid the long lines to buy a treadmill the first week of January I thought I would save you some time and give you an easier New Years Resolution… Learn PowerShell.

    It's time to part with "blankie".

    For years many of us have relied on trusty command line utilities like PING, IPCONFIG, and REPADMIN. Some of us are still hanging on to those instead of embracing the brave new world of PowerShell.

    In an effort to assist with the transition and to introduce some of the cool new cmdlets in PowerShell v3 I have created a free reference guide showing how the old meets the new. For example, instead of PING try the PowerShell cmdlet Test-Connection, instead of NSLOOKUP use Resolve-DNSName, instead of GPUPDATE use Invoke-GPUpdate.

    The guide attached at the bottom of this blog post contains four packed pages of PowerShell pleasure for your perusing.

  • TIP: 2 Ways userAccountControl Is Easier In AD PowerShell

    TIP:  Anyone who wants to write scripts for Active Directory will eventually run into the famous userAccountControl attribute.  The good news is that in PowerShell we have two cmdlets that make this easy: Set-ADAccountControl and Search-ADAccount.

  • AD PowerShell Password Reset Shortcut for Helpdesk


    Back in May I released a post on the Hey Scripting Guy blog showing how to create a shortcut to unlock a user account with a PowerShell desktop shortcut.  That post was very popular, and the comments evolved into another shortcut to reset passwords.  Due to the popularity and utility of the idea I decided it deserved its own blog post.  I’ve also learned a little more about the Set-ADAccountPassword cmdlet to simplify my previous code.

    Monday Morning on “The Desk”

    You know the drill.  It’s Monday morning.  Last Friday 47 users decided it was a good idea to change their password before the weekend.  It’s Monday.  They forgot, just like I would.  Personally I never change my password on a Friday for this reason.  I need a couple days to use it before the weekend.

    What could make this worse?  Holiday weekends… like US Thanksgiving.  (grin)  Now it’s been at least five days since I reset that password.  There’s no chance I’ll remember it unless it’s written down on that sticky note under the mouse pad.

    Now all 47 of those users must call the helpdesk first thing Monday before they can begin another week of productivity for the company.  The self-service password project has not gotten enough budget or resources for implementation, and until it does every Monday morning is going to look very familiar.  That’s where we come in with PowerShell.

  • DogfoodCon 2012 - Columbus, Ohio

    Today I have the privilege of speaking at DogfoodCon 2012 in Columbus, Ohio.  My topic is “Active Directory PowerShell Step-By-Step”.  This post includes a download of the slide deck and demo scripts for the session.

  • AD Group History Mystery: PowerShell v3 REPADMIN

    After speaking about SID history and token size at PowerShell Saturday last month an attendee approached me with a common concern.  I was so excited to code the answer that I did it in the airport on the way home.

    Joe User has been with the company for 23 years and has accumulated more group memberships than the entire desktop support team.  Joe has rotated through five different departments during his career and managed to survive all of the layoffs.  As a result he has access to every share in the company.  Even worse his access token is so big that it won’t fit through the door.

    We would love to clean up his group memberships, but we have no way of knowing when he was added to all these groups.  If we could see the dates he joined those groups it would give us a clue about removing just the older group memberships.  Without this information his token will continue to bloat.

    Time for some AD PowerShell v3 goodness!

    PS - I'm also going to give you a handy chart showing PowerShell equivalents for REPADMIN in AD PowerShell v3.

  • Active Directory PowerShell Notes From The Field

    Today I have the privilege of speaking at the second-ever PowerShell Saturday event.  As a Microsoft Premier Field Engineer I get to meet many customers and help them with their Active Directory and PowerShell needs. I’ve taken some of that experience and wrapped it into a presentation called Active Directory PowerShell Notes From The Field.

    The session includes these four topics:

    1. Using Active Directory PowerShell to find schema update history
    2. Using PowerShell to migrate DNS zones
    3. Using Active Directory PowerShell to remediate token size issues caused by SID history
    4. A brief look at what’s new in Active Directory PowerShell v3

    These notes from the field come from scripting that I've done to assist customers with real-world needs.  The purpose of the session is to demonstrate the power of PowerShell for automating Active Directory solutions for every-day scenarios AND to inspire you to learn PowerShell.  To help with the learning part I have included several resources here for your reading pleasure.

    Attached to the bottom of this post you will find a file containing the DNS sample code and a PDF of the PowerPoint presentation.

  • Freaky neat Active Directory site links with PowerShell

    Today's post will help you clean up site link descriptions and give you some nice reporting capability.  Some folks like to set their site link description field to list each of the member sites in the link. If that is you, then you'll love this script.  Today's script enumerates all of the member sites in a site link and then concatenates their names into the description of the site link.  Also, it will make a note in the description for any site links that have change notification enabled.  Now that's handy!  There is also a bonus site reporting script in the download attached.

  • What's New In PowerShell v3: Demos to Download

    Today I am presenting at TechMentor in Redmond on the topic of "What's New In PowerShell v3". The purpose of this blog post is to share some related links and demo scripts from the session.

  • How to copy AD user attributes to another field with PowerShell

    Have you ever needed to copy data between attributes in Active Directory? Maybe you need to copy an ExtensionAttribute value into a different ExtensionAttribute. Maybe you need to copy email, UPN, or SIP addresses. You may even want to move the EmployeeNumber value into the EmployeeID attribute instead. What if you needed to create a new Description based on a combination from other attributes?

  • Free Downloads: Windows PowerShell 3.0 Quick Reference Guides

    Hey folks. In case you missed it PowerShell Magazine created some handy guides for getting started with the new PowerShell v3 features. We posted them here: http://www.microsoft.com/en-us/download/details.aspx?id=30002 "Quickly learn tips, shortcuts...
  • New Microsoft Download: Active Directory Replication Status Tool

    Our Microsoft Customer Service and Support experts have released a new tool for diagnosing AD replication errors: ADREPLSTATUS . Here is the description from the download page : The Active Directory Replication Status Tool (ADREPLSTATUS) analyzes the...
  • PowerShell Module for Working with AD SID History Updated

    Today I am releasing updated functionality in the PowerShell Active Directory SID History module.  New features include: inventory SID history in share permissions, new Access database reporting template, bug fixes, and more!

  • Surprise! Windows 8 & Server 2012 Release Preview Is Here!

    Fresh off the press today! Here are the links you need: Server announced here: http://blogs.technet.com/b/windowsserver/archive/2012/05/31/windows-server-2012-release-candidate-available-now.aspx Client announced here: http://blogs.msdn.com/b/b8...
  • PowerShell Tip: Active Directory Account Unlock Shortcut for Help Desk

    Today I posted over on the Hey Scripting Guy blog with a quick tip to unlock Active Directory user accounts.  Check it out:

    Active Directory Account Unlock Shortcut for Help Desk

  • How to close helpdesk tickets faster with PowerShell

    Now most people don't plan to spend their entire career on the help desk.  It is a starting point for bigger things in IT. PowerShell can be your career LAUNCH PAD.  Seriously.  PowerShell skills will differentiate you from your peers and slingshot you to the front of the pack.

    What if you could get all of the data you needed to close a ticket in seconds?

  • PowerShell Limericks for St. Patrick's Day

    In honor of all things St. Patrick's Day what could be more appropriate than a PowerShell limerick? I've drafted four for you to enjoy and share.

  • Five free ways to script Active Directory in PowerShell: Part 2

    This is huge.  Today's post includes demos scripts for all five free ways to script Active Directory in PowerShell.  I presented these last weekend at the first ever PowerShell Saturday event in Columbus, Ohio.  You will also find attached a one hour audio recording of the presentation for those who couldn't attend in person.  Now you have a free AD scripting recipe book with a guided tour from GoateePFE.