Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule....

54
New-ADSyncRule ` -Name 'In from AD - User Join' ` -Identifier 'bc569ac8-e987-4272-bf34-74de72068b69' ` -Description '' ` -Direction 'Inbound' ` -Precedence 100 ` -PrecedenceAfter '00000000-0000-0000-0000-000000000000' ` -PrecedenceBefore '00000000-0000-0000-0000-000000000000' ` -SourceObjectType 'user' ` -TargetObjectType 'person' ` -Connector '9792d5d0-7815-4880-85e2-3e5de264452e' ` -LinkType 'Provision' ` -SoftDeleteExpiryInterval 0 ` -ImmutableTag 'Microsoft.InfromADUserJoin.003' ` -OutVariable syncRule Add-ADSyncAttributeFlowMapping ` -SynchronizationRule $syncRule[0] ` -Source @('sAMAccountName') ` -Destination 'cloudFiltered' ` -FlowType 'Expression' ` -ValueMergeType 'Update' ` -Expression 'IIF(IsPresent([isCriticalSystemObject]) || IsPresent([sAMAccountName]) = False || [sAMAccountName] = "SUPPORT_388945a0" || Left([mailNickname], 14) = "SystemMailbox{" || Left([sAMAccountName], 4) = "AAD_" || (Left([mailNickname], 4) = "CAS_" && (InStr([mailNickname], "}") > 0)) || (Left([sAMAccountName], 4) = "CAS_" && (InStr([sAMAccountName], "}") > 0)) || Left([sAMAccountName], 5) = "MSOL_" || CBool(IIF(IsPresent([msExchRecipientTypeDetails]),BitAnd([msExchRecipientTypeDetails], &H21C07000) > 0,NULL)) || CBool(InStr(DNComponent(CRef([dn]),1),"\\0ACNF:")>0), True, NULL)' ` -OutVariable syncRule Add-ADSyncAttributeFlowMapping ` -SynchronizationRule $syncRule[0] ` -Source @('objectGUID') ` -Destination 'sourceAnchorBinary' ` -FlowType 'Direct' ` -ValueMergeType 'Update' ` -OutVariable syncRule New-Object ` -TypeName 'Microsoft.IdentityManagement.PowerShell.ObjectModel.ScopeCondition' ` -ArgumentList 'isCriticalSystemObject','TRUE','NOTEQUAL' ` -OutVariable condition0 New-Object ` -TypeName 'Microsoft.IdentityManagement.PowerShell.ObjectModel.ScopeCondition' ` -ArgumentList 'adminDescription','User_','NOTSTARTSWITH' `

Transcript of Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule....

Page 1: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

New-ADSyncRule `-Name 'In from AD - User Join' `-Identifier 'bc569ac8-e987-4272-bf34-74de72068b69' `-Description '' `-Direction 'Inbound' `-Precedence 100 `-PrecedenceAfter '00000000-0000-0000-0000-000000000000' `-PrecedenceBefore '00000000-0000-0000-0000-000000000000' `-SourceObjectType 'user' `-TargetObjectType 'person' `-Connector '9792d5d0-7815-4880-85e2-3e5de264452e' `-LinkType 'Provision' `-SoftDeleteExpiryInterval 0 `-ImmutableTag 'Microsoft.InfromADUserJoin.003' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('sAMAccountName') `-Destination 'cloudFiltered' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsPresent([isCriticalSystemObject]) || IsPresent([sAMAccountName]) = False || [sAMAccountName] = "SUPPORT_388945a0" || Left([mailNickname], 14) = "SystemMailbox{" || Left([sAMAccountName], 4) = "AAD_" || (Left([mailNickname], 4) = "CAS_" && (InStr([mailNickname], "}") > 0)) || (Left([sAMAccountName], 4) = "CAS_" && (InStr([sAMAccountName], "}") > 0)) || Left([sAMAccountName], 5) = "MSOL_" || CBool(IIF(IsPresent([msExchRecipientTypeDetails]),BitAnd([msExchRecipientTypeDetails],&H21C07000) > 0,NULL)) || CBool(InStr(DNComponent(CRef([dn]),1),"\\0ACNF:")>0), True, NULL)' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('objectGUID') `-Destination 'sourceAnchorBinary' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

New-Object `-TypeName 'Microsoft.IdentityManagement.PowerShell.ObjectModel.ScopeCondition' `-ArgumentList 'isCriticalSystemObject','TRUE','NOTEQUAL' `-OutVariable condition0

New-Object `-TypeName 'Microsoft.IdentityManagement.PowerShell.ObjectModel.ScopeCondition' `-ArgumentList 'adminDescription','User_','NOTSTARTSWITH' `-OutVariable condition1

Add-ADSyncScopeConditionGroup `-SynchronizationRule $syncRule[0] `-ScopeConditions @($condition0[0],$condition1[0]) `-OutVariable syncRule

New-Object `

Page 2: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-TypeName 'Microsoft.IdentityManagement.PowerShell.ObjectModel.JoinCondition' `-ArgumentList 'objectGUID','sourceAnchorBinary',$false `-OutVariable condition0

Add-ADSyncJoinConditionGroup `-SynchronizationRule $syncRule[0] `-JoinConditions @($condition0[0]) `-OutVariable syncRule

Add-ADSyncRule `-SynchronizationRule $syncRule[0]

