Skip to content

Instantly share code, notes, and snippets.

View KentNordstrom's full-sized avatar

Kent Nordström KentNordstrom

View GitHub Profile
@KentNordstrom
KentNordstrom / CreateSyncStatisticDB.ps1
Last active April 22, 2018 10:08
Scripts to save synchronization statistics (Pending Exports) to SQL
<#
.SYNOPSIS
Script that creates SQL DB to store Pending Exports in MIM MAs into SQL for Statistical analysis.
#>
PARAM([string]$SQLServer = "dbFIMSync", [string]$DBName = "FIMSyncStatistics",[string]$ScheduleAccount="AD\svcMIMAdmin")
#region Modules
Import-Module LithnetMIISAutomation
Import-Module SqlServer
@KentNordstrom
KentNordstrom / BeginImport.ps1
Created April 15, 2018 14:43
Use the Microsoft Generic PowerShell Connector to connect to MS Graph
param (
[System.Collections.ObjectModel.KeyedCollection[[string], [Microsoft.MetadirectoryServices.ConfigParameter]]] $ConfigParameters,
[PSCredential] $PSCredential,
[Microsoft.MetadirectoryServices.OpenImportConnectionRunStep] $OpenImportConnectionRunStep,
[Microsoft.MetadirectoryServices.Schema] [ValidateNotNull()] $Schema
)
[string]$watermark = $OpenImportConnectionRunStep.CustomData #Used if Delta Import
if($OpenImportConnectionRunStep.ImportType -eq 'Delta' -and !$watermark){throw ("Full Import Required. No watermark found.")}
@KentNordstrom
KentNordstrom / RemoveMultiValueValues.ps1
Last active November 12, 2018 18:04
Remove Values from MultiValue Attribute
<#
.SYNOPSIS
Script to remove values from MultiValue attribute based on search criteria.
#>
PARAM(
[string]$MultiValueAttribute = 'emailAlias',
[ValidateSet("StartsWith","EndsWith","Equals")]
[string]$SearchType,
[string]$SearchValue = '@domain.onmicrosoft.com',
@KentNordstrom
KentNordstrom / SetDBAlias.ps1
Created March 16, 2017 13:31
Add/Update your SQL Aliases using PowerShell
<#
.SYNOPSIS
This script adds/updates SQL Aliases on the local machine.
It can be implemented as function in your deployment scripts when installing FIM/MIM
or other application using SQL Aliases.
#>
PARAM([string]$AliasName,[string]$TargetServer,[string]$TargetPort="1433")
#Alias to be added to local machine
$dbAlias = "DBMSSOCN,$TargetServer,$TargetPort"
@KentNordstrom
KentNordstrom / BulkUpdateFromCsv.ps1
Last active June 6, 2022 19:02
Bulk update objects in FIM/MIM based on CSV file
<#
.SYNOPSIS
Example script to bulk update users from CSV file.
The CSV file needs to have columnnames in row 1.
Columnnames need to correspond to the attribute name in FIM/MIM.
The column specified as "anchor" will not be updated all other columns will be updated based on content in csv file.
Multivalue and Reference data types are not supported in this version.
The script requires that the Lithnet Power Shell module is installed on the computer running the script.
The account running the script requires write permission to all attributes in the csv file except for the anchor attribute.
#>