AWS Things that Aren’t Spelled Out: Restoring an EBS Snapshot as the Root Device

If you’re attempting to install updates or make config changes, it helps to have a backup of your environment. In AWS, it’s easy to make EBS snapshots, but if you make a snapshot of your root device, it’s not obvious how to restore it.

  1. Create a new volume from the snapshot you’d like to return to.
  2. Detach the Root device EBS volume from your instance.
  3. Attach the new volume under the following device: /dev/sda1

If you try to boot without a root device, AWS will give an error about /dev/sda1 missing, but oddly when you add a block device, you enter them in the xvd[a-z] format, and leave off the /dev/.

Docker

Command Line of Docker


docker exec -it NameOfContainer /bin/bash

Tech Quip: Allowing Office 365 Sharepoint Sharing Outside of Organization

Original source:
http://itgroove.net/brainlitter/2017/06/01/enable-guest-folder-file-sharing-office-365-group-files/

https://www.microsoft.com/en-ca/download/details.aspx?id=35588

$adminUPN="replace_with_username"
$orgName="name_of_sharepoint_prefix"
$usercredential = Get-Credential -username $adminUPN -Message "type password"
Connect-SPOService -Url https://$orgName-admin.sharepoint.com -Credential $userCredential
$siteurl="https://$orgName.sharepoint.com/sites/desired_site_collection"
set-sposite -identity $Siteurl -sharingcapability ExternalUserAndGuestSharing

Code Dump: Remove Active Sync Devices Older than 90 Days

Get-CASMailbox -ResultSize unlimited -Filter{(HasActiveSyncDevicePartnership -eq $true) -AND (name -notlike "cas_*") -AND (name -notlike "DiscoverysearchMailbox*")} | ForEach {Get-mobileDeviceStatistics -Mailbox:$_.Identity | Where-Object {$_.LastSuccessSync -le (Get-Date).AddDays("-90")}} | Remove-MobileDevice

Code Dump: Change UPN for all members of an AD Group

$ADGROUP="TEST"
$OLDUPN="@OLDDOMAIN.COM"
$NEWUPN="@NEWDOMAIN.COM"

$GRPMEM=Get-ADGroupMember $ADGROUP

Get-ADGroupmember $ADGROUP | ForEach-Object {
$USER=Get-ADUser $_.samaccountname
$UPN = $USER.UserPrincipalName.Replace($OLDUPN,$NEWUPN)
Set-ADUser $USER.samaccountname -UserPrincipalName $UPN
}