New-ADSyncRule `-Name 'In from AD - InetOrgPerson Join' `-Identifier 'fcc574bd-96fa-4b63-afd0-bd3dc7661b9f' `-Description '' `-Direction 'Inbound' `-Precedence 101 `-PrecedenceAfter '00000000-0000-0000-0000-000000000000' `-PrecedenceBefore '00000000-0000-0000-0000-000000000000' `-SourceObjectType 'inetOrgPerson' `-TargetObjectType 'person' `-Connector '9792d5d0-7815-4880-85e2-3e5de264452e' `-LinkType 'Provision' `-SoftDeleteExpiryInterval 0 `-ImmutableTag 'Microsoft.InfromADInetOrgPersonJoin.003' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('sAMAccountName') `-Destination 'cloudFiltered' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsPresent([isCriticalSystemObject]) || IsPresent([sAMAccountName]) = False || [sAMAccountName] = "SUPPORT_388945a0" || Left([mailNickname], 14) = "SystemMailbox{" || Left([sAMAccountName], 4) = "AAD_" || (Left([mailNickname], 4) = "CAS_" && (InStr([mailNickname], "}") > 0)) || (Left([sAMAccountName], 4) = "CAS_" && (InStr([sAMAccountName], "}") > 0)) || Left([sAMAccountName], 5) = "MSOL_" || CBool(IIF(IsPresent([msExchRecipientTypeDetails]),BitAnd([msExchRecipientTypeDetails],&H21C07000) > 0,NULL)) || CBool(InStr(DNComponent(CRef([dn]),1),"\\0ACNF:")>0), True, NULL)' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('objectGUID') `-Destination 'sourceAnchorBinary' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

New-Object `-TypeName 'Microsoft.IdentityManagement.PowerShell.ObjectModel.ScopeCondition' `-ArgumentList 'isCriticalSystemObject','TRUE','NOTEQUAL' `-OutVariable condition0

Page 3: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

Add-ADSyncScopeConditionGroup `-SynchronizationRule $syncRule[0] `-ScopeConditions @($condition0[0]) `-OutVariable syncRule

New-Object `-TypeName 'Microsoft.IdentityManagement.PowerShell.ObjectModel.JoinCondition' `-ArgumentList 'objectGUID','sourceAnchorBinary',$false `-OutVariable condition0

Add-ADSyncJoinConditionGroup `-SynchronizationRule $syncRule[0] `-JoinConditions @($condition0[0]) `-OutVariable syncRule

Add-ADSyncRule `-SynchronizationRule $syncRule[0]

New-ADSyncRule `-Name 'In from AD - User AccountEnabled' `-Identifier '7b5fe368-1c64-493f-8ccb-4f9bfba5942a' `-Description '' `-Direction 'Inbound' `-Precedence 102 `-PrecedenceAfter '00000000-0000-0000-0000-000000000000' `-PrecedenceBefore '00000000-0000-0000-0000-000000000000' `-SourceObjectType 'user' `-TargetObjectType 'person' `-Connector '9792d5d0-7815-4880-85e2-3e5de264452e' `-LinkType 'Join' `-SoftDeleteExpiryInterval 0 `-ImmutableTag 'Microsoft.InfromADUserAccountEnabled.004' `-EnablePasswordSync `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('True') `-Destination 'accountEnabled' `-FlowType 'Constant' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('cn') `-Destination 'cn' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `

Page 4: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-SynchronizationRule $syncRule[0] `-Destination 'contributingConnectorUser' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression '%Connector.ID%' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Destination 'domainFQDN' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression '%Domain.FQDN%' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Destination 'domainNetBios' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression '%Domain.Netbios%' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Destination 'forestFQDN' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression '%Forest.FQDN%' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Destination 'forestNetBios' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression '%Forest.Netbios%' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('objectSid') `-Destination 'objectSid' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('objectSid') `-Destination 'objectSidString' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'StringFromSid([objectSid])' `-OutVariable syncRule

Page 5: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('pwdLastSet') `-Destination 'pwdLastSet' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsPresent([pwdLastSet]),CStr(FormatDateTime(DateFromNum([pwdLastSet]),"yyyyMMddHHmmss.0Z")),NULL)' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('objectGUID') `-Destination 'sourceAnchor' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsPresent([msExchRecipientTypeDetails]),IIF([msExchRecipientTypeDetails]=2,NULL,IIF(IsString([objectGUID]),CStr([objectGUID]),ConvertToBase64([objectGUID]))),IIF(IsString([objectGUID]),CStr([objectGUID]),ConvertToBase64([objectGUID])))' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('sAMAccountName','userPrincipalName') `-Destination 'userPrincipalName' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsPresent([userPrincipalName]),[userPrincipalName], IIF(IsPresent([sAMAccountName]),([sAMAccountName]&"@"&%Domain.FQDN%),Error("AccountName is not present")))' `-OutVariable syncRule

New-Object `-TypeName 'Microsoft.IdentityManagement.PowerShell.ObjectModel.ScopeCondition' `-ArgumentList 'userAccountControl','2','ISBITNOTSET' `-OutVariable condition0

Add-ADSyncScopeConditionGroup `-SynchronizationRule $syncRule[0] `-ScopeConditions @($condition0[0]) `-OutVariable syncRule

Add-ADSyncRule `-SynchronizationRule $syncRule[0]

New-ADSyncRule `-Name 'In from AD - InetOrgPerson AccountEnabled' `-Identifier '43c4c4c2-c1a5-4b24-ae28-21383ec361b1' `-Description '' `-Direction 'Inbound' `-Precedence 103 `-PrecedenceAfter '00000000-0000-0000-0000-000000000000' `

Page 6: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-PrecedenceBefore '00000000-0000-0000-0000-000000000000' `-SourceObjectType 'inetOrgPerson' `-TargetObjectType 'person' `-Connector '9792d5d0-7815-4880-85e2-3e5de264452e' `-LinkType 'Join' `-SoftDeleteExpiryInterval 0 `-ImmutableTag 'Microsoft.InfromADInetOrgPersonAccountEnabled.003' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('True') `-Destination 'accountEnabled' `-FlowType 'Constant' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('cn') `-Destination 'cn' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Destination 'contributingConnectorUser' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression '%Connector.ID%' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Destination 'domainFQDN' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression '%Domain.FQDN%' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Destination 'domainNetBios' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression '%Domain.Netbios%' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Destination 'forestFQDN' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression '%Forest.FQDN%' `

Page 7: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Destination 'forestNetBios' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression '%Forest.Netbios%' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('objectSid') `-Destination 'objectSid' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('objectSid') `-Destination 'objectSidString' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'StringFromSid([objectSid])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('pwdLastSet') `-Destination 'pwdLastSet' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsPresent([pwdLastSet]),CStr(FormatDateTime(DateFromNum([pwdLastSet]),"yyyyMMddHHmmss.0Z")),NULL)' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('objectGUID') `-Destination 'sourceAnchor' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsPresent([msExchRecipientTypeDetails]),IIF([msExchRecipientTypeDetails]=2,NULL,IIF(IsString([objectGUID]),CStr([objectGUID]),ConvertToBase64([objectGUID]))),IIF(IsString([objectGUID]),CStr([objectGUID]),ConvertToBase64([objectGUID])))' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('sAMAccountName','userPrincipalName') `-Destination 'userPrincipalName' `-FlowType 'Expression' `

Page 8: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-ValueMergeType 'Update' `-Expression 'IIF(IsPresent([userPrincipalName]),[userPrincipalName], IIF(IsPresent([sAMAccountName]),([sAMAccountName]&"@"&%Domain.FQDN%),Error("AccountName is not present")))' `-OutVariable syncRule

New-Object `-TypeName 'Microsoft.IdentityManagement.PowerShell.ObjectModel.ScopeCondition' `-ArgumentList 'userAccountControl','2','ISBITNOTSET' `-OutVariable condition0

