Skip to content

Instantly share code, notes, and snippets.

View rdtechie's full-sized avatar
🐰
Happy Coding!

Richard Diphoorn rdtechie

🐰
Happy Coding!
View GitHub Profile
@rdtechie
rdtechie / Connect-Exchange-Online.ps1
Last active August 29, 2015 13:56
PowerShell sessie opzetten met Exchange Online
$Credentials = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $Credentials -Authentication Basic -AllowRedirection
Import-PSSession $Session
Mount-DiskImage C:\ISO\MYCDFile.ISO
Mount-DiskImage C:\VHD\VirtualMachine.VHDX
######################################################################################################
######################################################################################################
##
## Script Naam : Aanmaken-Tenant-AD-Exchange.ps1
##
## Script Versie : 1.0
##
## Script Auteur : Richard Diphoorn
##
## Script History: Versie Datum Omschrijving
######################################################################################################
######################################################################################################
##
## Script Naam : Aanmaken-Tenant-Gebruiker-AD-Exchange.ps1
##
## Script Versie : 1.0
##
## Script Auteur : Richard Diphoorn
##
## Script History: Versie Datum Omschrijving
#requires -Version 2 -Modules CimCmdlets
function Get-Uptime
{
<#
.SYNOPSIS
Get Computer Uptime
.DESCRIPTION
Get the uptime of a Computer Object by using CIM.
#requires -Version 2
#requires -PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn
$xDays = 90
Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails UserMailbox |
ForEach-Object -Process {
$MailboxStats = Get-MailboxStatistics -Identity $_.DistinguishedName
$si = Get-MailboxFolderStatistics -Identity $_.DistinguishedName -IncludeOldestAndNewestItems -FolderScope SentItems

How To Install Ansible and Azure Preview Modules on Ubuntu 18.04

This little guide explains the way how to install Ansible and the Azure Preview Modules in a virtualenv on Ubuntu 18.04. It also makes use of a wrapper for virtualenv, to make it easier to use virtualenv.

Prerequisites

sudo apt-get update
sudo apt-get install -y software-properties-common
sudo apt-get install -y python-setuptools python-dev libffi-dev libssl-dev git sshpass tree
sudo apt-get install python-pip

Easy method to get the external ip address from where you are located with PowerShell:

Invoke-RestMethod -Uri https://ifconfig.io/ip

or shorter:

irm ifconfig.io/ip
{
"properties": {
"displayName": "Enforces a required tag and its value.",
"description": "Enforces a required tag and its value on resources that supports tagging.",
"mode": "indexed"
},
"policyRule": {
"if": {
"allOf": [
{