Skip to content
The Lazy Administrator
  • Home
  • Disclaimer
  • Contact
  • About Me
  • Search Icon

The Lazy Administrator

Finding ways to do the most work with the least effort possible

Creating a Microsoft 365 Automated Off-boarding Process with SharePoint, Graph API, and PowerShell

Creating a Microsoft 365 Automated Off-boarding Process with SharePoint, Graph API, and PowerShell

September 8, 2022 Brad Wyatt Comments 0 Comment

In this write-up I will be creating a basic off-boarding automation that uses SharePoint as the front end, and PowerShell, the Graph API, and Azure Runbooks as the back-end. HR will input the users UPN or Email, offboard date/time, and a forwarding address to forward email to. Once the off-boarding datetime is within 1hr the automation will check the user in Azure AD to ensure its valid, the forwarding user is valid in Azure AD, document in SharePoint the users e-mail address, any and all licenses, and all group memberships. After that, it will proceed with the off-boarding where it will remove all licenses from the user, remove all group memberships, and forward email to our forwarding user. It will log everything back to SharePoint where one can review it.

Off-Boarding Stages

Pending

In Pending we have just submitted our user and the automation has not seen it, or it … Continue...

Office 365 / Exchange Online Mailbox Size Report Including Mailbox Free Space with PowerShell

Office 365 / Exchange Online Mailbox Size Report Including Mailbox Free Space with PowerShell

August 27, 2022 Brad Wyatt Comments 0 Comment

I wanted to create an automated alert that would notify me of Office 365 mailboxes that were approaching full, and found a terrific PowerShell reporting script by Ruud (LazyAdmin.nl). If you have not checked out his blog, stop reading now and head on over there. There is a ton of great scripts and write ups! The script connects to your Office 365 environment and exports the following:

  • Display name
  • Primary Email address
  • Mailbox type
  • Last user action time
  • Total mailbox size
  • Mailbox Free Space (NEW!)
  • Deleted item size
  • Item Count
  • Deleted Item Count
  • Issue Warning Size
  • Prohibit Send Receive Quota (max mailbox size)
  • Archive size (if the user has an archive)
  • Archive Item Count
  • Archive Mailbox Free Space (NEW!)
  • Archive Deleted Item Count
  • Archive warning quota
  • Archive quota

 

Shared Mailboxes

It also allows you to filter the mailbox type that you want to gather results for. By … Continue...

Auto Delete Message From Yammer Community with PowerShell

Auto Delete Message From Yammer Community with PowerShell

August 25, 2022 Brad Wyatt Comments 0 Comment

I was recently tasked with clearing out a Yammer Communities auto-welcoming posts. If you are not familiar with auto-welcoming posts, Yammer used to automatically post a message whenever someone joined a community. It looked something like this, “Bradley Wyatt joined the Lazy Administrator network. Take a moment to welcome Brad.”

Thankfully, Microsoft removed this feature so your community is not littered with auto welcoming messages anymore. But, if your community existed prior to this change you may be faced with hundreds, if not thousands of these posts that you may want to remove.

  1. Register a New App so we can interface with the Yammer API
  2. Next, click “Generate a developer token for this application.” Save the token for later as you will need it.
  3. Next, navigate to the Yammer Admin page and click “Export Network Data” under Content and Security.
  4. Select the date range you want
… Continue...
Improved External Email Tagging in Office 365

Improved External Email Tagging in Office 365

August 25, 2022 Brad Wyatt Comments 0 Comment

With the rise of Phishing emails, a popular method to help your users not get phished is to append warnings to emails that either originate outside the organization or if they originate outside the organization and the display name matches that of a internal user. I myself have posted a blog on how to do this and get around the mail flow limitations.

A problem with this method however, is since it prepends a message or warning to the email, users can no longer view previews of the emails either in outlook or on mobile because all they will see is the warning message. A possible solution that I have rolled out several times is to prepend a warning unicode character (⚠️) to the message. The warning symbol was approved as part of Unicode 4.0 in 2003 and added to emoji 1.0 in 2015. As long as the receiving end … Continue...

In-Depth Look at Azure Bicep Syntax

In-Depth Look at Azure Bicep Syntax

February 21, 2022 Brad Wyatt Comments 0 Comment

If you have not checked out my other series, “Getting Started with Bicep” then I would highly suggest starting there so you can familiarize yourself with Azure Bicep including some basic syntax and how to write your first template. This article will walk you through more advanced syntax topics including output variables, loops and more!

Comments

Comments in code help you or others figure out what something may do or why it’s there in the first place. While it does not replace full documentation, it is a great way to get a picture of what your code does.

Single Line Comment

You can comment a single line of bicep code by adding ‘//’ to it. In the example below you can see my comment added to the tagging resource that we will go over next!

Multi-line Comments

Instead of adding ‘//’ to every line you want to comment … Continue...

Getting Started With Bicep: Compiling, Deploying, and Decompiling

Getting Started With Bicep: Compiling, Deploying, and Decompiling

February 11, 2022 Brad Wyatt Comments 0 Comment

In the first post of the ‘Getting Started with Bicep’ series we learned what is Azure Bicep and how to install it and begin working with it. Next, we learned how to create our first Bicep template and user parameters and variables and the different data types there are. Now, in this section we will learn how to compile our Bicep templates and deploy them to Azure.