Add-ADSyncScopeConditionGroup `-SynchronizationRule $syncRule[0] `-ScopeConditions @($condition0[0]) `-OutVariable syncRule

Add-ADSyncRule `-SynchronizationRule $syncRule[0]

New-ADSyncRule `-Name 'In from AD - User Common' `-Identifier '96897396-5f2f-45f1-b12d-ed3fe372a7df' `-Description '' `-Direction 'Inbound' `-Precedence 104 `-PrecedenceAfter '00000000-0000-0000-0000-000000000000' `-PrecedenceBefore '00000000-0000-0000-0000-000000000000' `-SourceObjectType 'user' `-TargetObjectType 'person' `-Connector '9792d5d0-7815-4880-85e2-3e5de264452e' `-LinkType 'Join' `-SoftDeleteExpiryInterval 0 `-ImmutableTag 'Microsoft.InfromADUserCommon.004' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('userAccountControl') `-Destination 'accountEnabled' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(BitAnd([userAccountControl],2)=0,True,False)' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('sAMAccountName') `-Destination 'accountName' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('assistant') `

Page 9: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-Destination 'assistant' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('c') `-Destination 'c' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([c])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('cn') `-Destination 'cn' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('co') `-Destination 'co' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([co])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('company') `-Destination 'company' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([company])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('countryCode') `-Destination 'countryCode' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('department') `-Destination 'department' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([department])' `

Page 10: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('description') `-Destination 'description' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsNullOrEmpty([description]),NULL,Left(Trim(Item([description],1)),448))' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('displayName','cn') `-Destination 'displayName' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsNullOrEmpty([displayName]),[cn],[displayName])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Destination 'domainFQDN' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression '%Domain.FQDN%' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Destination 'domainNetBios' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression '%Domain.Netbios%' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('facsimileTelephoneNumber') `-Destination 'facsimileTelephoneNumber' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([facsimileTelephoneNumber])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Destination 'forestFQDN' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression '%Forest.FQDN%' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `

Page 11: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-SynchronizationRule $syncRule[0] `-Destination 'forestNetBios' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression '%Forest.Netbios%' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('givenName') `-Destination 'givenName' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([givenName])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('homePhone') `-Destination 'homePhone' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([homePhone])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('info') `-Destination 'info' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Left(Trim([info]),448)' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('initials') `-Destination 'initials' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([initials])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('ipPhone') `-Destination 'ipPhone' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([ipPhone])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('l') `

Page 12: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-Destination 'l' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([l])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('mail') `-Destination 'mail' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([mail])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('manager') `-Destination 'manager' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('middleName') `-Destination 'middleName' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([middleName])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('mobile') `-Destination 'mobile' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([mobile])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('objectSid') `-Destination 'objectSid' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('objectSid') `-Destination 'objectSidString' `-FlowType 'Expression' `-ValueMergeType 'Update' `

Page 13: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-Expression 'StringFromSid([objectSid])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('otherFacsimileTelephoneNumber') `-Destination 'otherFacsimileTelephoneNumber' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([otherFacsimileTelephoneNumber])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('otherHomePhone') `-Destination 'otherHomePhone' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([otherHomePhone])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('otherMobile') `-Destination 'otherMobile' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([otherMobile])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('otherIpPhone') `-Destination 'otherIpPhone' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([otherIpPhone])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('otherPager') `-Destination 'otherPager' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([otherPager])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('otherTelephone') `-Destination 'otherTelephone' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([otherTelephone])' `

Page 14: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('pager') `-Destination 'pager' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([pager])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('photo') `-Destination 'photo' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('physicalDeliveryOfficeName') `-Destination 'physicalDeliveryOfficeName' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([physicalDeliveryOfficeName])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('postalCode') `-Destination 'postalCode' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([postalCode])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('postOfficeBox') `-Destination 'postOfficeBox' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsNullOrEmpty([postOfficeBox]),NULL,Left(Trim(Item([postOfficeBox],1)),448))' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('preferredLanguage') `-Destination 'preferredLanguage' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([preferredLanguage])' `-OutVariable syncRule

Page 15: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('proxyAddresses') `-Destination 'proxyAddresses' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'RemoveDuplicates(Trim(ImportedValue("proxyAddresses")))' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('pwdLastSet') `-Destination 'pwdLastSet' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsPresent([pwdLastSet]),CStr(FormatDateTime(DateFromNum([pwdLastSet]),"yyyyMMddHHmmss.0Z")),NULL)' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('sn') `-Destination 'sn' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([sn])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('objectGUID') `-Destination 'sourceAnchor' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsPresent([msExchRecipientTypeDetails]),IIF([msExchRecipientTypeDetails]=2,NULL,IIF(IsString([objectGUID]),CStr([objectGUID]),ConvertToBase64([objectGUID]))),IIF(IsString([objectGUID]),CStr([objectGUID]),ConvertToBase64([objectGUID])))' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Destination 'sourceObjectType' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsPresent([msExchRecipientTypeDetails]), IIF([msExchRecipientTypeDetails]=2, NULL, "User"), "User")' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('st') `-Destination 'st' `-FlowType 'Expression' `

