Keeping Windows PowerShell Help Up To Date

After a two week hiatus I am back this week with a quick write up on how to automate the updating of PowerShell help. Update-Help should be one of the first things typed in PowerShell on a new workstation build. I jump into the topic and demonstrate how to automate the updating of the help files from the Internet or from a local network share. You can view the full article over at I look forward to getting another article out to everyone next week and I hope everyone in the US enjoys their long weekend! Related posts: Join […]

Find any E-Mail Address or Proxy Address In Active Directory

I am back this week with some more Exchange and Unified Communications goodness. This is another request I see a lot, someone want’s to know where an e-mail address is assigned. This opens up the possibilities of user mailboxes, shared mailboxes, distribution lists, public folders, conference rooms, contacts or resources. I have also seen duplicate e-mail addresses being assigned outside of Exchange causing delivery failures. I take a look at how you can quickly find any e-mail address in your environment along with partial searches of e-mail addresses. The two attributes for e-mail addresses being mail and proxyAddresses. I cover […]

Run Background Commands after Every Command

There was a time in the not so distant past, where I specifically remember wondering how I might be able to get something to happen, every time any command ran in my Windows PowerShell console. And, I don’t just mean commands. Any operation, or error, or fat fingered mess, followed by a press of the Enter key. We know that things happen in between commands. The list of commands in the current session history, and the $? variable, are updated as one command completes, and the console readies itself for the next instruction. So how does one take an action, […]

Using Package Management in Windows PowerShell v3

Hey now! The PowerShell team published a preview version of PackageManagement for Windows PowerShell v3 and v4. As it happens, I have a Windows 7 SP1 box running PowerShell v3–why not run a little experiment? $PSVersionTable.PSVersion Major Minor Build Revision —– —– —– ——– 3 0 -1 -1 Preparing the Environment You need .NET Framework 4.5 or later, so take care of that prerequisite before you install the following two assets: Windows Management Framework (WMF) v3 PackageManagement PowerShell Modules Preview I restarted the computer after each installation just to be safe. Before we proceed we also need to relax our […]

Automate Sip Address and UPN name changes in Lync / Skype for Business

Name changes are a common occurrence in the world of IT and usually the primary concern is the e-mail address. Exchange e-mail address policies will handle this for us but often times the Sip Address and User Principal Name are left behind. I tackle these changes with an automated way of changing the Lync / Skype for Business sip address (also known as sign-in address) and User Principal Name to match the e-mail address. I also include the link to download the Lync / Skype for Business meeting update tool that is required when a Sip Address is changed. Head […]

Export Subnets from Active Directory Sites and Services

I am back this week with a quick write up on how to export your network subnets from Active Directory Sites and Services. Active Directory Sites and Services subnet assignments are important for healthy replication and for location based services to function properly. The need for this information has come across my desk on several occasions. Even a quick print out would be extremely helpful to keep at your desk.  I have included both Windows 7/2008 and Windows 8/2012 methods to ensure everyone is covered. Head on over to for the full article. As always, leave a comment and I […]

Delete Specific E-Mail or E-Mails From All Exchange Mailboxes

Well this is week number two in my quest to post an article once a week and I am back with a common request for Exchange administrators. There are a lot of scenarios that bring up a need to remove an e-mail or e-mails from all mailboxes in your environment. Perhaps there was a disgruntled employee, a virus outbreak, or a reply all to the whole company. We all know that the “Retract” button is best effort (yes I still miss GroupWise for that purpose). As always we can turn to PowerShell for our scripting needs. The Search-Mailbox command is […]

How to handle oAuth from PowerShell

One of the coolest features of PowerShell is the many tools we have available to work with services on the web, be they SOAP, REST, RPC or even WSDL services.  It’s no question, PowerShell makes it very easy to pull down data from any of these places. Unfortunately, getting data from a service isn’t always as easy as embedding your credentials in a URL. In fact, some services require us to authenticate and ask the user for permission before giving up the goods.  For these, oAuth is the de-facto standard for delegated access.   In this blog post today on […]

Automate enabling and disabling Lync / Skype for Business users

Hello community, This is my first post here at, and I have a goal of posting tips, tricks, articles, and solutions once a week. My first exposure to scripting was on my x486 computer. I would always create .bat files to launch my DOS based games from the root folder. I learned complex scripting through the use of VB Script, automating the roll out and updating of Windows 2000 desktops and servers. I quickly transitioned to PowerShell as my preferred scripting language upon its release. I use PowerShell on a daily basis to administer Windows Server, SQL Server, […]

Store Secured Password in PowerShell Script

Automation is awesome, but what if you need to run a script with elevated privileges?   If you are following security best practices then the account you login with most likely doesn’t have the required elevated privileges.  Storing your password in plain text in your scripts is no good either.  So what do we do?  There are several options and each has there place, but I’ll show you my favorite below.  Check out the full article by clicking on the link below.  While you are there check out some of my other posts, the script repository and the resource page. Store […]

Where Are My FSMO Roles?

Hello, PowerShell people! I’ve never posted on before and so I feel as though I owe you a quick introduction before we dive into the tip I’d like to share with you. My name is Thomas Rayner and I am a Microsoft MVP for Windows PowerShell. I’m also a systems administrator and degree program instructor. I volunteer a fair bit of time as the President of the Edmonton Microsoft User Group (EMUG). EMUG has a more in depth bio for me on their About Executive page in case you want to know more about the person behind the avatar. […]

Basic Exchange Monitoring

Exchange Basic Monitoring.

Hello!  This is the first time I’ve posted for anyone outside of my own powershell blog site and I just want to thank for everything they do for our community.  I think most of you would agree that this site is one of the best PowerShell sites out there today and I am grateful for the opportunity to reach so many PowerShell people.  OK enough with the touchy-feely stuff. If you’ve been a Sys Admin for any extended time then you’ve probably had your fair share of run-ins with Exchange.  Whether you are a full-time Exchange Admin or […]

Function: Expand-ZipFile

Fellow coders, I’ve got a quick and dirty function for you. I had the requirement to extract zip files from a particular directory. Of course you could do this with Expand-Archive (new in PowerShell 5). But there’s a problem with this little rascal; it does not keeps the timestamps of the zipped files intact. My customer wanted to keep these timestamps intact, because they use it as a indicator to see if the file is older or newer what they already have. So I made a quick and dirty function, which uses a .NET assembly. I based this function on […]