About: Evan Schmitke

Recent Posts by Evan Schmitke

Uninstalling Exchange from an AD Environment

These instructions are useful to remove the Exchange server from an AD environment completely. Note that users email accounts must have been moved elsewhere.

Disable (DO NOT DELETE) mailboxes using ECM Console

Get-Mailbox -Arbitration | disable-mailbox -Arbitration -DisableArbitrationMailboxWithOABsAllow –DisableLastArbitrationMailboxAllowed
Get-Mailbox -AuditLog | Disable-Mailbox 
Get-Mailbox -Monitoring | Disable-Mailbox
(Thanks JitenSH https://community.spiceworks.com/topic/2003351-uninstall-exchange-2016)

$dbs = Get-MailboxDatabase (this will create a variable with the database name)
Get-Mailbox -Database $dbs (will list all remaining mailboxes. In my case it was the discovery search mailbox)

Delete the Discovery Search mailbox:
Get-Recipient *search* (this will display the full name of the discovery mailbox)
Remove-Mailbox "NAME FROM ABOVE"

Use Control Panel to uninstall exchange.

Sources used:
https://community.spiceworks.com/topic/2003351-uninstall-exchange-2016
https://docs.microsoft.com/en-us/exchange/security-and-compliance/in-place-ediscovery/delete-and-re-create-default-discovery-mailbox

...

Upload Files to SharePoint Online

Special thanks to Shane Young https://www.youtube.com/channel/UC7_OGRP8BYvtGB8eZdPG6Ng

Powershell admin credentials

install-Module -Name SharePointPnPPowerShellOnline

Assign file to a variable:

$Variable = get-ChildItem location\file.ext

Add-PnpFile -Path $cow -Folder "Document Library Use Quotes" -Values @{Modified=VARIABLE.LastWriteTimeUtc;Created=VARIABLE.CreationTimeUtc}

Get-ChildItem '\server\share'
ForEach-Object {
Add-PnpFile -Path $_.FullName -Folder "Shared Documents" -Values @{Modified=$_.LastWriteTimeUtc;Created=$_.CreationTimeUtc}
}

...

Hard Matching on Prem users with Azure AD Users

When implementing Azure AD Sync in an existing Office 365 tenant with populated users it is sometimes necessary to hard match users to ensure that On-Prem users are not created as new users in Office 365.

Typically I will install AD Sync and try soft matching first (where email address and upn name are matched. If duplicates get created, pause AD-Sync, Delete the newly created users from Office 365. Purge them from the recycle bin:

Connect-MsolService
Get-MsolUser -ReturnDeletedUsers
Remove-MsolUser -UserPrincipalName EMAILADDRESSHERE -RemoveFromRecycleBin

Once the user(s) have been deleted you can match them by their immutableID. Run this in PowerShell on the Domain Controller.

$credential = Get-Credential
Connect-MsolService -Credential $credential
$ADUser = "username" 
$365User = "username@emaildomainname.com"
$guid =(Get-ADUser $ADUser).Objectguid
$immutableID=[system.convert]::ToBase64String($guid.tobytearray())
Set-MsolUser -UserPrincipalName... 						
						

Recent Comments by Evan Schmitke

    No comments by Evan Schmitke yet.