Page 16: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-ValueMergeType 'Update' `-Expression 'Trim([st])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('streetAddress') `-Destination 'streetAddress' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([streetAddress])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('telephoneNumber') `-Destination 'telephoneNumber' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([telephoneNumber])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('thumbnailPhoto') `-Destination 'thumbnailPhoto' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('title') `-Destination 'title' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([title])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('sAMAccountName','userPrincipalName') `-Destination 'userPrincipalName' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsPresent([userPrincipalName]),[userPrincipalName], IIF(IsPresent([sAMAccountName]),([sAMAccountName]&"@"&%Domain.FQDN%),Error("AccountName is not present")))' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('url') `-Destination 'url' `-FlowType 'Expression' `-ValueMergeType 'Update' `

Page 17: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-Expression 'IIF(IsNullOrEmpty([url]),NULL,Left(Trim(Item([url],1)),448))' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('wWWHomePage') `-Destination 'wWWHomePage' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([wWWHomePage])' `-OutVariable syncRule

New-Object `-TypeName 'Microsoft.IdentityManagement.PowerShell.ObjectModel.ScopeCondition' `-ArgumentList 'adminDescription','User_','NOTSTARTSWITH' `-OutVariable condition0

Add-ADSyncScopeConditionGroup `-SynchronizationRule $syncRule[0] `-ScopeConditions @($condition0[0]) `-OutVariable syncRule

Add-ADSyncRule `-SynchronizationRule $syncRule[0]

New-ADSyncRule `-Name 'In from AD - InetOrgPerson Common' `-Identifier '4c617919-ffea-44b3-9c12-8917c1c4b615' `-Description '' `-Direction 'Inbound' `-Precedence 105 `-PrecedenceAfter '00000000-0000-0000-0000-000000000000' `-PrecedenceBefore '00000000-0000-0000-0000-000000000000' `-SourceObjectType 'inetOrgPerson' `-TargetObjectType 'person' `-Connector '9792d5d0-7815-4880-85e2-3e5de264452e' `-LinkType 'Join' `-SoftDeleteExpiryInterval 0 `-ImmutableTag 'Microsoft.InfromADInetOrgPersonCommon.004' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('userAccountControl') `-Destination 'accountEnabled' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(BitAnd([userAccountControl],2)=0,True,False)' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('sAMAccountName') `-Destination 'accountName' `

Page 18: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('assistant') `-Destination 'assistant' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('c') `-Destination 'c' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([c])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('cn') `-Destination 'cn' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('co') `-Destination 'co' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([co])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('company') `-Destination 'company' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([company])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('countryCode') `-Destination 'countryCode' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Page 19: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('department') `-Destination 'department' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([department])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('description') `-Destination 'description' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsNullOrEmpty([description]),NULL,Left(Trim(Item([description],1)),448))' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('displayName','cn') `-Destination 'displayName' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsNullOrEmpty([displayName]),[cn],[displayName])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Destination 'domainFQDN' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression '%Domain.FQDN%' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Destination 'domainNetBios' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression '%Domain.Netbios%' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('facsimileTelephoneNumber') `-Destination 'facsimileTelephoneNumber' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([facsimileTelephoneNumber])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `

Page 20: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-Destination 'forestFQDN' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression '%Forest.FQDN%' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Destination 'forestNetBios' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression '%Forest.Netbios%' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('givenName') `-Destination 'givenName' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([givenName])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('homePhone') `-Destination 'homePhone' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([homePhone])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('info') `-Destination 'info' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Left(Trim([info]),448)' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('initials') `-Destination 'initials' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([initials])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('ipPhone') `-Destination 'ipPhone' `-FlowType 'Expression' `

Page 21: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-ValueMergeType 'Update' `-Expression 'Trim([ipPhone])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('l') `-Destination 'l' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([l])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('mail') `-Destination 'mail' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([mail])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('manager') `-Destination 'manager' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('middleName') `-Destination 'middleName' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([middleName])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('mobile') `-Destination 'mobile' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([mobile])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('objectSid') `-Destination 'objectSid' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Page 22: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('objectSid') `-Destination 'objectSidString' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'StringFromSid([objectSid])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('otherFacsimileTelephoneNumber') `-Destination 'otherFacsimileTelephoneNumber' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([otherFacsimileTelephoneNumber])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('otherHomePhone') `-Destination 'otherHomePhone' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([otherHomePhone])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('otherMobile') `-Destination 'otherMobile' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([otherMobile])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('otherIpPhone') `-Destination 'otherIpPhone' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([otherIpPhone])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('otherPager') `-Destination 'otherPager' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([otherPager])' `-OutVariable syncRule

Page 23: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('otherTelephone') `-Destination 'otherTelephone' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([otherTelephone])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('pager') `-Destination 'pager' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([pager])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('photo') `-Destination 'photo' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('physicalDeliveryOfficeName') `-Destination 'physicalDeliveryOfficeName' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([physicalDeliveryOfficeName])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('postalCode') `-Destination 'postalCode' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([postalCode])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('postOfficeBox') `-Destination 'postOfficeBox' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsNullOrEmpty([postOfficeBox]),NULL,Left(Trim(Item([postOfficeBox],1)),448))' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `

