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

Manage and Administer SharePoint using SharePointPnP.PowerShell

Manage and Administer SharePoint using SharePointPnP.PowerShell

August 20, 2018 Brad Wyatt Comments 1 comment

The SharePoint Development Community (also known as the SharePoint PnP community) is an open-source initiative coordinated by SharePoint engineering. This community controls SharePoint development documentation, samples, reusable controls, and other relevant open-source initiatives related to SharePoint development1 .

The SharePointPnP.PowerShell module is quite vast when it comes to managing and administrating your on-premise or SharePoint online environment. Before we dive into it you will first want to install it so you have all the cmdlets available to you.

SharePoint Version Command to install
SharePoint Online Install-Module SharePointPnPPowerShellOnline
SharePoint 2016 Install-Module SharePointPnPPowerShell2016
SharePoint 2013 Install-Module SharePointPnPPowerShell2013

Note: This will be an on-going article. As I continue using this module I will update this article.


Connecting to SharePoint

In my environment I have SharePoint with Office 365 so I will be connecting to SharePoint Online. For testing purposes I will be working in one of my test sites so I will … Continue...

[Tool] Create and Configure Active Directory and Office 365 Users at Once.

[Tool] Create and Configure Active Directory and Office 365 Users at Once.

July 11, 2018 Brad Wyatt Comments 58 comments

One of the things IT Administrators look to automate first is the new user creation process. I recently was going through the process of creating a new hires Active Directory login, Office 365 mailbox, and their Office 365 user account, and I wondered how I could make the process easier and quicker.

My focus was geared towards Managed Service Providers (MSP’s), Human Resource (HR) departments and general Help Desk Technicians. For MSP’s I wanted to create a tool that they could easily use across all of their clients because they may not spend the time to automate new user creations because they have hundreds, if not thousands of clients to tend to, and each client is unique so you can’t just copy the same automation script from one client to another. This would also be a huge asset for Help Desk technicians because they are more often than not the … Continue...

Create an Interactive HTML Report for Office 365 with PowerShell

Create an Interactive HTML Report for Office 365 with PowerShell

June 22, 2018 Brad Wyatt Comments 39 comments

From time to time you may get clients or even managers requesting reports about their Office 365 environment. Another popular reason to compile a report on an Office 365 tenant would be when you take over a new client and you are auditing their environment trying to figure out what exactly is going on.

Click here to view the report as we go through it.

Using the PowerShell module “ReportHTML“, we can create beautiful and interactive HTML reports. Below I will walk you through a report I spent some time creating that includes tabs, charts, data tables and more.  Below you can see the first page of my report. You can navigate to different content by clicking the tab. If you wanted to view the Users report you would just click on that tab.

Report Overview

Dashboard

The Dashboard contains some basic information about the Office 365 tenant … Continue...

Office 365 Report Using Excel COM Interface with PowerShell

Office 365 Report Using Excel COM Interface with PowerShell

April 12, 2018 Brad Wyatt Comments 2 comments

I set out to explore a way to generate a nice, multi-sheet, Office 365 report that I could give to end-user’s or Office Manager’s using PowerShell. Unfortunately, I read about the Excel COM interface before reading about the Excel PowerShell module created by Doug Finke. If you are starting from scratch, I would recommend reading up on the PowerShell Module instead of going the COM route as it’s a easier to use that the Excel COM Interface. Regardless, I finished my PowerShell script and wanted to share it for others to use.

Pre-requisites

Not a lot of pre-reqs for this script and I designed it that way. At first it was reliant on an Excel Workbook that was pre-formatted how I liked, and it would populate the data specifically for that workbook only. However, I decided to have PowerShell format the Excel Workbook from scratch as it ran. So for … Continue...

Create a Real Time Interactive Dashboard for Office 365 Using PowerShell Universal Dashboard

Create a Real Time Interactive Dashboard for Office 365 Using PowerShell Universal Dashboard

April 9, 2018 Brad Wyatt Comments 6 comments

If you have never heard of PowerShell Universal Dashboard you need to head on over to PoshUD right now and check out this awesome PowerShell Module. Using PowerShell Core, Material Design, ReactJS and ASP.NET Core, Universal Dashboard takes advantage of cutting-edge technology to provide cross-platform, cross-device dashboards that looks sleek and modern.1

While reading over some other posts about what other people have done with PowerShell Universal Dashboard, I wondered if there was a way to create a interactive dashboard that would hook into Office 365 and gather data from it. At first, I attempted to create a dashboard that would create a PSSession to Office 365 but it presented some problems and overall was quite slow. I then decided to use the Microsoft Graph REST API to connect to Office 365. This allows it to refresh the data within in the dashboard quickly and takes seconds to connect.… Continue...

Auto License Office 365 Migration Users Prior to Completing the Migration

Auto License Office 365 Migration Users Prior to Completing the Migration

April 6, 2018 Brad Wyatt Comments 1 comment