Compile Bicep to ARM

The first item we need to do is to compile or transpile (Transpiling is a specific term for taking source code written in one language and transforming into another language that has a similar level of abstraction.) our Bicep code to ARM (JSON) code. Then, once compiled, the resulting ARM (JSON) template will be deployed to Microsoft Azure.

From our previous post on ‘Getting Started with Bicep: Building your First Bicep Template‘ we created a basic Bicep … Continue...

Getting Started with Bicep: Building Your First Bicep Template

Getting Started with Bicep: Building Your First Bicep Template

February 11, 2022 Brad Wyatt Comments 0 Comment

In the first section, Getting Started with Bicep, an ARM DSL for Azure, we went through what is Azure Bicep, and how to install Bicep on your machine. Now, we will learn how to build our first Bicep Template.

Bicep Declaration Overview

First, lets look at a Bicep declaration in a basic form:

The highlighted Resource (below) indicates the start of the declaration of a new resource in Azure to deploy.

Next, we have the Symbolic Name (in my example: stgact), which is an identifier within the Azure Bicep file. This will allow you to get the properties from the declared resource to be used in other resources elsewhere. Keep in mind, this is not the name of the Azure resource that is deployed.

Following the Symbolic Name, we have the Resource Provider.

Next, we have the Resource Type,  this is the Azure Resource Type name for the resource … Continue...

Getting Started with Bicep, an ARM DSL for Azure

Getting Started with Bicep, an ARM DSL for Azure

February 10, 2022 Brad Wyatt Comments 0 Comment

Note: This is one part of a several part blog series that goes through Azure Bicep

What is Azure Bicep

Bicep is a Domain Specific Language or DSL, for deploying Azure resources in a declarative manner. It ‘aims to drastically simplify the authoring experience with a cleaner syntax and better support for modularity and code re-use. Bicep is a transparent abstraction over ARM and ARM templates, which means anything that can be done in an ARM Template can be done in Bicep.’1

Bicep moves away from the JSON syntax used by ARM Templates to something similar to HCL in Terraform. The end result is a syntax that is easier to both read and write. Bicep code is converted into ARM Template code (JSON), and then the resulting ARM Template code (JSON) is used to deploy your Azure resources.

One of the key benefits to Bicep to another DSL like … Continue...

A PowerShell Game you can Compete with People Online – Feature Update to PSWordle

A PowerShell Game you can Compete with People Online – Feature Update to PSWordle

January 11, 2022 Brad Wyatt Comments 0 Comment

Usually, when I update items such as modules, functions, and other projects, I don’t make a new post but rather adjust the original post. But, in this case there are so many changes and new features, I felt that I had too. I will still be updating the original post so if anyone stumbles upon it they won’t be given old information. A HUGE Thank You to Lee Holmes whose PowerShell code of the Wordle logic was so good, I ended up re-writing about 90% of this module!

What is the Game?

The game is a clone of Wordle which I came across reading a New York Times article and based off my Twitter feed, is quite a popular game. The game itself is pretty simple, you have 6 attempts to guess the word. Letters that turn gray are not letters found in the word at all, yellow letters are … Continue...

Play Wordle, the Puzzle Game Using PowerShell

Play Wordle, the Puzzle Game Using PowerShell

January 4, 2022 Brad Wyatt Comments 2 comments

I recently came across a NYTimes article talking about a new game called, ‘Wordle.’ If you are not familiar with the game, its a text-based game where you have 6 tries to guess the word. Letters in a Gray box are not letters found in the word. Letters in a Yellow box are found in the word, but are in the incorrect spot. And finally, letters in a Green box are in the word and in the correct location.

After playing, I decided to see how I could transport the game over to PowerShell because why not? After a few hours I got it working and uploaded to the PowerShell Gallery so everyone can play. Below, I will talk more in depth about some of the features, how to install the module, and how to create a new game.

Install the Module

The module is uploaded to the PowerShell Gallery, … Continue...

Posts navigation

OLDER POSTS
NEWER POSTS

Subscribe

Email


Categories

  • Active Directory (8)
  • AutoPilot (2)
  • Azure (11)
  • Bicep (4)
  • Defender for Cloud Apps (1)
  • Delegated Admin (1)
  • DevOps (2)
  • Graph (1)
  • Intune (13)
  • LabTech (1)
  • Microsoft Teams (6)
  • Office 365 (19)
  • Permissions (2)
  • PowerShell (42)
  • Security (1)
  • SharePoint (2)
  • Skype for Business (1)
  • Terraform (1)
  • Uncategorized (1)
  • Yammer (1)

Recent Comments

  • Brad Wyatt on Set-ADUser: Dealing with Null Values when Importing a CSV; Working with Parameters and Properties that don’t Accept Empty Strings
  • Andrew M on Set-ADUser: Dealing with Null Values when Importing a CSV; Working with Parameters and Properties that don’t Accept Empty Strings
  • Joe D on Get a New Computer’s Auto Pilot Hash Without Going Through the Out of Box Experience (OOBE)
  • Intune Newsletter - 10th March 2023 - Andrew Taylor on Migrate your Runbooks in Azure Automation to Managed Identities
  • Timo on Configure and Deploy Intune MDM

1,087,521 People Reached

© 2023   Copyright 2020. All Rights Reserved.