Page 24: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-SynchronizationRule $syncRule[0] `-Source @('preferredLanguage') `-Destination 'preferredLanguage' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([preferredLanguage])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('pwdLastSet') `-Destination 'pwdLastSet' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsPresent([pwdLastSet]),CStr(FormatDateTime(DateFromNum([pwdLastSet]),"yyyyMMddHHmmss.0Z")),NULL)' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('sn') `-Destination 'sn' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([sn])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('objectGUID') `-Destination 'sourceAnchor' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsPresent([msExchRecipientTypeDetails]),IIF([msExchRecipientTypeDetails]=2,NULL,IIF(IsString([objectGUID]),CStr([objectGUID]),ConvertToBase64([objectGUID]))),IIF(IsString([objectGUID]),CStr([objectGUID]),ConvertToBase64([objectGUID])))' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Destination 'sourceObjectType' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsPresent([msExchRecipientTypeDetails]), IIF([msExchRecipientTypeDetails]=2, NULL, "User"), "User")' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('st') `-Destination 'st' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([st])' `

Page 25: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('streetAddress') `-Destination 'streetAddress' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([streetAddress])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('telephoneNumber') `-Destination 'telephoneNumber' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([telephoneNumber])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('thumbnailPhoto') `-Destination 'thumbnailPhoto' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('title') `-Destination 'title' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([title])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('sAMAccountName','userPrincipalName') `-Destination 'userPrincipalName' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsPresent([userPrincipalName]),[userPrincipalName], IIF(IsPresent([sAMAccountName]),([sAMAccountName]&"@"&%Domain.FQDN%),Error("AccountName is not present")))' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('url') `-Destination 'url' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsNullOrEmpty([url]),NULL,Left(Trim(Item([url],1)),448))' `-OutVariable syncRule

Page 26: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('wWWHomePage') `-Destination 'wWWHomePage' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([wWWHomePage])' `-OutVariable syncRule

Add-ADSyncRule `-SynchronizationRule $syncRule[0]

New-ADSyncRule `-Name 'In from AD - Group Join' `-Identifier 'aa086e92-3589-4829-8886-5077801ffa6b' `-Description '' `-Direction 'Inbound' `-Precedence 106 `-PrecedenceAfter '00000000-0000-0000-0000-000000000000' `-PrecedenceBefore '00000000-0000-0000-0000-000000000000' `-SourceObjectType 'group' `-TargetObjectType 'group' `-Connector '9792d5d0-7815-4880-85e2-3e5de264452e' `-LinkType 'Provision' `-SoftDeleteExpiryInterval 0 `-ImmutableTag 'Microsoft.InfromADGroupJoin.003' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('isCriticalSystemObject') `-Destination 'cloudFiltered' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsPresent([isCriticalSystemObject]) || [sAMAccountName] = "MSOL_AD_Sync_RichCoexistence" || CBool(IIF(IsPresent([msExchRecipientTypeDetails]),BitAnd([msExchRecipientTypeDetails],&H40000000) > 0,NULL)) || CBool(InStr(DNComponent(CRef([dn]),1),"\\0ACNF:")>0), True, NULL)' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('proxyAddresses','mail') `-Destination 'mailEnabled' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(( (IsPresent([proxyAddresses]) = True) && (Contains([proxyAddresses], "SMTP:") > 0) && (InStr(Item([proxyAddresses], Contains([proxyAddresses], "SMTP:")), "@") > 0)) || (IsPresent([mail]) = True && (InStr([mail], "@") > 0)), True, False)' `-OutVariable syncRule

New-Object `-TypeName 'Microsoft.IdentityManagement.PowerShell.ObjectModel.ScopeCondition' `-ArgumentList 'isCriticalSystemObject','True','NOTEQUAL' `

Page 27: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-OutVariable condition0

New-Object `-TypeName 'Microsoft.IdentityManagement.PowerShell.ObjectModel.ScopeCondition' `-ArgumentList 'adminDescription','Group_','NOTSTARTSWITH' `-OutVariable condition1

Add-ADSyncScopeConditionGroup `-SynchronizationRule $syncRule[0] `-ScopeConditions @($condition0[0],$condition1[0]) `-OutVariable syncRule

New-Object `-TypeName 'Microsoft.IdentityManagement.PowerShell.ObjectModel.JoinCondition' `-ArgumentList 'objectGUID','sourceAnchorBinary',$false `-OutVariable condition0

Add-ADSyncJoinConditionGroup `-SynchronizationRule $syncRule[0] `-JoinConditions @($condition0[0]) `-OutVariable syncRule

Add-ADSyncRule `-SynchronizationRule $syncRule[0]

New-ADSyncRule `-Name 'In from AD - Group Common' `-Identifier '44c1c7d5-5d12-43c7-8387-00e7e4985e72' `-Description '' `-Direction 'Inbound' `-Precedence 107 `-PrecedenceAfter '00000000-0000-0000-0000-000000000000' `-PrecedenceBefore '00000000-0000-0000-0000-000000000000' `-SourceObjectType 'group' `-TargetObjectType 'group' `-Connector '9792d5d0-7815-4880-85e2-3e5de264452e' `-LinkType 'Join' `-SoftDeleteExpiryInterval 0 `-ImmutableTag 'Microsoft.InfromADGroupCommon.003' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('cn') `-Destination 'cn' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('description') `-Destination 'description' `

Page 28: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsNullOrEmpty([description]),NULL,Left(Trim(Item([description],1)),448))' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('displayName','cn') `-Destination 'displayName' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsNullOrEmpty([displayName]),[cn],[displayName])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('info') `-Destination 'info' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Left(Trim([info]),448)' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('mail') `-Destination 'mail' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([mail])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('managedBy') `-Destination 'managedBy' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('member') `-Destination 'member' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('member') `-Destination 'memberCount' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'ValueCount("member")' `

Page 29: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('objectSid') `-Destination 'objectSid' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('objectSid') `-Destination 'objectSidString' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'StringFromSid([objectSid])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('proxyAddresses') `-Destination 'proxyAddresses' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'RemoveDuplicates(Trim(ImportedValue("proxyAddresses")))' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('groupType') `-Destination 'securityEnabled' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'CBool(BitAnd([groupType],-2147483648))' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('objectGUID') `-Destination 'sourceAnchor' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'ConvertToBase64([objectGUID])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('objectGUID') `-Destination 'sourceAnchorBinary' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Page 30: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

