{"id":621,"date":"2018-03-21T14:34:57","date_gmt":"2018-03-21T12:34:57","guid":{"rendered":"https:\/\/itblogwildi.wordpress.com\/?p=621"},"modified":"2018-03-21T14:34:57","modified_gmt":"2018-03-21T12:34:57","slug":"azure-ad-connect-powershell-befehle-zur-einrichtung","status":"publish","type":"post","link":"https:\/\/itblog.wildi.dk\/?p=621","title":{"rendered":"Azure AD Connect: Powershell-Befehle zur Einrichtung"},"content":{"rendered":"<p>Bei weiteren Azure AD Connect Einrichtungen stiess ich auf folgende, n\u00fctzliche Befehle:<\/p>\n<p>Export aller aktuellen UPN Anmeldenamen, und Proxy-Adressen:<\/p>\n<pre style=\"margin:0;font-family:'Trebuchet MS';\"><span style=\"font-size:10pt;\">Get-ADUser -Filter {Enabled -eq $true} -SearchBase \"OU=Users,DC=DOMAIN,DC=local\" -Properties * | <\/span><span style=\"font-size:10.5pt;color:#660066;background:white;\">Where <\/span><span style=\"font-size:10.5pt;color:#666600;background:white;\">{<\/span><span style=\"font-size:10.5pt;color:black;background:white;\">$_<\/span><span style=\"font-size:10.5pt;color:#666600;background:white;\">.<\/span><span style=\"font-size:10.5pt;color:black;background:white;\">proxyAddresses<\/span><span style=\"font-size:10.5pt;color:#666600;background:white;\">} |<\/span><span style=\"font-size:10pt;\"> select SAMAccountname,UserPrincipalName, @{L='ProxyAddress_1'; E={$_.proxyaddresses[0]}},@{L='ProxyAddress_2';E={$_.ProxyAddresses[1]}},@{L='ProxyAddress_3';E={$_.ProxyAddresses[2]}},@{L='ProxyAddress_4';E={$_.ProxyAddresses[3]}},@{L='ProxyAddress_5';E={$_.ProxyAddresses[4]}},@{L='ProxyAddress_6';E={$_.ProxyAddresses[5]}} | export-csv C:\\Temp\\ExportV1.csv<\/span><\/pre>\n<p>&nbsp;<\/p>\n<p>Anpassen s\u00e4mtlicher UPN Anmeldenamen:<\/p>\n<pre>Import-Module ActiveDirectory\n$oldSuffix = \"DOMAIN.local\"\n$newSuffix = \"URI.ch\"\n$ou = \"OU=Users,DC=DOMAIN,DC=local\"\n$server = \"SERVER\"\nGet-ADUser -SearchBase $ou -filter * | ForEach-Object {\n$newUpn = $_.UserPrincipalName.Replace($oldSuffix,$newSuffix)\n$_ | Set-ADUser -server $server -UserPrincipalName $newUpn\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bei weiteren Azure AD Connect Einrichtungen stiess ich auf folgende, n\u00fctzliche Befehle: Export aller aktuellen UPN Anmeldenamen, und Proxy-Adressen: Get-ADUser&#8230; <a class=\"read-more\" href=\"https:\/\/itblog.wildi.dk\/?p=621\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,8,29],"tags":[53],"class_list":["post-621","post","type-post","status-publish","format-standard","hentry","category-active-directory","category-azure","category-powershell","tag-azure-ad-sync"],"_links":{"self":[{"href":"https:\/\/itblog.wildi.dk\/index.php?rest_route=\/wp\/v2\/posts\/621","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itblog.wildi.dk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itblog.wildi.dk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itblog.wildi.dk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/itblog.wildi.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=621"}],"version-history":[{"count":0,"href":"https:\/\/itblog.wildi.dk\/index.php?rest_route=\/wp\/v2\/posts\/621\/revisions"}],"wp:attachment":[{"href":"https:\/\/itblog.wildi.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=621"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itblog.wildi.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=621"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itblog.wildi.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=621"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}