Skip to content

Instantly share code, notes, and snippets.

Avatar

Jon Bryan jkbryan

View GitHub Profile
@jkbryan
jkbryan / shouldprojecttomv-example.vb
Created Oct 2, 2018
shouldprojecttomv-example.vb
View shouldprojecttomv-example.vb
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.
@jkbryan
jkbryan / full-wbadmin-backup-script.vbs
Created Oct 2, 2018
full-wbadmin-backup-script.vbs
View full-wbadmin-backup-script.vbs
ForceScriptEngine("cscript")
Const ForReading = 1
strComputer = "."
strDate = Replace(FormatDateTime(Date(),2),"/","-")
set objShell = CreateObject("WScript.Shell")
strComputer = objShell.ExpandEnvironmentStrings("%COMPUTERNAME%")
strUserDomain = objShell.ExpandEnvironmentStrings( "%USERDOMAIN%")
'Build the structure of file locations, recipients, log files etc....
strSharePath = "\\server\share\Backups"
strDomainPath = strSharePath & "\" & strUserDomain
@jkbryan
jkbryan / clear-adou-attribute.ps1
Last active Oct 2, 2018
clear-adou-attribute.ps1
View clear-adou-attribute.ps1
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!
View export-policy.ps1
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."
}
@jkbryan
jkbryan / example-html-mail-template.html
Created Oct 2, 2018
example-html-mail-template.html
View example-html-mail-template.html
<!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>
View sample-xoml.xoml
<ns0:SequentialWorkflow
ActorId="00000000-0000-0000-0000-000000000000"
RequestId="00000000-0000-0000-0000-000000000000"
x:Name="SequentialWorkflow"
TargetId="00000000-0000-0000-0000-000000000000"
WorkflowDefinitionId="00000000-0000-0000-0000-000000000000"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/workflow" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ns0="clr-namespace:Microsoft.ResourceManagement.Workflow.Activities;Assembly=Microsoft.ResourceManagement, Version=4.1.3559.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<ns0:EmailNotificationActivity x:Name="emailNotificationActivity1" To="##xmlref:myRecipient1:ObjectID##" CC="{x:Null}" EmailTemplate="##xmlref:ObuCreate:ObjectID##" SuppressException="False" Bcc="{x:Null}" />
</ns0:SequentialWorkflow>
@jkbryan
jkbryan / samplexml-mt-wf-set-mpr-creation.xml
Created Oct 2, 2018
samplexml-mt-wf-set-mpr-creation.xml
View samplexml-mt-wf-set-mpr-creation.xml
<?xml version="1.0" encoding="utf-8" ?>
<Lithnet.ResourceManagement.ConfigSync>
<Variables>
<Variable name="#domain#" value="%userdomain%"/>
<Variable name="#PATH#" value =".\" />
</Variables>
<Operations>
<!-- Create Reference to Recipient -->
<ResourceOperation operation="None" resourceType="Person" id="myRecipient1">
<AnchorAttributes>
@jkbryan
jkbryan / samplexml-mt-wf-mail-recipient.xml
Last active Oct 2, 2018
samplexml-mt-wf-mail-recipient.xml
View samplexml-mt-wf-mail-recipient.xml
<ResourceOperation operation="None" resourceType="Person" id="myRecipient1">
View xoml-sample.xoml
To="##xmlref:myRecipient1:ObjectID##;##xmlref:myRecipient2:ObjectID##" CC="{x:Null}" EmailTemplate="##xmlref:---Create:ObjectID##"
View template-job-list.xml
<!-- Create --- Create Email Template -->
<ResourceOperation operation="Add Update" resourceType="EmailTemplate" id="---Create">
<AnchorAttributes>
<AnchorAttribute>DisplayName</AnchorAttribute>
</AnchorAttributes>
<AttributeOperations>
<AttributeOperation operation="replace" name="DisplayName">__MT:---Create</AttributeOperation>
<AttributeOperation operation="replace" name="Description">--- User Creation Notification</AttributeOperation>
<AttributeOperation operation="replace" name="EmailTemplateType">Notification</AttributeOperation>
<AttributeOperation operation="replace" name="EmailBody" type="file">#PATH#Templates\---USERCREATED.HTML</AttributeOperation>