{"id":2521,"date":"2013-11-27T15:12:03","date_gmt":"2013-11-27T12:12:03","guid":{"rendered":"http:\/\/www.buldakov.ru\/?p=2521"},"modified":"2015-12-09T17:06:40","modified_gmt":"2015-12-09T14:06:40","slug":"get-mailboxstatistics-vs-ps-script","status":"publish","type":"post","link":"https:\/\/www.buldakov.ru\/?p=2521","title":{"rendered":"Get-MailboxStatistics vs. PS script"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-162 size-full\" src=\"http:\/\/www.buldakov.ru\/wp-content\/uploads\/2008\/12\/community-logo.png\" alt=\"PowerShell Logo\" width=\"179\" height=\"100\" align=\"left\" \/>\u041f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0440\u0438\u043f\u0442\u044b, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u0442\u0435 \u0438\u043b\u0438 \u0438\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430. \u0418\u043d\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0441\u0431\u043e\u0440 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0418\u043d\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e\/\u0443\u0447\u0451\u0442\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043d\u0430\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435\u043c \u0442\u0435\u0445 \u0438\u043b\u0438 \u0438\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439. \u0422\u043e\u043d\u043a\u043e\u0441\u0442\u044c \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0442\u0430\u043c, \u0433\u0434\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 Exchange. \u043e\u0431\u044b\u0447\u043d\u043e, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0441\u043d\u0430\u0441\u0442\u043a\u0443 PS Microsoft.Exchange.Management.PowerShell.E2010 (Excahnge 2010):<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010<\/pre>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u043b\u0435\u0442 Get-MailboxStatistics \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443:<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">PS C:&gt; Get-Mailbox user | Get-MailboxStatistics\r\nGet-MailboxStatistics : Failed to commit the change on object &quot;MB-DATABASE&quot; because access is denied.\r\nAt line:1 char:45\r\n+ Get-Mailbox buldakov | Get-MailboxStatistics &lt;&lt;&lt;&lt;\r\n+ CategoryInfo\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : NotSpecified: (0:Int32) &#x5B;Get-MailboxStatistics], MapiAccessDeniedException\r\n+ FullyQualifiedErrorId : 46BEBAF0,Microsoft.Exchange.Management.MapiTasks.GetMailboxStatistics<\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u0430\u0432 \u0434\u043b\u044f \u0443\u0447\u0451\u0442\u043a\u0438, \u0438\u0437 \u043f\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430, \u0447\u0442\u043e \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0437\u0430\u043f\u0443\u0441\u043a \u0435\u0441\u0442\u044c. \u0422\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u043b\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f.<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">PS C:&gt;Get-ManagementRoleEntry &quot;*Get-MailboxStatistics&quot; | ? {$_.Role -like &quot;Mail \u00a0Recipients&quot;} | fl Name,Role\r\nName : Get-MailboxStatistics\r\nRole : Mail Recipients\r\n\r\nPS C:&gt;Get-ManagementRoleAssignment -Role &quot;Mail Recipients&quot; -GetEffectiveUsers | ? {$_.EffectiveUserName -like &quot;svc_Name&quot;} | fl Role,EffectiveUserName\r\nRole\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : Mail Recipients\r\nEffectiveUserName : svc_Name<\/pre>\n<p>\u041d\u0430\u0448\u0451\u043b\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 workaround. \u0414\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a Exchange \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 RemoteExchange.ps1:<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">. 'C:Program FilesMicrosoftExchange ServerV14binRemoteExchange.ps1'\r\nConnect-ExchangeServer -auto<\/pre>\n<p>\u0422\u043e\u0447\u043a\u0443 \u0441 \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u043c \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0440\u0438\u043f\u0442\u044b, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u0442\u0435 \u0438\u043b\u0438 \u0438\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430. \u0418\u043d\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0441\u0431\u043e\u0440 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0418\u043d\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e\/\u0443\u0447\u0451\u0442\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043d\u0430\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435\u043c \u0442\u0435\u0445 \u0438\u043b\u0438 \u0438\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439. \u0422\u043e\u043d\u043a\u043e\u0441\u0442\u044c \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0442\u0430\u043c, \u0433\u0434\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 Exchange. \u043e\u0431\u044b\u0447\u043d\u043e, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0441\u043d\u0430\u0441\u0442\u043a\u0443 PS Microsoft.Exchange.Management.PowerShell.E2010 (Excahnge 2010): Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 \u041e\u0434\u043d\u0430\u043a\u043e, \u0432 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[5,7,11],"tags":[],"class_list":["post-2521","post","type-post","status-publish","format-standard","hentry","category-exchange","category-powershell","category-life"],"_links":{"self":[{"href":"https:\/\/www.buldakov.ru\/index.php?rest_route=\/wp\/v2\/posts\/2521","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.buldakov.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.buldakov.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.buldakov.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.buldakov.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2521"}],"version-history":[{"count":1,"href":"https:\/\/www.buldakov.ru\/index.php?rest_route=\/wp\/v2\/posts\/2521\/revisions"}],"predecessor-version":[{"id":2794,"href":"https:\/\/www.buldakov.ru\/index.php?rest_route=\/wp\/v2\/posts\/2521\/revisions\/2794"}],"wp:attachment":[{"href":"https:\/\/www.buldakov.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2521"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.buldakov.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2521"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.buldakov.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}