{"id":64,"date":"2015-08-25T18:49:22","date_gmt":"2015-08-25T16:49:22","guid":{"rendered":"https:\/\/hosebei.wordpress.com\/?p=64"},"modified":"2015-08-25T18:49:22","modified_gmt":"2015-08-25T16:49:22","slug":"quickpost-use-powershell-to-get-dfs-r-initial-replication-status","status":"publish","type":"post","link":"https:\/\/blog.hosebei.ch\/?p=64","title":{"rendered":"Quickpost &#8211; Use Powershell to get DFS-R initial replication status"},"content":{"rendered":"<p>Hi all,<\/p>\n<p>because I didn&#8217;t found this in the first sight, and had to use a wmic query, I have prepared my Powershell command:<br \/>\n<code>Get-WmiObject -Namespace root\\microsoftdfs -Class dfsrreplicatedfolderinfo | Select-Object ReplicatedFolderName,State<\/code><br \/>\n<!--more--><br \/>\nThe State 2 indicates, that the replication is not done yet, but a 4 would indicate that the initial replication is done.<\/p>\n<p>See this website for the class explanation:<br \/>\nhttps:\/\/msdn.microsoft.com\/en-us\/library\/bb540019(v=vs.85).aspx<\/p>\n<p>Possible states are:<br \/>\nUninitialized (0)<br \/>\nInitialized (1)<br \/>\nInitial Sync (2)<br \/>\nAuto Recovery (3)<br \/>\nNormal (4)<br \/>\nIn Error (5)<\/p>\n<p>If you only want to get all replications with a specific status, use the following command:<br \/>\n<code>Get-WmiObject -Namespace root\\microsoftdfs -Class dfsrreplicatedfolderinfo -Filter 'state=2' | Select-Object replicationgroupname,replicatedfoldername<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi all, because I didn&#8217;t found this in the first sight, and had to use a wmic query, I have prepared my Powershell command: Get-WmiObject -Namespace root\\microsoftdfs -Class dfsrreplicatedfolderinfo | Select-Object ReplicatedFolderName,State<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-64","post","type-post","status-publish","format-standard","hentry","category-powershell"],"_links":{"self":[{"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=\/wp\/v2\/posts\/64","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=64"}],"version-history":[{"count":0,"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=\/wp\/v2\/posts\/64\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=64"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=64"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=64"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}