PowerShell Function to Create CimSessions to Remote Computers with Fallback to Dcom

I've found myself writing the same code over and over in my PowerShell scripts where I'm performing a task that requires me to create a CimSession to one or more computers without knowing what version of PowerShell is installed on the remote computers or if PowerShell is even installed on the remote computers. While it is possible to create a CimSession to a remote computer in any of those scenarios I just described, it's a fair amount of code to add to multiple scripts and then the same redundant Read more [...]
Posted in PowerShell | Tagged | Leave a comment

PowerShell Track at SQL Saturday #328 in Birmingham Alabama this Weekend!

Do you work with technology and live within driving distance of Birmingham Alabama? Then you should consider attending SQL Saturday #328 this weekend. There’s an entire track dedicated to PowerShell and while a few of the sessions in that particular track will focus on SQL Server, there's also a session on PowerShell Fundamentals for SharePoint, a session on Stupid PowerShell Tricks by PowerShell MVP Jim Christopher, and a session on the new features in PowerShell version 5 that I’ll be presenting. I'll Read more [...]
Posted in PowerShell, SQL Server | Tagged , | Leave a comment

Don’t miss the boat: PowerShell Summit Europe 2014

If you’re a frequent reader of the articles on this blog site then you probably already know that the information I write about is based on my real world experiences and the same holds true for this blog article about the PowerShell Summit conferences. During the past two years (since its inception), I have attended the PowerShell Summit North America and I can say without doubt that attending those conferences has definitely helped to advance my career. While anyone can pay the fee and attend, Read more [...]
Posted in PowerShell, PowerShell Summit | Tagged , | Leave a comment

Set a Users Active Directory Display Name with PowerShell

I recently saw an article on how to set a users Active Directory display name based on the values of their given name, initials, and surname. I came up with my own unique solution for this task and thought I would share it with you, the readers of my blog. As you can see in the following example, there are a mixture of users who need their display name corrected based on the requirement that their display name be listed as "Givenname Initials Surname":I Read more [...]
Posted in Active Directory, PowerShell | Tagged , | Leave a comment

Exclude Delayed Start Services when Checking Status with PowerShell

While using PowerShell to return a list of Windows services that are set to startup automatically and aren't running may sound like a simple task, it's not quite as easy as it sounds, at least not if you want accurate results. This is due to the services that are set to startup automatically with a delayed start skewing the results. For more information on how to accurately return a list of services that should be running, but aren't based on services that have a startup type of automatic while Read more [...]
Posted in PowerShell | Tagged | Leave a comment

Using PowerShell to discover information about your Microsoft SQL Servers

Earlier this week, I had an article published by PowerShell Magazine on the subject of "Using PowerShell to discover information about your Microsoft SQL Servers". Here's a brief description about that article: "In this article, I’ll be discussing how PowerShell can be used to retrieve just about any information that you would want to know about modern versions of SQL Server that you currently have running in your environment. This article isn't meant to be a deep dive, it’s meant to get Read more [...]
Posted in PowerShell, SQL Server | Tagged , | Leave a comment

Find and Disable Active Directory Users with PowerShell Faster than You can Open the GUI

In this scenario, a support request has been escalated to you because the help desk is unable to find a user account in Active Directory that needs to be disabled. The help desk included a screenshot where they attempted to search for the user who is named "William Doe": The request you received also stated that the user is in the "Sales" department so you perform a quick search for users who have a last name of "Doe" and who are also in the "Sales" department:Based Read more [...]
Posted in Active Directory, PowerShell | Tagged , | 1 Comment

Extract the Name from an Active Directory Distinguished Name with PowerShell and a Regular Expression

This is actually something I had a small blurb about in my previous blog article, but I wanted to go back, revisit it, and write a dedicated blog article about it. Sometimes there are properties in Active Directory like the one in the following example where the "Manager" property is being returned as a distinguished name and what you really wanted was just their name (in human readable format):You could write a complicated function or script to query Active Read more [...]
Posted in Active Directory, PowerShell, Regular Expressions | Tagged , , | Leave a comment

From Dangerous Script Copy & Paster to Scripting Games Winner and now PowerShell MVP!

I've been working in Information Technology for 20 years this year and I've wasted more than half of my career in the GUI (Graphical User Interface) having to learn GUI's for numerous products and different versions of all those different products over the years, more products and versions than I can count. Back in the VBScript days, I was the dangerous script copy and paster. Then when Exchange Server 2007 shipped, I was forced to learn at least some PowerShell since there were many things that Read more [...]
Posted in PowerShell | Tagged | 4 Comments

Create Active Directory Users Home Folder and Assign Permissions with PowerShell

The following function is a work in progress, but I thought I would go ahead and share it. This function requires a module named PowerShellAccessControl that was created by Rohn Edwards which is downloadable from the TechNet Script Repository. The version 3.0 beta revision of his module which is also downloadable on that same page is what was used to test the examples shown in this blog article.The following example demonstrates creating  home folders and assigning Read more [...]
Posted in Active Directory, PowerShell | Tagged , | Leave a comment

Using PowerShell to Search for Specific Users in Active Directory without Knowing their Exact Information

You're looking for a user in your Active Directory environment who goes by the nickname of "JW". You know that's the user's initials and you need to find their AD user account. Typically you'd use the Identity parameter, but that parameter doesn't allow wildcards:Verifying wildcard's are not allowed on the Identity parameter of Get-ADUser:What you'll need to do is use the Filter parameter instead:The Read more [...]
Posted in Active Directory, PowerShell | Tagged , | Leave a comment

PowerShell Function to Prevent Starting Hyper-V VM’s that are Connected to an External Network

Beginning with Windows 8 (Professional and Enterprise Edition), Hyper-V is available on workstations that have a processor that supports SLAT (Second Level Address Translation). For specifics about the requirements, see the Client Hyper-V blog article on Microsoft TechNet. That means you have a Hypervisor running right on your desktop or laptop computer for free. With the price of hardware these days, your regular everyday computer can be spec'd out with an i7 processor, 16 gigabytes of memory, and Read more [...]
Posted in Hyper-V, PowerShell | Tagged , | Leave a comment