PoshCode Archive  Hex Artifact Content

Artifact 178b7cd62216afd0b426f1de4b1c750668bb87399df00c6a3c778afd48107691:

  • File export-migrations.ps1 — part of check-in [9a185a7d5f] at 2018-06-10 13:58:24 on branch trunk — export all mailbox migration stats. (user: steve size: 620)

0000: 23 20 65 6e 63 6f 64 69 6e 67 3a 20 61 73 63 69  # encoding: asci
0010: 69 0d 0a 23 20 61 70 69 3a 20 70 6f 77 65 72 73  i..# api: powers
0020: 68 65 6c 6c 0d 0a 23 20 74 69 74 6c 65 3a 20 65  hell..# title: e
0030: 78 70 6f 72 74 20 6d 69 67 72 61 74 69 6f 6e 73  xport migrations
0040: 0d 0a 23 20 64 65 73 63 72 69 70 74 69 6f 6e 3a  ..# description:
0050: 20 65 78 70 6f 72 74 20 61 6c 6c 20 6d 61 69 6c   export all mail
0060: 62 6f 78 20 6d 69 67 72 61 74 69 6f 6e 20 73 74  box migration st
0070: 61 74 73 2e 0d 0a 23 20 76 65 72 73 69 6f 6e 3a  ats...# version:
0080: 20 30 2e 31 0d 0a 23 20 61 75 74 68 6f 72 3a 20   0.1..# author: 
0090: 73 74 65 76 65 0d 0a 23 20 6c 69 63 65 6e 73 65  steve..# license
00a0: 3a 20 43 43 30 0d 0a 23 20 78 2d 70 6f 73 68 63  : CC0..# x-poshc
00b0: 6f 64 65 2d 69 64 3a 20 35 36 34 35 0d 0a 23 20  ode-id: 5645..# 
00c0: 78 2d 61 72 63 68 69 76 65 64 3a 20 32 30 31 35  x-archived: 2015
00d0: 2d 30 32 2d 31 37 54 31 37 3a 35 31 3a 35 32 0d  -02-17T17:51:52.
00e0: 0a 23 20 78 2d 70 75 62 6c 69 73 68 65 64 3a 20  .# x-published: 
00f0: 32 30 31 35 2d 31 32 2d 31 35 54 31 36 3a 32 37  2015-12-15T16:27
0100: 3a 30 30 0d 0a 23 0d 0a 23 0d 0a 24 4d 69 67 72  :00..#..#..$Migr
0110: 61 74 69 6f 6e 73 20 3d 20 67 65 74 2d 6d 6f 76  ations = get-mov
0120: 65 72 65 71 75 65 73 74 0d 0a 0d 0a 66 6f 72 65  erequest....fore
0130: 61 63 68 20 28 24 6d 69 67 72 61 74 69 6f 6e 20  ach ($migration 
0140: 69 6e 20 24 6d 69 67 72 61 74 69 6f 6e 73 29 20  in $migrations) 
0150: 7b 47 65 74 2d 4d 6f 76 65 52 65 71 75 65 73 74  {Get-MoveRequest
0160: 53 74 61 74 69 73 74 69 63 73 20 24 6d 69 67 72  Statistics $migr
0170: 61 74 69 6f 6e 2e 61 6c 69 61 73 20 2d 49 6e 63  ation.alias -Inc
0180: 6c 75 64 65 52 65 70 6f 72 74 20 7c 20 73 65 6c  ludeReport | sel
0190: 65 63 74 20 64 69 73 70 6c 61 79 6e 61 6d 65 2c  ect displayname,
01a0: 73 74 61 74 75 73 2c 73 74 61 72 74 74 69 6d 65  status,starttime
01b0: 73 74 61 6d 70 2c 63 6f 6d 70 6c 65 74 69 6f 6e  stamp,completion
01c0: 74 69 6d 65 73 74 61 6d 70 2c 6f 76 65 72 61 6c  timestamp,overal
01d0: 6c 64 75 72 61 74 69 6f 6e 2c 74 6f 74 61 6c 6d  lduration,totalm
01e0: 61 69 6c 62 6f 78 73 69 7a 65 2c 74 6f 74 61 6c  ailboxsize,total
01f0: 6d 61 69 6c 62 6f 78 69 74 65 6d 63 6f 75 6e 74  mailboxitemcount
0200: 7d 20 7c 20 65 78 70 6f 72 74 2d 63 73 76 20 2d  } | export-csv -
0210: 44 65 6c 69 6d 69 74 65 72 20 27 3b 27 20 2d 4e  Delimiter ';' -N
0220: 6f 54 79 70 65 49 6e 66 6f 72 6d 61 74 69 6f 6e  oTypeInformation
0230: 20 2d 46 6f 72 63 65 20 2d 50 61 74 68 20 27 43   -Force -Path 'C
0240: 3a 5c 55 73 65 72 73 5c 54 65 73 74 65 72 5c 44  :\Users\Tester\D
0250: 65 73 6b 74 6f 70 5c 4d 69 67 72 61 74 69 6f 6e  esktop\Migration
0260: 73 74 61 74 73 2e 63 73 76 27 0d 0a              stats.csv'..