PowerShell Basics: Connecting to Exchange Online Using Multi-Factor Authentication

Using PowerShell to manage your Microsoft cloud services like Exchange Online and using multi-factor authentication (MFA) separately is awesome. Using the two together however, not so much. Microsoft documentation on this topic seems to suggest that all the required administrative tasks needed are to be performed from a shell that launched separately from the PowerShell…


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…


DevOps Basics: Harnessing Continuous Integration and Infrastructure As Code

Hello folks, A little while ago, Vancouver based start-up Roomsy and Microsoft collaborated in a Hackfest to explore how Azure Web App services and DevOps best practices could address their needs. Roomsy is a cloud-based Property Management System. It provides its customer a platform to manage their rental property, take reservations that are created through…


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…


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