Skip to content

Instantly share code, notes, and snippets.

View eugenedauphin's full-sized avatar

Eugene Dauphin eugenedauphin

View GitHub Profile
@eugenedauphin
eugenedauphin / AdminOneDriveforBusiness.ps1
Created January 21, 2015 11:36
Get administrative access to the OneDrive for Business environment of a user
$site = Get-SPOSite -Identity https://mydemo-my.sharepoint.com/personal/sarad_mydemo_onmicrosoft_com
Set-SPOUser -Site $site.Url -LoginName admin@mydemo.onmicrosoft.com -IsSiteCollectionAdmin $true
@eugenedauphin
eugenedauphin / StoreCredentials.ps1
Last active December 11, 2015 14:13
Store your Office 365 Credentials to easily connect with Windows PowerShell
# +----------------------------------------------------------------------------+
# | Author : Eugène Dauphin |
# | File : StoreCredentials.ps1 |
# | Version : 1.1 |
# | Purpose : Store credentials for a tenant |
# | |
# | Synopsis: |
# | Usage : .\StoreCredentials.ps1 .\FolderNameOfConnection |
# +----------------------------------------------------------------------------+
# | Maintenance History |
Set-SPOsite <SiteURL> -DenyAddAndCustomizePages 0
Connect-SPOnline -Url "https://tenant.sharepoint.com/sites/contoso" -Credentials $cred
Get-MsolUser | Set-MsolUser -PreferredLanguage "nl-nl"
Get-Mailbox | Get-MailboxRegionalConfiguration | Set-MailboxRegionalConfiguration -Language nl-nl -DateFormat "d-M-yyyy" -TimeFormat "HH:mm" -TimeZone "W. Europe Standard Time"
Get-ADUser -SearchBase "OU=Optional,OU=Accounts,DC=demo,DC=nl" -Filter * -Properties PreferredLanguage | ForEach-Object {Set-ADUser $_.SAMAccountName –replace @{PreferredLanguage="nl-NL"}}
$ctx = Get-SPOContext
$web = Get-SPOWeb
function AddSupportedUILanguageToWeb($web)
{
$web.Url
$web.IsMultilingual = $true
$web.AddSupportedUILanguage(1043)
$web.Update()
@eugenedauphin
eugenedauphin / Connect.ps1
Last active January 25, 2017 14:01
Easily connect to your Office 365 tenant with Windows PowerShell
# +----------------------------------------------------------------------------+
# | Author : Eugène Dauphin |
# | File : Connect.ps1 |
# | Version : 1.1 |
# | Purpose : Connect to an Office 365 Tenant |
# | |
# | Synopsis: |
# | Usage : .\Connect.ps1 .\FolderNameOfConnection |
# +----------------------------------------------------------------------------+
# | Maintenance History |
#r "Newtonsoft.Json"
using System;
using System.Net;
using Newtonsoft.Json;
public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log)
{
// parse query parameter
string lat = req.GetQueryNameValuePairs()