Skip to content

Instantly share code, notes, and snippets.

View JanVidarElven's full-sized avatar

Jan Vidar Elven JanVidarElven

View GitHub Profile
@JanVidarElven
JanVidarElven / New-AadApp1803.1_OfflineToken.ps1
Created March 16, 2018 15:12
Offline token version for register Azure AD App for Project Honolulu 1803 when on Windows Server 1709 or other Server Core
<#########################################################################################################
File: New-AadApp.ps1
Copyright (c) Microsoft Corp 2017.
.SYNOPSIS
Creates a web app in AAD and registers it with the SME gateway.
.DESCRIPTION
@JanVidarElven
JanVidarElven / ManageAzureADAppProxyConnector.ps1
Last active April 27, 2018 11:00
AzureADAppProxyConnector
# AzureAD PowerShell CmdLets to Manage Azure AD App Proxy Connector
# Connect to Azure AD
Connect-AzureAD
# Retrieve Application Proxy Connectors
Get-AzureADApplicationProxyConnector | Select-Object Id, MachineName, ExternalIp, Status
# Get Application Proxy Connectors by Filter
Get-AzureADApplicationProxyConnector -Filter "startswith(MachineName,'ELVEN')"
@JanVidarElven
JanVidarElven / CreateAzureADAppProxyApplication.ps1
Last active April 27, 2018 11:01
AzureADAppProxyApplication
# AzureAD PowerShell CmdLets to Manage Azure AD App Proxy Applications
# Connect to Azure AD
Connect-AzureAD
# Create a new Application Proxy Application with required values
New-AzureADApplicationProxyApplication -DisplayName "Project Honolulu NUC" `
-ExternalUrl "https://projecthonolulunuc-elven.msappproxy.net/" `
-InternalUrl "https://ELVEN-NUC-HV1.nuc.group"
# Azure AD v2 PowerShell Quickstart Connect
# Connect with Credential Object
$AzureAdCred = Get-Credential
Connect-AzureAD -Credential $AzureAdCred
# Connect with Modern Authentication
Connect-AzureAD
# Explore some objects
@JanVidarElven
JanVidarElven / AzureADTokenPolicy.ps1
Last active November 5, 2018 22:10
AzureADTokenPolicy.ps1
# Azure AD v2 PowerShell Token Lifetime Policy
# Connect with Modern Authentication
Connect-AzureAD
# See if there are any existing Azure AD Policies defined
Get-AzureADPolicy
# Defaults for NEW tenants:
# Refresh Token Inactivity: 90 Days
# Connect to Azure AD
Connect-AzureAD
# Get All Azure AD Devices
$aadDevices = Get-AzureADDevice -All $true
# Explore Device Object
$aadDevices | Get-Member
# Azure AD PowerShell CmdLets for Managing Privileged Roles
# Connect to Azure AD
Connect-AzureAD
# Azure AD v2 PowerShell Module CmdLets for working with Extension Attribute Properties
# Connect to Azure AD with Global Administrator
Connect-AzureAD
# Get a User and Read Extension Properties
$aadUser = Get-AzureADUser -ObjectId <youruser>
$aadUser | Select -ExpandProperty ExtensionProperty
# Serialize User Object to JSON
# Description: Sets Azure AD Connect Password Write Back AD Permissions
# Created by: Jan Vidar Elven, Enterprise Mobility MVP, Skill AS
# Last Modified: 01.06.2016
# Run this on-premises for your domain/forest
Import-Module ActiveDirectory
#region Initial Parameters/Variables
# Domain Controller in wanted domain, leave blank if using current domain
swagger: '2.0'
info: {title: JanVidarElven Github Connector, description: GitHub API Connector for
JanVidarElven, version: '1.0'}
host: api.github.com
basePath: /
schemes: [https]
consumes: []
produces: []
paths:
/repos/{owner}/{repo}/contents/{path}: