Powershell Basics: Retrieving Azure Key Vault Certificate

Microsoft’s Azure Key Vault manages cryptographic keys and certificates used by cloud applications and services. Some instances may require the use of said certificate stored in Azure Key Vault on a computer, or some hosted service. Use of PowerShell is the quickest way to accomplish this via the following steps: With the Azure PowerShell tools…


Powershell Basics: Using Variables In ActiveDirectory Filters

When working with the ActiveDirectory PowerShell module, the -filter parameter is sometimes required to search for accounts or objects in Active Directory. Utilization of variables in those filters may also be required to return a needed value. As an example, running the following command from the remote Exchange management shell returns an object that includes…


PowerShell Basics: Detecting if a String Ends with a Certain Character

Did you know you can detect if a string ends in a specific character, or if it starts in one in PowerShell? This can be doe easily with the use of regular expressions or more simply know as Regex. Consider the following examples: ‘something\’ -match ‘.+?\\$’ #returns true ‘something’ -match ‘.+?\\$’ #returns false ‘\something’ -match…


PowerShell Basics: How to Validate the Length of an Integer

Recently I fielded the following PowerShell question: “How do I make sure a variable, which is an int, is of a certain length?” Turns out it’s not too hard as the solution simply requires the use of a little regex. Consider the following example:   [int]$v6 = 849032 [int]$v2 = 23 $v6 -match ‘^\d{6}$’ $v2 -match ‘^\d{6}$’…


PowerShell Basics: Listing the number of services each user has per server

Infrastructure audits can be fun right? While they can be tedious at best, most IT Professionals are prepared via the use of Operations Management Suite or other 3rd party software that can literally produce a report in minutes (depending on infrastructure size of course!) What about if you don’t have access to these tools? Fear not…

1

Powershell Basics: Prompt To Copy File If It Does Not Exist

The PowerShell command Copy-Item will overwrite a file if it exists by default. This is unless that file is marked Read Only in which case you can use the -Force switch to overwrite the file. What if you want to only copy the file if it doesn’t exist? Here’s a quick PowerShell script that will complete…


PowerShell Basics: Retrieve All The Security Patches Installed On A Server Since A Specific Date

I recently needed to acquire a list of all the security patches installed on a group of servers within the last year. I discovered that there is a WMI class for this which makes it super easy to retrieve this info. get-wmiobject win32_quickfixengineering -ComputerName $CompName | ? { $_.InstalledOn -gt (get-date).addyears(-1) } Within the win32_quickfixengineering class, you’ll find all the…


Nano Server Image Builder

Hello folks, I was looking at some questions i got in my last user group sessions where we were discussing Microsoft Windows Server 2016.  i was going to answer one of them in this post. “how do you hardcode an IP address in Nano server?”. BUT,  i decided at the last minutes to switch my…

0

Step-by-Step: Setup Docker on your Windows 2016 Server

  Hello Folks a couple weeks ago i was delivering a session on Windows Server 2016.  During that session i covered the Container support in Windows Server 2016. I see huge possibilities with containers.  I’m far from a Docker expert but I’m diving head first in that pool.   Anyway,  like i was saying i…

0

Step-By-Step: Installing MySQL on Nano Server via PowerShell

Recently, Pierre Roman was in town presenting 10 Things I like About Windows Server 2016 to the Toronto ITPRO Usergroup. While presenting, he white-boarded a couple of questions for Pierre and I to address on CANITPRO.NET later via a blog post. One such question was as follows: “Can you install SQL on a Nano Server?”…

0