Skip to content

Instantly share code, notes, and snippets.

@FH-Inway
FH-Inway / Add-AudienceUriInWifConfig.ps1
Last active December 31, 2023 16:10
Adds an Entra app registration id as audienceUri in a D365FO wif.config
# Adds an audienceUri entry to the WIF configuration file
# Original script: https://gist.github.com/FH-Inway/5b5e86a4eb7ee8cd1670c6a8599d8f1e
param(
[Parameter(Mandatory)]
[Alias('AppId', 'ClientId')]
[string]$AudienceUri,
[string]$WifConfigPath = 'K:\AosService\webroot\wif.config'
)
@FH-Inway
FH-Inway / Upload.log
Created March 7, 2024 15:57
Upload to LCS pipeline run
2024-03-07T15:47:44.4754820Z ##[section]Starting: Upload package and deploy it
2024-03-07T15:47:44.6364725Z ##[section]Starting: Initialize job
2024-03-07T15:47:44.6368238Z Agent name: 'Hosted Agent'
2024-03-07T15:47:44.6368623Z Agent machine name: 'fv-az527-964'
2024-03-07T15:47:44.6368775Z Current agent version: '3.236.1'
2024-03-07T15:47:44.6413381Z ##[group]Operating System
2024-03-07T15:47:44.6413593Z Microsoft Windows Server 2022
2024-03-07T15:47:44.6413786Z 10.0.20348
2024-03-07T15:47:44.6413879Z Datacenter
2024-03-07T15:47:44.6414032Z ##[endgroup]
@FH-Inway
FH-Inway / cgeo-system-info.md
Created April 5, 2024 18:38
c:geo system information

System information

c:geo version: 2024.04.05-NB-bf2adb3

Device:

  • Device type: SM-S906B (g0sxeea, samsung)
  • Available processors: 8
  • Android version: 14
  • Android build: UP1A.231005.007.S906BXXS7DXBD
@FH-Inway
FH-Inway / Exceptions.ipynb
Created May 5, 2024 10:36
.Net Interactive Polyglot notebook with "invalid" cell
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FH-Inway
FH-Inway / New-AzureAppRedirectURLs.ps1
Last active March 26, 2026 07:24
Create full D365FO CHE Entra integration #D365FO
# Add additional redirect URLs to an Azure Application.
# Based on https://blog.icewolf.ch/archive/2022/12/02/create-azure-ad-app-registration-with-microsoft-graph-powershell
# original gist: https://gist.github.com/FH-Inway/d55993312d1bb1aa2d63adfeed9946f3
[CmdletBinding()]
param (
[Parameter(Mandatory = $true, HelpMessage = "The object ID of the Azure Application.")]
[String]
$AppObjectId,
@FH-Inway
FH-Inway / Import-D365EntraIdUser.log
Created June 22, 2024 16:29
Example output from first draft of Import-D365EntraIdUser
PS K:\Repositories\GitHub\d365fo.tools> import-D365EntraIdUser -Users $user -TenantId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ClientId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -CertificateName "CHEAuth"
[18:20:21][Connect-MicrosoftGraph] Connecting to Microsoft Graph
VERBOSE: [18:20:21][Import-UserList] Getting tenant from [email protected].
VERBOSE: [18:20:21][Import-UserList] Getting domain from [email protected].
VERBOSE: [18:20:21][Get-InstanceIdentityProvider] The found instance identity provider is: https://sts.windows.net/example.com/
VERBOSE: [18:20:21][Get-CanonicalIdentityProvider] Loading dll files to do some work against the CanonicalIdentityProvider.
VERBOSE: [18:20:21][Get-CanonicalIdentityProvider] Executing the CanonicalIdentityProvider lookup logic.
VERBOSE: [18:20:21][Get-CanonicalIdentityProvider] CanonicalIdentityProvider is: https://sts.windows.net/
VERBOSE: [18:20:21][Import-UserList] InstanceProvider : https://sts.windows.net/example.com/
VERBOSE: [18:20:21][Import-UserList] Tenant : exampl
@FH-Inway
FH-Inway / Untitled-1.ipynb
Created June 23, 2024 12:00
New notebook with valid first F# code cell and invalid second cell
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FH-Inway
FH-Inway / DefaultTopologyDataWithRetail.xml
Last active April 4, 2025 15:32
Dynamics 365 Finance and Operations topology file
<?xml version="1.0" encoding="utf-8"?>
<!--
To populate topology data for command line package installation, refer to:
https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/deployment/install-deployable-package#collect-topology-configuration-data
-->
<TopologyData xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Name>AX topology</Name>
<MachineList>
<Machine>
<Name>localhost</Name>
@FH-Inway
FH-Inway / New-EntraIDAndD365FOUser.ps1
Created August 3, 2024 10:27
D365FO User Management Automation
# This script creates a new guest user in Azure Entra ID and a list of
# Microsoft Dynamics 365 Finance and Operations environments.
# It takes the user's tenant id, email address, first and last name as input parameters.
# It also takes an array of Azure Entra ID group IDs to which the user should be added.
# It uses the existing d365fo.integrations configurations to determine the environments
# where the user is to be added with the system administrator security role.
# Install the PowerShell module "Microsoft.Graph" if it is not already installed.
# Install-Module -Name Microsoft.Graph.Authentication -Scope CurrentUser -Force
# Install-Module -Name Microsoft.Graph.Users -Scope CurrentUser -Force
$models = Get-D365Model -BinDir "C:\Users\UnifiedDevExpTest01\AppData\Local\Microsoft\Dynamics365\10.0.1935.29\PackagesLocalDirectory\bin" -PackageDirectory "C:\Users\UnifiedDevExpTest01\AppData\Local\Microsoft\Dynamics365\10.0.1935.29\PackagesLocalDirectory" -Verbose
$module = "AAA"
$model = $module
$metadataDir = "C:\Repositories\MyRepo\Metadata"
$packagesLocalDirectory = "C:\Users\UnifiedDevExpTest01\AppData\Local\Microsoft\Dynamics365\10.0.1935.29\PackagesLocalDirectory"
$binDir = "$packagesLocalDirectory\bin"
$logPath = "C:\Temp\d365fo.tools\Logs"
$params = @{
Module = $module