This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#region declarations | |
$apikey = 'axxxxxxxxxxxxxxxxx6a4f5bxxxxxxxxxxxxx' | |
$email = 'xxxxxxxxx@xxxxxxxxx.xxx' | |
$accountid = 'b6xxxxxxxxxxxxxxxxx8e57xxxx' | |
$domains = $(Get-Content .\domains.txt) #text file with 1 domain per line | |
#endregion declarations | |
#region execute | |
foreach ($domain in $domains){ | |
$headers = @{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Connect to Office 365 Exchange (wont work if MFA is required. | |
#Use conditional access or whitelisting to allow the connection without MFA | |
$LiveCred = Get-Credential | |
$Session = New-PSSession -ConfigurationName Microsoft.Exchange-ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection | |
Import-PSSession $Session | |
#Get list fo All Room type mailboxes | |
$rooms = Get-MailBox | where {$_.ResourceType -eq "Room"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Script to force update Skype for Business Clients Global Address List Written by Michael Mardahl (iphase.dk) | |
(Provided AS-IS! I will not be held liable for any negative consequences) | |
.DESCRIPTION | |
This script will shutdown the SfB client, update the registry and delete the GAL DB, then start the client again. It should be run in the users context as it does user specific things. | |
.EXAMPLE | |
Just run the script without parameters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Clean out MDM registration info from machine, in attempt to fix Intune enrollment problems with Windows 10 | |
# after a user reboots, the enrollment process should kick off again. | |
# This special edition, also disables workplace join, as an attempt to mitigate issues with devices previously AAD Registered. | |
# This script has fixed Error codes 0x80180023 and 0x8018002b at some of my customers sites, even without reboot in some cases. | |
# By Michael Mardahl @ Apento.com - @michael_mardahl | |
# Should be run as system user | |
#Disable workplace join if that is happening beyond your control. | |
#Get-ScheduledTask -TaskName "Automatic-Device-Join" | Disable-ScheduledTask |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Generates 100 random bitlocker recovery key ID and keys | |
#By Michael Mardahl github.com/mardahl | |
#Use it for whatever... | |
$hash = @{} | |
for($i = 0;$i -lt 100;$i++) { | |
$id = "$(Get-Random -minimum 100 -maximum 999)$((97..102) | Get-Random -Count 1 | % {[char]$_})$(Get-Random -minimum 100 -maximum 999)$((97..102) | Get-Random -Count 1 | % {[char]$_})-$(Get-Random -minimum 100 -maximum 999)$((97..102) | Get-Random -Count 1 | % {[char]$_})-$(Get-Random -minimum 100 -maximum 999)$((97..102) | Get-Random -Count 1 | % {[char]$_})-$(Get-Random -minimum 100 -maximum 999)$((97..102) | Get-Random -Count 1 | % {[char]$_})-$(Get-Random -minimum 100 -maximum 999)$((97..102) | Get-Random -Count 1 | % {[char]$_})$(Get-Random -minimum 100 -maximum 999)$((97..102) | Get-Random -Count 1 | % {[char]$_})$((97..102) | Get-Random -Count 1 | % {[char]$_})$(Get-Random -minimum 10 -maximum 99)$((97..102) | Get-Random -Count 1 | % {[char]$_})" | |
$key = "$(Get-Random -minimum 100000 -maximum 999999)-$(Get-Random -minimum 100000 -maximu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
REM Description: Small helper script to quickly start an AADSync but just double clicking on this script file. | |
REM Author: Michael Mardahl - github.com/mardahl | |
echo Starting AD Sync (Delta)... | |
powershell.exe -ex bypass -command "ipmo adsync;Start-ADSyncSyncCycle delta;" | |
echo Finished script execution. | |
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#license MIT | |
#Author Michael Mardahl github.com/mardahl | |
#region declarations | |
$env:CF_API_KEY = 'axxxxxxxxxxxxxxxxxxxx' | |
$env:CF_API_EMAIL= 'xxxxxxx@xxxxxx.xxx' | |
$domains = $(Get-Content .\domains.txt) #text file with 1 domain per line | |
#endregion declarations | |
#region execute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Define central storage for the log files to be collected. | |
#Make sure all users that run this script have write permissions on this share | |
$logFile = "\\fileserver.domain.local\share\$($env:USERNAME)_OutlookAccounts.csv" | |
#Testing for Outlook 2013 and newer | |
If (Test-Path 'hkcu:\Software\Microsoft\Office\15.0\Outlook\Profiles') { | |
$regPath = 'hkcu:\Software\Microsoft\Office\15.0\Outlook\Profiles\*\9375CFF0413111d3B88A00104B2A6676\*' | |
}elseif(Test-Path 'hkcu:\Software\Microsoft\Office\16.0\Outlook\Profiles'){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try{ | |
Connect-ExchangeOnline -ErrorAction Stop | |
} catch { | |
Throw "Failed to logon to Exchange Online" | |
} | |
$dkim = Get-DkimSigningConfig | |
foreach($obj in $dkim){ | |
Write-Host "Enabling 2048-bit DKIM for $($obj.Domain)" -ForegroundColor Green |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#requires -RunAsAdministrator | |
Set-ExecutionPolicy Bypass -Confirm:$false -Force | |
Install-Module ExchangeOnlineManagement | |
Import-Module ExchangeOnlineManagement | |
try{ | |
Connect-ExchangeOnline -ErrorAction Stop | |
} catch { | |
Throw "Failed to logon to Exchange Online" | |
} |
NewerOlder