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…


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 Tips: Managing Local Users and Groups

Windows Server 2016, when launched, will demand IT Professionals to become more proficient at utilizing PowerShell. While some have begun to dabble with the TechNet Script Repository, some are still a little frightened due to the perception that PowerShell is hard to learn let alone remember. PowerShell can be the great time saver if harnessed…