{"id":2449,"date":"2017-05-22T08:57:50","date_gmt":"2017-05-22T07:57:50","guid":{"rendered":"https:\/\/www.lieben.nu\/liebensraum\/?page_id=2449"},"modified":"2017-05-22T08:57:50","modified_gmt":"2017-05-22T07:57:50","slug":"updating-from-o365groupsync-displayname-filtering-to-customattribute-filtering","status":"publish","type":"page","link":"https:\/\/lieben.nu\/liebensraum\/o365groupsync\/updating-from-o365groupsync-displayname-filtering-to-customattribute-filtering\/","title":{"rendered":"Updating from O365GroupSync DisplayName filtering to CustomAttribute filtering"},"content":{"rendered":"<p>As of GroupSync v0.56, filtering on a custom attribute is now possible.<\/p>\n<p>If you want to switch to this mode, but are already using displayName filtering, you&#8217;ll have to first set the custom attribute on both sides (office 365, local AD).<\/p>\n<p>Here&#8217;s a simple example of how to do so in Exchange Online:<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\n$distributionGroups = get-DistributionGroup -resultsize unlimited\n$distributionGroupsToRename = $distributionGroups | where {$_.DisplayName -like &quot;NL -*&quot;}\n$distributionGroupsToRename | set-distributiongroup -CustomAttribute2 &quot;NLD&quot; -BypassSecurityGroupManagerCheck\n<\/pre>\n<p>And here in how to do so in the local AD:<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\nipmo activedirectory\n$groups = Get-ADGroup -Filter {mail -like &quot;*&quot;} -Properties * -SearchBase &quot;OU=Distribution Lists,OU=Groups,OU=0 Generic,DC=XXXX,DC=LOCAL&quot; -SearchScope Subtree -ErrorAction Stop\n$groupsToRename = $groups | where {$_.DisplayName -like &quot;NL - *&quot;}\n$groupsToRename | Set-ADGroup -Replace @{'extensionAttribute2'=&quot;NLD&quot;} -ErrorAction Stop\n<\/pre>\n<p>Don&#8217;t forget to set these parameters before you run O365GroupSync v0.56:<br \/>\n$cloudCustomAttributeValue = &#8220;&#8221;<br \/>\n$localCustomAttributeValue = &#8220;&#8221;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As of GroupSync v0.56, filtering on a custom attribute is now possible. If you want to switch to this mode, but are already using displayName filtering, you&#8217;ll have to first set the custom attribute on both sides (office 365, local AD). Here&#8217;s a simple example of how to do so in Exchange Online: $distributionGroups = &hellip; <a href=\"https:\/\/lieben.nu\/liebensraum\/o365groupsync\/updating-from-o365groupsync-displayname-filtering-to-customattribute-filtering\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Updating from O365GroupSync DisplayName filtering to CustomAttribute filtering<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":961,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","footnotes":""},"class_list":["post-2449","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/pages\/2449","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/comments?post=2449"}],"version-history":[{"count":0,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/pages\/2449\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/pages\/961"}],"wp:attachment":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/media?parent=2449"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}