Skip to content

Instantly share code, notes, and snippets.

View exactmike's full-sized avatar

Mike Campbell exactmike

View GitHub Profile
@exactmike
exactmike / Get-SharePointSiteSize.ps1
Created October 15, 2019 00:40
SharePoint report functions
<#
.SYNOPSIS
Gets and exports a csv format Storage Report for all sites in all web applications
.DESCRIPTION
Gets and exports a csv format Storage Report for all sites in all web applications
.EXAMPLE
Get-SharePointSiteSize.ps1 -FilePath SiteSizeReport.csv
Gets a report of storage usage for all sites in all web apps on the attached farm and exports it to SiteSizeReport.csv in the current path
.INPUTS
[string]
@exactmike
exactmike / PlannerMigration.ps1
Created November 11, 2019 22:51 — forked from AlexanderHolmeset-zz/PlannerMigration.ps1
Microsoft Planner Tenant To Tenant Migration
### Microsoft Planner Tenant To Tenant Migration Script ###
### ###
### Version 1.0 ###
### ###
### Author: Alexander Holmeset ###
### ###
### Twitter: twitter.com/alexholmeset ###
### ###
### Blog: alexholmeset.blog ###
@exactmike
exactmike / ExportOffice365Configuration.ps1
Last active February 18, 2020 15:59
A script to install and use the Office365DSC PowerShell Module to export an Office 365 Tenant's Configuration
[cmdletbinding()]
param(
#Specify the username to use for extracting Office 365 Configuration. Should be Global Admin or Equivalent Read access. The script will prompt for password.
[parameter()]
[string]$UserName
,
#Path to a directory for the output of the script. Any existing output may be overwritten. If the directory does not exist, it will be created if possible.
[string]$Path
)
@exactmike
exactmike / AADDocumentationRunner.ps1
Last active August 5, 2020 15:27
AAD Documentation Runner
Start-Process -NoNewWindow -FilePath .\AzureADConnectSyncDocumenterCmd.exe -ArgumentList 'org\Production org\Production'
@exactmike
exactmike / Export-ExchangeConfiguration.ps1
Last active November 11, 2020 22:29
Export an Exchange Org's Configuration
[cmdletbinding()]
param(
[parameter(Mandatory)]
[ValidateScript( { Test-Path -type Container -Path $_ })]
[string]$OutputFolderPath
,
[parameter(Mandatory)]
[ValidateSet('Online', 'Exchange2013+')]
[string]$OrganizationType
)
@exactmike
exactmike / CustomRBACForDGs.md
Last active June 23, 2023 21:12
Exchange 2013 End User Distribution Group Management

Distribution Group Management for End Users

Overview

When end users mailboxes are migrated to Exchange Online from Exchange on premises the users' ability to manage email enabled on premises directory distribution groups in Microsoft Outlook is impacted. The users' Outlook is no longer connecting to the on premises directory service. While Outlook will have visibility to the synchronized representation of the on premises email enabled distribution groups those synchronized groups are not directly editable in the online directory.

As an alternative to using Outlook to manage Distribution Groups users have access to the Exchange Control Panel (ECP), a web interface that is a native part of Microsoft Exchange for end user and administrative access to Exchange features. However, access to the ECP for end users is typically tied to having a Mailbox in the same Exchange environment. Because of this dependency for typical ECP access by end users, when a user mailbox is migrated to Exchange Online, the user's

@exactmike
exactmike / GetAzureADUserByAnAttribute.ps1
Last active August 21, 2020 18:43
Getting Azure AD Users by a Filterable Attribute
function Get-AzureADUserByAttribute
{
<#
.SYNOPSIS
Get Azure AD users by an arbitrary filterable attribute, such as MailNickName.
.DESCRIPTION
Get Azure AD users by an arbitrary filterable attribute, such as MailNickName.
.EXAMPLE
$list = Import-CSV .\TempTestUsers.csv
@exactmike
exactmike / Send-OutlookMail.ps1
Last active January 22, 2021 14:46
Functions for Outlook Automation with PowerShell
Function Send-OutlookMail
{
[cmdletbinding()]
param(
[parameter()]
[string]$Subject
,
[parameter()]
$Body
,
@exactmike
exactmike / EdgeBrowserProfileShortcuts.ps1
Last active September 4, 2020 13:11
Powershell Function Development
#From https://www.joseespitia.com/2020/02/07/automatically-create-microsoft-edge-profile-shortcuts/
$EdgeProfiles = Get-ChildItem "$env:LOCALAPPDATA\Microsoft\Edge\User Data" | Where-Object { $_.Name -like "Profile *" }
ForEach ($EdgeProfile in $EdgeProfiles.Name)
{
# Get Profile Name
$Preferences = "$env:LOCALAPPDATA\Microsoft\Edge\User Data\$EdgeProfile\Preferences"
$Data = (ConvertFrom-Json (Get-Content $Preferences -Raw))
$ProfileName = $Data.Profile.Name
@exactmike
exactmike / Export-ExchangeConfiguration.ps1
Created February 10, 2022 17:35
Scripts to Export Exchange Configuration
[cmdletbinding()]
param(
[parameter(Mandatory)]
[ValidateScript( { Test-Path -type Container -path $_ })]
[string]$OutputFolderPath
,
[switch]$ExchangeOnline
)
$ErrorActionPreference = 'Continue'