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
function sudo | |
{ | |
$file, [string]$arguments = $args; | |
$psi = new-object System.Diagnostics.ProcessStartInfo $file; | |
$psi.Arguments = $arguments; | |
$psi.Verb = "runas"; | |
$psi.WorkingDirectory = get-location; | |
[System.Diagnostics.Process]::Start($psi); | |
} |
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
#Simple script to change all Unified Groups (Office 365 Groups) Primaty SMTP email address to a new domain. | |
#It's recomended to have a diferent email domain for Office 365 Groups, so they dont conflict with regular user and system mailboxes. | |
$groups = get-unifiedgroup | select-object name,alias | |
Foreach ($group in $groups) { | |
Set-UnifiedGroup –Identity "$($group.name)" –PrimarySmtpAddress "$($group.alias)@groups.contoso.com" | |
} |
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
$DomainNames = @( | |
'domA.dk', | |
'domB.dk' | |
) | |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
Foreach ($Domain IN $DomainNames) { |
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 | |
This script will map network drives to a specified fileserver (ment to be used as an Intune PowerShell script) | |
.DESCRIPTION | |
The script will test the connection to the domain (via FQDN), in case it fails, there is an option to make it retry again one minute later. | |
If all fails, it will skip the mapping of the drives. | |
.EXAMPLE | |
Just run this script without any parameters in the logged in users context (as an Intune Extensions Powershell script). | |
.NOTES | |
NAME: ps_map_drives.ps1 |
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
<?xml version="1.0" encoding="utf-16"?> | |
<policyDefinitions revision="1.0" schemaVersion="1.0"> | |
<policyNamespaces> | |
<target prefix="outlk16" namespace="outlk16.Office.Microsoft.Policies.Windows" /> | |
<using prefix="windows" namespace="Microsoft.Policies.Windows" /> | |
</policyNamespaces> | |
<supersededAdm fileName="outlk16" /> | |
<resources minRequiredRevision="1.0" /> | |
<categories> | |
<category name="L_MicrosoftOfficeOutlook" displayName="$(string.L_MicrosoftOfficeOutlook)" /> |
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
# PS-BGInfo | |
# Powershell script that updates the background image with a random image from a folder and writes out system info text to it. | |
# run as a lower priority task | |
[System.Threading.Thread]::CurrentThread.Priority = 'BelowNormal' | |
# Configuration: | |
# Font Family name | |
$font="Input" |
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
# As a default, sharing links with anyone is disabled on Office 365 groupSites, which in turn also means Microsoft Teams Sites. | |
# Even if you have Anyone sharing enabled at the tenant level! | |
# This script can help y remove that requirement from a specific site. | |
# MIT licensing, keep author credits if reusing | |
# Author: Michael Mardahl @michael_mardahl on twitter | |
# https://github.com/mardahl | |
Install-Module -Name Microsoft.Online.SharePoint.PowerShell | |
ipmo Microsoft.Online.SharePoint.PowerShell |
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
<# | |
.DESCRIPTION | |
Quick and dirty script to limit the creation of Office 365 Group or Microsoft Teams (Teams) to a specific security group in Azure AD (or One Synced form on-prem AD) | |
#> | |
#security group that is allowed to create Office 365 Groups | |
$secGroup = "Teams Creation Administrators" | |
#importing AzureAD Module (should be installed!) | |
try { | |
Import-module AzureADPreview |
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
function VerifyCertificateExists($issuer, $templateName){ | |
#function that validates existence of required certificate. | |
#input issuer and template name (wildcards will automatically be added). | |
#example : VerifyCertificateExists -issuer "myCompany" -templateName "myCertTemplate" | |
#MIT license - github.com/mardahl | |
try { | |
Write-Verbose "Verifying existence of required certificate..." -Verbose | |
$certs = Get-ChildItem -Path cert:\currentuser\my | Where-Object Issuer -like "*$issuer*" -ErrorAction Stop | |
$cert = $certs | Where-Object{ $_.Extensions | Where-Object{ ($_.Oid.Value -eq '1.3.6.1.4.1.311.21.7') -and ($_.Format(0) -like "*$templateName*") }} -ErrorAction Stop | |
if(!$cert){throw} |
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
#This script will create a send connector that can relay through exchange online protection in Office 365 | |
#Must be run from the on prem Exchange Management Shell | |
#WARNING: This will use the wildcard * for sending, so please consider changing "addressSpaces" to some testing domains, so you know this works before routing everything. | |
#WARNING: You must remove your existing internet send connector if you wish for this to work with 100% of all email. | |
#Author: @michael_mardahl (github.com/mardahl) | |
#License: MIT - please keep author credits. | |
$hybridConnector = Get-SendConnector *365* | |
$smartHost = Resolve-DnsName $hybridConnector.AddressSpaces.Address -Type MX |
OlderNewer