New-Object `-TypeName 'Microsoft.IdentityManagement.PowerShell.ObjectModel.ScopeCondition' `-ArgumentList 'isCriticalSystemObject','True','NOTEQUAL' `-OutVariable condition0

Add-ADSyncScopeConditionGroup `-SynchronizationRule $syncRule[0] `-ScopeConditions @($condition0[0]) `-OutVariable syncRule

Add-ADSyncRule `-SynchronizationRule $syncRule[0]

New-ADSyncRule `-Name 'In from AD - Contact Join' `-Identifier 'e5f27903-4c4c-493b-a2cc-cc63a0d75d38' `-Description 'Contact object with default Active Directory schema.' `-Direction 'Inbound' `-Precedence 108 `-PrecedenceAfter '00000000-0000-0000-0000-000000000000' `-PrecedenceBefore '00000000-0000-0000-0000-000000000000' `-SourceObjectType 'contact' `-TargetObjectType 'person' `-Connector '9792d5d0-7815-4880-85e2-3e5de264452e' `-LinkType 'Provision' `-SoftDeleteExpiryInterval 0 `-ImmutableTag 'Microsoft.InfromADContactJoin.003' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('isCriticalSystemObject') `-Destination 'cloudFiltered' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsPresent([isCriticalSystemObject]) || ( (InStr([displayName], "(MSOL)") > 0) && (CBool([msExchHideFromAddressLists]))) || (Left([mailNickname], 4) = "CAS_" && (InStr([mailNickname], "}") > 0)) || CBool(InStr(DNComponent(CRef([dn]),1),"\\0ACNF:")>0), True, NULL)' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('proxyAddresses','mail') `-Destination 'mailEnabled' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(( (IsPresent([proxyAddresses]) = True) && (Contains([proxyAddresses], "SMTP:") > 0) && (InStr(Item([proxyAddresses], Contains([proxyAddresses], "SMTP:")), "@") > 0)) || (IsPresent([mail]) = True && (InStr([mail], "@") > 0)), True, False)' `-OutVariable syncRule

New-Object `-TypeName 'Microsoft.IdentityManagement.PowerShell.ObjectModel.JoinCondition' `-ArgumentList 'mail','mail',$false `

Page 31: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-OutVariable condition0

Add-ADSyncJoinConditionGroup `-SynchronizationRule $syncRule[0] `-JoinConditions @($condition0[0]) `-OutVariable syncRule

Add-ADSyncRule `-SynchronizationRule $syncRule[0]

New-ADSyncRule `-Name 'In from AD - Contact Common' `-Identifier '6067a59e-1f87-4bae-8b3a-1c26aebb26c1' `-Description 'Contact object with Exchange schema in Active Directory.' `-Direction 'Inbound' `-Precedence 109 `-PrecedenceAfter '00000000-0000-0000-0000-000000000000' `-PrecedenceBefore '00000000-0000-0000-0000-000000000000' `-SourceObjectType 'contact' `-TargetObjectType 'person' `-Connector '9792d5d0-7815-4880-85e2-3e5de264452e' `-LinkType 'Join' `-SoftDeleteExpiryInterval 0 `-ImmutableTag 'Microsoft.InfromADContactCommon.004' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('assistant') `-Destination 'assistant' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('c') `-Destination 'c' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([c])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('cn') `-Destination 'cn' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('co') `

Page 32: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-Destination 'co' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([co])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('company') `-Destination 'company' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([company])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('countryCode') `-Destination 'countryCode' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('department') `-Destination 'department' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([department])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('description') `-Destination 'description' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsNullOrEmpty([description]),NULL,Left(Trim(Item([description],1)),448))' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('displayName','cn') `-Destination 'displayName' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsNullOrEmpty([displayName]),[cn],[displayName])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('facsimileTelephoneNumber') `-Destination 'facsimileTelephoneNumber' `-FlowType 'Expression' `

Page 33: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-ValueMergeType 'Update' `-Expression 'Trim([facsimileTelephoneNumber])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('givenName') `-Destination 'givenName' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([givenName])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('homePhone') `-Destination 'homePhone' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([homePhone])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('info') `-Destination 'info' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Left(Trim([info]),448)' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('initials') `-Destination 'initials' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([initials])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('ipPhone') `-Destination 'ipPhone' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([ipPhone])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('l') `-Destination 'l' `-FlowType 'Expression' `-ValueMergeType 'Update' `

Page 34: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-Expression 'Trim([l])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('legacyExchangeDN') `-Destination 'legacyExchangeDN' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsPresent([legacyExchangeDN]), [legacyExchangeDN], NULL)' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('mail') `-Destination 'mail' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([mail])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Destination 'mailNickname' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsPresent([mailNickname]), [mailNickname], [cn])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('manager') `-Destination 'manager' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('middleName') `-Destination 'middleName' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([middleName])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('mobile') `-Destination 'mobile' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([mobile])' `-OutVariable syncRule

Page 35: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('msDS-HABSeniorityIndex') `-Destination 'msDS-HABSeniorityIndex' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('msDS-PhoneticDisplayName') `-Destination 'msDS-PhoneticDisplayName' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('msExchAssistantName') `-Destination 'msExchAssistantName' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('otherFacsimileTelephoneNumber') `-Destination 'otherFacsimileTelephoneNumber' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([otherFacsimileTelephoneNumber])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('otherHomePhone') `-Destination 'otherHomePhone' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([otherHomePhone])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('otherIpPhone') `-Destination 'otherIpPhone' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([otherIpPhone])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('otherMobile') `

Page 36: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-Destination 'otherMobile' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([otherMobile])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('otherPager') `-Destination 'otherPager' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([otherPager])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('otherTelephone') `-Destination 'otherTelephone' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([otherTelephone])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('pager') `-Destination 'pager' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([pager])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('physicalDeliveryOfficeName') `-Destination 'physicalDeliveryOfficeName' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([physicalDeliveryOfficeName])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('postalCode') `-Destination 'postalCode' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([postalCode])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('postOfficeBox') `-Destination 'postOfficeBox' `