When doing a migration to Office 365, one of the final steps prior to “flipping” the user in the migration batches, is to make sure to properly license them so once they flip they get an Exchange Online mailbox. One of the issues you will come across is you will have more users in Office 365 than you are migrating. This is very common because some users may not need Exchange services but may need other Office 365 offerings such as OneDrive, SharePoint, etc. This also happens when you use ADConnect to sync on-premise Active Directory users to Office 365 and again, not everyone will be needing an Exchange mailbox. However, prior to completing your migration batch jobs is all the users in the batches must have a proper license for Exchange.

Instead of going through user objects one by one, I created a script that will do the following:… Continue...

Email Users If Their Active Directory Password is set to Expire Soon

Email Users If Their Active Directory Password is set to Expire Soon

March 28, 2018 Brad Wyatt Comments 59 comments

In this article I will show you how PowerShell can automatically send an e-mail notification to end users when their Active Directory password is set to expire soon. I looked over several other similar scripts on TechNet but ended up writing one from scratch to incorporate several features I needed, as well as improve on the overall script flow.

Some of the requirements I needed to meet were as follows:

  1. Get users email addresses from the Email Address value in Active Directory, if it’s empty look at the default address in the proxyaddresses attribute
  2. Send E-mail to users with passwords that were expiring in 7 days or less
  3. Include directions users can follow to reset their Active Directory password
  4. Send E-mail with high priority
  5. Get E-mail notification if sent or failed
  6. Store the credential in a Cred object so it’s secure
  7. Advanced logging on the script for troubleshooting
  8. Send E-mail
… Continue...
[Function] Export Report of Unused Office 365 Licenses Across Multiple Tenants or a Single Tenant Using Friendly License Names

[Function] Export Report of Unused Office 365 Licenses Across Multiple Tenants or a Single Tenant Using Friendly License Names

March 26, 2018 Brad Wyatt Comments 8 comments

Even if a license is not assigned to an Exchange Online object does not mean it’s not being charged back to the tenant. If you work for a MSP or IT Consultant you may want to audit your clients Office 365 tenant for any licenses that are not assigned so they are not paying for licenses that they do not need.

While looking up ways to accomplish this task I came across this script from GCITS. If you have never read any of GCITS’s knowledge-base write ups I recommend you start following their blog posts as they have some of the best write ups, especially for MSP’s, and IT Consultants. The problem with the script is that it exported the unused license count for all licenses including licenses that had zero unused licenses. It also exported the license SKU instead of converting it to a friendly name. If you have … Continue...

Connect to the Microsoft Graph API with PowerShell

Connect to the Microsoft Graph API with PowerShell

March 20, 2018 Brad Wyatt Comments 0 Comment

This article will show you how to work with the Graph API using a PowerShell module. If you want to learn how to work with the API with only PowerShell please visit this article: https://www.thelazyadministrator.com/2019/07/22/connect-and-navigate-the-microsoft-graph-api-with-powershell/

 

The Microsoft Graph API is a REST API provided by Microsoft for integrating and managing Office 365 Exchange Online, OneDrive for Business, and Azure AD. It allows for application developers to integrate their apps with those Microsoft Services. Management of the environment is also possible but requires understanding of OAuth and REST.¹

By using the PowerShell module PSMSGraph we can interact with the Graph API in a more PowerShell friendly way. The MSMSGraph module is an API wrapper. It seeks to take the “foreign” concepts of REST and OAuth and make them accessible and usable in PowerShell. This module strives to make PowerShell administration and automation tasks via the Microsoft Graph API more like … Continue...

Remotely Install Office ProPlus / Update Office Configuration on Client Computers with PowerShell

Remotely Install Office ProPlus / Update Office Configuration on Client Computers with PowerShell

March 20, 2018 Brad Wyatt Comments 2 comments

There are some immediate perks for using PowerShell to either install an application on remote computers or update an applications configuration remotely. In this post I will do several things, Install Office 365 ProPlus to a remote computer, and update the configuration of Office 365 ProPlus on the remote machine, having it go from the Monthly channel to the Semi-Annual channel and also removing groove.exe and lync.exe (Skype for Business).

When updating the configuration the install is silent and the EULA is accepted by setting <Display Level=“None” AcceptEULA=“TRUE”/>.  When you set FORCEAPPSHUTDOWN to false, Office applications can be used during the upgrade but its recommended to restart the client workstation at the end of the install. I have also seen it not able to update if certain office applications are running. It’s recommended to set FORCEAPPSHUTDOWN to TRUE to close the office applications while … Continue...

Posts navigation

OLDER POSTS
NEWER POSTS

Subscribe

Email


Categories

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

Recent Comments

  • Kristopher Gates on Getting Started with GitHub Copilot in the CLI
  • MD SHARIQUE AKHTAR on Modern Active Directory – An update to PSHTML-AD-Report
  • TommyBoich on How The ConnectWise Manage API Handles Pagination with PowerShell
  • LOTTERY 365 LOGIN on Windows LAPS Management, Configuration and Troubleshooting Using Microsoft Intune
  • SPRUNKI PHASE 6 on Get a New Computer’s Auto Pilot Hash Without Going Through the Out of Box Experience (OOBE)

1,739,247 People Reached

© 2025   All Rights Reserved.