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
$Subscription = "<Subscription-GUID>" | |
$ApplicationName = "<AppName>" | |
$ServicePrincipal = Get-AzureRMADServicePrincipal -DisplayName $ApplicationName | |
Set-AzureRmContext -Subscription $Subscription | |
$NewRole = $null | |
$Retries = 0; | |
While ($NewRole -eq $null -and $Retries -le 6) { | |
Sleep 15 | |
New-AzureRMRoleAssignment -ResourceGroupName -RoleDefinitionName Reader -ServicePrincipalName $ServicePrincipal.ApplicationId | Write-Verbose -ErrorAction SilentlyContinue | |
$NewRole = Get-AzureRMRoleAssignment -ObjectId $ServicePrincipal.Id -ErrorAction SilentlyContinue |
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
# | |
# OpenSSL example configuration file. | |
# This is mostly being used for generation of certificate requests. | |
# | |
# This definition stops the following lines choking if HOME isn't | |
# defined. | |
HOME = . | |
RANDFILE = $ENV::HOME/.rnd |
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
'Within the "Public Class MAExtensionObject" section, add: | |
'Date & Logginglevel variables for logging files: | |
Dim dtDateNowDay As Integer = Date.Now.Day | |
Dim dtDateNowMonth As Integer = Date.Now.Month | |
Dim dtDateNowYear As Integer = Date.Now.Year | |
Dim loggingLevel As Integer = 0 | |
'================================================ | |
'With the Sub or Function that you want logging - e.g. "Public Sub MapAttributesForImport" | |
Dim dtFileTime As DateTime | |
'Define Logfile Name then setup the logfile |
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
Case "employeeEndDate-CDRMA-PA-Import" | |
'CDR attributes required are: EndDate | |
'Code to define the employeeEndDate in the MV and Portal - needs to be in the correct format! | |
Dim dtFileTime As DateTime | |
If csentry("EndDate").IsPresent Then | |
dtFileTime = DateTime.Parse(csentry("EndDate").Value).Date | |
'Convert to the date/time string format that the Portal requires: | |
Dim employeeEndDate As String = dtFileTime.ToLocalTime.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.000'") | |
Dim arremployeeEndDate As String() = Split(employeeEndDate, "T") | |
employeeEndDate = arremployeeEndDate(0) & "T23:59:59.000" |
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
Public Function FilterForDisconnection(ByVal csentry As CSEntry) As Boolean Implements IMASynchronization.FilterForDisconnection | |
'Filter to prevent those who are not being returned by the CDR FIM View from being presented by this table (which contains lots of historical data!) | |
Dim dtFileTime As DateTime | |
Dim dtDateNow As DateTime = Date.Now | |
'CS attributes required are: pid, enddate | |
If csentry("pid").IsPresent And csentry("enddate").IsPresent Then | |
dtFileTime = DateTime.Parse(csentry("EndDate").Value).AddDays(190) | |
If dtFileTime <= dtDateNow Then | |
'employeeEndDate has passed, so disconnect | |
FilterForDisconnection = True |
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
Case "functionalIDFlag-ADMA-Import" | |
If csentry.DN.ToString.ToLower.Contains("functional") Then | |
mventry("functionalID").Value = "True" | |
ElseIf csentry.DN.ToString.ToLower.Contains("ou=fim") Then | |
mventry("functionalID").Value = "True" | |
ElseIf csentry("employeeID").IsPresent Or csentry("stfc-pid").IsPresent Then | |
'Real users - e.g. those created by the User Office process and those historical users no longer in CDR | |
mventry("functionalID").Value = "False" | |
Else | |
Throw New Exception("FunctionalID flag setting for: " & csentry.DN.ToString.ToLower) |
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
Public Function ShouldProjectToMV(ByVal csentry As CSEntry, ByRef MVObjectType As String) As Boolean Implements IMASynchronization.ShouldProjectToMV | |
If csentry.DN.ToString.ToLower.Contains("functional") Then | |
MVObjectType = "functionalID" | |
ShouldProjectToMV = True | |
ElseIf csentry.DN.ToString.ToLower.Contains("fimaccess") Then | |
'Those people who need to administer FIM, need a user account in the portal, so treat them as such and Project! | |
MVObjectType = "person" | |
ShouldProjectToMV = True | |
ElseIf csentry("employeeID").IsPresent Then | |
'Real users - e.g. those created by the User Office process and those historical users no longer in CDR (Initial Pre-Load) - But CDR is authoratative for all new users - so Projection occurs there also - this handles "normal" users - e.g. those fed from CDR directly. |
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
Import-Module LithnetRMA | |
# Setup the XPath Query - get all users | |
$z=New-XPathQuery -AttributeName AccountName -Operator IsPresent | |
# Use that query in the XPath Expression | |
$Query=New-XPathExpression -ObjectType Person -QueryObject $z | |
# Do the search | |
$Users=Search-Resources -XPath $query -AttributesToGet AccountName, adOU | |
ForEach ($u in $users) | |
{ | |
# If adOU is not NULL, then make it so! |
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
if(@(get-pssnapin | where-object {$_.Name -eq "FIMAutomation"} ).count -eq 0) {add-pssnapin FIMAutomation} | |
$workDir = "C:\FIMConfig\Temp\" | |
$policy_filename = $workDir+"FIM-Policy.xml" | |
Write-Host "Exporting configuration objects from pilot." | |
# In many production environments, some Set resources are larger than the default message size of 10 MB. | |
$policy = Export-FIMConfig -policyConfig -portalConfig -MessageSize 9999999 | |
if ($policy -eq $null) | |
{ | |
Write-Host "Export did not successfully retrieve configuration from FIM. Please review any error messages and ensure that the arguments to Export-FIMConfig are correct." | |
} |
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
<!DOCTYPE html> | |
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>OBU Account created</title> | |
</head> | |
<body> | |
<h1 style="padding-left: 30px; font-family: verdana; font-size: 150%">OBU Account created</h1> | |
<h2 style="padding-left: 30px; font-family: verdana; font-size: 150%">Attributes:</h2> |