This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Invoke-TestMailboxMove { | |
param ( | |
[Parameter(Mandatory)] | |
[ValidateNotNullOrEmpty()] | |
$UserList | |
) | |
end { | |
$AcceptedDomains = (Get-AcceptedDomain).DomainName | |
$RoutingAddress = $AcceptedDomains -match '.mail.onmicrosoft.com' | |
foreach ($User in $UserList) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Remove-TenantAddress { | |
<# | |
.SYNOPSIS | |
Remove all mailbox addresses with one more more domains/words | |
.DESCRIPTION | |
Remove all mailbox addresses with one more more domains/words | |
.PARAMETER Domains | |
List of domains or words to find in the email addresses |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for /F "tokens=1,2 delims= " %G in ('cmdkey /list ^| findstr Target') do cmdkey /delete %H |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'******************************************************************************* | |
' Name: OLicenseCleanup.vbs - v 1.15 | |
' Author: Microsoft Customer Support Services | |
' Copyright (c) Microsoft Corporation | |
' | |
' Removes all licenses for Office 2013 and 2016 | |
' from the (Office) Software Protection Platform | |
'******************************************************************************* | |
'Option Explicit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$licrem = join-path $env:temp OfficeProPlusLicenseRemoved.txt | |
if (-not (Test-Path $licrem)) { | |
$license = cscript "C:\Program Files (x86)\Microsoft Office\Office16\OSPP.VBS" /dstatus | |
$o365 = 'LICENSE NAME' | |
for ($i = 0; $i -lt $license.Length; $i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$AllMailboxes = Import-Clixml -Path (Join-Path ([Environment]::GetFolderPath("Desktop")) AllMailboxes.xml) | |
$del = for ($i = 0 ; $i -lt $AllMailboxes.Count; $i++) { | |
[pscustomobject]@{ | |
Count = $i | |
DisplayName = $AllMailboxes[$i].displayname | |
PrimarySmtpAddress = $AllMailboxes[$i].PrimarySmtpAddress | |
OU = $AllMailboxes[$i].OrganizationalUnit | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$AllMailboxes = Import-Clixml -Path (Join-Path ([Environment]::GetFolderPath("Desktop")) AllMailboxes.xml) | |
$del = for ($i = 0 ; $i -lt $MailboxCount; $i++) { | |
[pscustomobject]@{ | |
Count = $i | |
DisplayName = $AllMailboxes[$i].displayname | |
PrimarySmtpAddress = $AllMailboxes[$i].PrimarySmtpAddress | |
OU = $AllMailboxes[$i].OrganizationalUnit | |
} | |
} | |
$del | Export-csv -Path (Join-Path -Path ([Environment]::GetFolderPath("Desktop")) -ChildPath 'NumberedMailboxes.csv') -NoTypeInformation -Encoding UTF8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (-not (Get-Module ActiveDirectory -listavailable)) { | |
Write-Host "Please run from a computer with AD module" -ForegroundColor Red | |
break | |
} | |
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force -ErrorAction SilentlyContinue | |
function Get-MailboxMoveOnPremisesPermissionReport { | |
[CmdletBinding()] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
az login | |
az account set --subscription 'Visual Studio Enterprise' | |
az group create --name poshcore4 --location 'EASTUS2' | |
az servicebus namespace create --resource-group 'poshcore4' --name 'poshcore4' --location 'EASTUS2' --sku Basic | |
az servicebus queue create --resource-group 'poshcore4' --namespace-name 'poshcore4' --name messages --lock-duration "0:00:30" --default-message-time-to-live "0:01:00" --max-delivery-count 10 --max-size 1024 --enable-partitioning false --enable-dead-lettering-on-message-expiration true | |
az servicebus queue authorization-rule create --resource-group 'poshcore4' --namespace-name 'poshcore4' --queue-name messages --name receive --rights Listen |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-ExchangeDistributionGroup { | |
<# | |
.SYNOPSIS | |
Export Office 365 Distribution Groups & Mail-Enabled Security Groups | |
.DESCRIPTION | |
Export Office 365 Distribution & Mail-Enabled Security Groups | |
.PARAMETER ListofGroups | |
Provide a text list of specific groups to report on. Otherwise, all groups will be reported. |