Tuesday, October 23, 2018

Call Azure Function from Powershell

I was fooling around with Azure Functions and wanted to try calling a Webhook function from Powershell. I just wanted to test a simple function from Powershell

I kept getting an error saying that 'The underlying connection was closed: An unexpected error occurred on a send' when I used Invoke-RestMethod.

Turns out that for some reason, you have to force Powershell  on TLS 1.2

When I ran this command to do that -

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

it worked and I got my 200 OK response.

To reset, you can run this command -

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls

Hope this helps anyone out there struggling.


Friday, September 14, 2018

Powershell MA version released

Glad to announce that the Powershell MA has a new version out. It's has been a while since the last release since there has been no reports of bugs or any feature request lately, the previous version seems to be pretty stable.

This new version hasn't changed all that much and there are no breaking changes either. It has, however, a new feature that I personally have missed from time to time; an extra parameter $Schema is added to the Import and Export scripts. And as you may have guessed, it is an PSObject that describes the schema for the particular MA. Having this information allows you to build a little more dynamic into your Powershell scripts used with the PSMA.

Also, a litte logging / tracing bug has been fixed. It is something, you may not have noticed but now it is fixed. It has to do with how the PSMA catches Write-Warning and Write-Error output from your scripts. Remember, you can set your $WarningPreference, $ErrorPreference and other preferences such as Verbose and Debug in your scripts and have the PSMA pick up any output from these statements and output to the Trace log.

Anyways, give the new version of the MA a spin and let me know if you can how it goes.


Monday, July 16, 2018

Microsoft Identity Manager 2016 SP1 hotfix ( Released

A new hotfix for MIM 2016 has been released. A little interesting note is the support for Group Managed Service Accounts that is mentioned in the release notes. I'll have to dig further into that.

Anyway, you can grab it here - https://blogs.technet.microsoft.com/iamsupport/2018/07/16/support-release-mim2016-microsoft-identity-manager-2016-sp1-hotfix-4-5-26-0-released/

See you in the metaverse,

Thursday, April 19, 2018

Saving FIM / MIM configuration

Just a quick note with a small Powershell script that I made to export configuration for the Synchronization Engine. I use this script on and off at customers to make sure that we can get back to a former state - or move existing configuration from environment to environment when building.

Feel free to use and modify

$miispath = 'C:\Program Files\Microsoft Forefront Identity Manager\2010\Synchronization Service\Bin\',
$extensionspath = 'C:\Program Files\Microsoft Forefront Identity Manager\2010\Synchronization Service\Extensions\',
$maexport = ( join-path $miispath 'maexport.exe' ),
$svrexport = ( join-path $miispath 'svrexport.exe' ),
$exportdir = 'export-config'
$date = (get-date).tostring('yyyy-MM-dd')

# create base folders with current date
$madir = join-path (join-path (join-path . $exportdir ) $date) 'ma'
write-debug $madir
$null = new-item -path $madir -type directory -force

$svrdir = join-path (join-path (join-path . $exportdir ) $date) 'svrexport'
write-debug $svrdir
$null = new-item -path $svrdir -type directory -force

$extdir = join-path (join-path (join-path . $exportdir ) $date) 'extensions'
write-debug $extdir
$null = new-item -path $extdir -type directory -force

$managementagents = @(get-wmiobject -class "MIIS_ManagementAgent" -namespace "root\MicrosoftIdentityIntegrationServer" -computername ".") 
if($managementagents -eq 0) {throw "There is no management agent configured"}

foreach ($ma in $managementagents)
& $maexport $ma.name (join-path $madir "$($ma.name).xml")

copy $extensionspath\*.* $extdir

& $svrexport $svrdir


Sunday, November 26, 2017

Codeplex down, Github up!!!

I finally got around to moving all my FIM/MIM projects from Codeplex to Github. If you use any of the following FIM projects of mine, please consider changing all links and maybe following the projects on Github now.

FIM/MIM SQL Management Agent - https://github.com/sorengranfeldt/sqlma
FIM 2010 Workflow Activity Library - https://github.com/sorengranfeldt/fimactivitylibrary
Codeless Provisioning Framework, FIM.MRE - https://github.com/sorengranfeldt/mre
FIM/MIM MA Rules Extension Framework - https://github.com/sorengranfeldt/mare

I still need to visit the documentations and fix a few mistakes after migration - I'll do that in the near future.

Søren Granfeldt