Page 37: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsNullOrEmpty([postOfficeBox]),NULL,Left(Trim(Item([postOfficeBox],1)),448))' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('proxyAddresses') `-Destination 'proxyAddresses' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'RemoveDuplicates(Trim(ImportedValue("proxyAddresses")))' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('sn') `-Destination 'sn' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([sn])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('objectGUID') `-Destination 'sourceAnchor' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'ConvertToBase64([objectGUID])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('objectGUID') `-Destination 'sourceAnchorBinary' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('Contact') `-Destination 'sourceObjectType' `-FlowType 'Constant' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('st') `-Destination 'st' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([st])' `

Page 38: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('streetAddress') `-Destination 'streetAddress' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([streetAddress])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('telephoneNumber') `-Destination 'telephoneNumber' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([telephoneNumber])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('thumbnailPhoto') `-Destination 'thumbnailPhoto' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('title') `-Destination 'title' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([title])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('url') `-Destination 'url' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsNullOrEmpty([url]),NULL,Left(Trim(Item([url],1)),448))' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('userCertificate') `-Destination 'userCertificate' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Page 39: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('userSMIMECertificate') `-Destination 'userSMIMECertificate' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('wWWHomePage') `-Destination 'wWWHomePage' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'Trim([wWWHomePage])' `-OutVariable syncRule

Add-ADSyncRule `-SynchronizationRule $syncRule[0]

New-ADSyncRule `-Name 'In from AD - ForeignSecurityPrincipal Join User' `-Identifier 'f04f0107-4b56-4c6b-a1aa-64d21bc2c184' `-Description '' `-Direction 'Inbound' `-Precedence 110 `-PrecedenceAfter '00000000-0000-0000-0000-000000000000' `-PrecedenceBefore '00000000-0000-0000-0000-000000000000' `-SourceObjectType 'foreignSecurityPrincipal' `-TargetObjectType '*' `-Connector '9792d5d0-7815-4880-85e2-3e5de264452e' `-LinkType 'Join' `-SoftDeleteExpiryInterval 0 `-ImmutableTag 'Microsoft.InfromADForeignSecurityPrincipalJoinUser.001' `-OutVariable syncRule

New-Object `-TypeName 'Microsoft.IdentityManagement.PowerShell.ObjectModel.JoinCondition' `-ArgumentList 'cn','objectSidString',$false `-OutVariable condition0

Add-ADSyncJoinConditionGroup `-SynchronizationRule $syncRule[0] `-JoinConditions @($condition0[0]) `-OutVariable syncRule

Add-ADSyncRule `-SynchronizationRule $syncRule[0]

New-ADSyncRule `-Name 'In from AAD - User Join' `-Identifier 'f86ef3e6-4382-4be3-a351-461a0dbe89cf' `-Description '' `-Direction 'Inbound' `

Page 40: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-Precedence 111 `-PrecedenceAfter '00000000-0000-0000-0000-000000000000' `-PrecedenceBefore '00000000-0000-0000-0000-000000000000' `-SourceObjectType 'user' `-TargetObjectType 'person' `-Connector 'b891884f-051e-4a83-95af-2544101c9083' `-LinkType 'Join' `-SoftDeleteExpiryInterval 0 `-ImmutableTag 'Microsoft.InfromAADUserJoin.004' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('accountEnabled') `-Destination 'accountEnabled' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('cloudAnchor') `-Destination 'cloudAnchor' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('sourceAnchor') `-Destination 'cloudSourceAnchor' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'ImportedValue("sourceAnchor")' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('countryCode') `-Destination 'countryCode' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('usageLocation') `-Destination 'usageLocation' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

New-Object `-TypeName 'Microsoft.IdentityManagement.PowerShell.ObjectModel.ScopeCondition' `-ArgumentList 'cloudMastered','False','EQUAL' `

Page 41: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-OutVariable condition0

Add-ADSyncScopeConditionGroup `-SynchronizationRule $syncRule[0] `-ScopeConditions @($condition0[0]) `-OutVariable syncRule

New-Object `-TypeName 'Microsoft.IdentityManagement.PowerShell.ObjectModel.JoinCondition' `-ArgumentList 'sourceAnchor','sourceAnchor',$true `-OutVariable condition0

Add-ADSyncJoinConditionGroup `-SynchronizationRule $syncRule[0] `-JoinConditions @($condition0[0]) `-OutVariable syncRule

Add-ADSyncRule `-SynchronizationRule $syncRule[0]

New-ADSyncRule `-Name 'In from AAD - Contact Join' `-Identifier 'ab2a831f-2ae4-4899-90f5-0bd6b94e091d' `-Description '' `-Direction 'Inbound' `-Precedence 112 `-PrecedenceAfter '00000000-0000-0000-0000-000000000000' `-PrecedenceBefore '00000000-0000-0000-0000-000000000000' `-SourceObjectType 'contact' `-TargetObjectType 'person' `-Connector 'b891884f-051e-4a83-95af-2544101c9083' `-LinkType 'Join' `-SoftDeleteExpiryInterval 0 `-ImmutableTag 'Microsoft.InfromAADContactJoin.003' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('cloudAnchor') `-Destination 'cloudAnchor' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('sourceAnchor') `-Destination 'cloudSourceAnchor' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'ImportedValue("sourceAnchor")' `-OutVariable syncRule

Page 42: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

New-Object `-TypeName 'Microsoft.IdentityManagement.PowerShell.ObjectModel.JoinCondition' `-ArgumentList 'sourceAnchor','sourceAnchor',$true `-OutVariable condition0

Add-ADSyncJoinConditionGroup `-SynchronizationRule $syncRule[0] `-JoinConditions @($condition0[0]) `-OutVariable syncRule

