Category: Programming

  • Activate Azure roles and resources with PowerShell

    My new PowerShell script, Request-AzureADRolesV4.ps1, simplifies managing roles and permissions in Azure Active Directory (Azure AD). It streamlines the process of requesting and assigning Azure AD roles, offering efficiency and reliability for IT professionals. Streamlined Azure Role Management Azure AD administrators often face the challenge of balancing security with ease of use. Assigning roles typically…

  • Powershell and Log Analytics – Tips and Tricks #1

    Working with Gzip compressed base64 data The following two PowerShell functions will compress or depress text using Gzip, and the result will be base64 encoded. When working with Sentinel incidents, some of the included incident data can be Gzip compressed and base64 encoded. As such, you may need to turn the base64 encoded Gzip data…

  • Storing secrets securly in Windows

    One of the challenges with scripting / programming is securely storing passwords or API secrets across many different languages. Most of what i develop runs in Windows and as such it made sense to tap into the ProtectedData API and the Windows Registry. PowerShell Code Powershell Usage C# Code C# Usage Python Code Python Usage

  • Easily save and load C# classes using XML Serialization

    These two functions below have saved me a lot of time, you simply create a class with variables inside it and then pass said class to the two functions below:

  • PowerShell exporting data easily from MsSQL into a CSV document

    PowerShell has a module to assist with this, you can find out all the specifics at https://docs.microsoft.com/en-us/sql/powershell/download-sql-server-ps-module. I was asked to pull data and export it to a CSV to save time, which is easy to do with Task Scheduler and PowerShell.

  • PowerShell Tid Bits #1

    The more I use power shell the more I realize you can do just about anything you could do with visual studio and C#. I haven’t found a comprehensive source for all the little differences between C# and powershell but the following are some things to take note of: