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/.


Command Line of Docker

docker exec -it NameOfContainer /bin/bash

Tech Quip: Allowing Office 365 Sharepoint Sharing Outside of Organization

Original source:

$usercredential = Get-Credential -username $adminUPN -Message "type password"
Connect-SPOService -Url https://$ -Credential $userCredential
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



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