Add-ADSyncRule `-SynchronizationRule $syncRule[0]

New-ADSyncRule `-Name 'In from AAD - Group Join' `-Identifier '60da9f4c-d81a-4ca7-b48f-6d4b5c232083' `-Description '' `-Direction 'Inbound' `-Precedence 113 `-PrecedenceAfter '00000000-0000-0000-0000-000000000000' `-PrecedenceBefore '00000000-0000-0000-0000-000000000000' `-SourceObjectType 'group' `-TargetObjectType 'group' `-Connector 'b891884f-051e-4a83-95af-2544101c9083' `-LinkType 'Join' `-SoftDeleteExpiryInterval 0 `-ImmutableTag 'Microsoft.InfromAADGroupJoin.004' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('cloudAnchor') `-Destination 'cloudAnchor' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('sourceAnchor') `-Destination 'cloudSourceAnchor' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'ImportedValue("sourceAnchor")' `-OutVariable syncRule

New-Object `-TypeName 'Microsoft.IdentityManagement.PowerShell.ObjectModel.ScopeCondition' `-ArgumentList 'cloudMastered','True','NOTEQUAL' `-OutVariable condition0

Add-ADSyncScopeConditionGroup `-SynchronizationRule $syncRule[0] `-ScopeConditions @($condition0[0]) `

Page 43: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-OutVariable syncRule

New-Object `-TypeName 'Microsoft.IdentityManagement.PowerShell.ObjectModel.JoinCondition' `-ArgumentList 'sourceAnchor','sourceAnchor',$true `-OutVariable condition0

Add-ADSyncJoinConditionGroup `-SynchronizationRule $syncRule[0] `-JoinConditions @($condition0[0]) `-OutVariable syncRule

Add-ADSyncRule `-SynchronizationRule $syncRule[0]

New-ADSyncRule `-Name 'In from AAD - User NGCKey' `-Identifier 'fe35b8dc-4d65-4a99-88d7-2cfe129d5c06' `-Description '' `-Direction 'Inbound' `-Precedence 114 `-PrecedenceAfter '00000000-0000-0000-0000-000000000000' `-PrecedenceBefore '00000000-0000-0000-0000-000000000000' `-SourceObjectType 'user' `-TargetObjectType 'person' `-Connector 'b891884f-051e-4a83-95af-2544101c9083' `-LinkType 'Join' `-SoftDeleteExpiryInterval 0 `-ImmutableTag 'Microsoft.InfromAADUserNGCKey.001' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('searchableDeviceKey') `-Destination 'deviceKey' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsNull([searchableDeviceKey]), NULL, IIF(CNum(Mid([searchableDeviceKey],1,1))=0, Mid([searchableDeviceKey],1,7+CNum(Mid([searchableDeviceKey],5,2))) & CBin(Len(Thumbprint(Mid([searchableDeviceKey],8+CNum(Mid([searchableDeviceKey],5,2)),Len([searchableDeviceKey])))),2) & CBin(2,1) & Thumbprint(Mid([searchableDeviceKey],8+CNum(Mid([searchableDeviceKey],5,2)),Len([searchableDeviceKey]))) & Mid([searchableDeviceKey],8+CNum(Mid([searchableDeviceKey],5,2)),Len([searchableDeviceKey])), NULL))' `-OutVariable syncRule

Add-ADSyncRule `-SynchronizationRule $syncRule[0]

New-ADSyncRule `-Name 'In from AD - Computer Join' `-Identifier '2936c7d2-5ab0-42e9-8d02-dc04bfb4b37f' `-Description '' `

Page 44: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-Direction 'Inbound' `-Precedence 141 `-PrecedenceAfter '00000000-0000-0000-0000-000000000000' `-PrecedenceBefore '00000000-0000-0000-0000-000000000000' `-SourceObjectType 'computer' `-TargetObjectType 'device' `-Connector '9792d5d0-7815-4880-85e2-3e5de264452e' `-LinkType 'Provision' `-SoftDeleteExpiryInterval 0 `-ImmutableTag 'Microsoft.InfromADComputerJoin.001' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('userAccountControl') `-Destination 'accountEnabled' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(BitAnd([userAccountControl],2)=0,True,False)' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('objectGUID') `-Destination 'deviceId' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('objectGUID') `-Destination 'sourceAnchor' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'ConvertToBase64([objectGUID])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('displayName','cn') `-Destination 'displayName' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsNullOrEmpty([displayName]),[cn],[displayName])' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('objectSid') `-Destination 'objectSid' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Page 45: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('Computer') `-Destination 'sourceObjectType' `-FlowType 'Constant' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('operatingSystemVersion') `-Destination 'deviceOSVersion' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('operatingSystem') `-Destination 'deviceOSType' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('ServerAd') `-Destination 'deviceTrustType' `-FlowType 'Constant' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Destination 'cloudCreated' `-FlowType 'Expression' `-ValueMergeType 'Update' `-ExecuteOnce `-Expression 'CBool(0)' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('userCertificate') `-Destination 'userCertificate' `-FlowType 'Direct' `-ValueMergeType 'Update' `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('mS-DS-CreatorSID') `-Destination 'registeredOwnerReference' `-FlowType 'Direct' `-ValueMergeType 'Update' `

Page 46: Web view15.10.2015 · -Expression 'Trim([sn])' `-OutVariable syncRule. Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source

-ExecuteOnce `-OutVariable syncRule

Add-ADSyncAttributeFlowMapping `-SynchronizationRule $syncRule[0] `-Source @('userCertificate') `-Destination 'cloudFiltered' `-FlowType 'Expression' `-ValueMergeType 'Update' `-Expression 'IIF(IsNullOrEmpty([userCertificate]),True,NULL)' `-OutVariable syncRule

New-Object `-TypeName 'Microsoft.IdentityManagement.PowerShell.ObjectModel.JoinCondition' `-ArgumentList 'objectGUID','deviceId',$false `-OutVariable condition0

Add-ADSyncJoinConditionGroup `-SynchronizationRule $syncRule[0] `-JoinConditions @($condition0[0]) `-OutVariable syncRule

Add-ADSyncRule `-SynchronizationRule $syncRule[0]