I like this better.. but both have their advantages.. do this for all Cas/Hubs
Get all distribution lists:
Get-DistributionGroup | Select-Object PrimarySMTPAddress | Sort-Object
PrimarySMTPAddress | Export-CSV DL1-ALL.csv -notype
Get all distribution lists used over last 30 days:
Get-MessageTrackingLog -Server CASHUBxx -EventId Expand -ResultSize Unlimited
|Sort-Object RelatedRecipientAddress | Group-Object RelatedRecipientAddress
|Sort-Object Name | Select-Object
@{label="PrimarySmtpAddress";expression={$_.Name}}, Count | Export-CSV
DL1-Active.csv -notype
Compare preview two files and present list of inactive:
$file1 = Import-CSV -Path "DL1-ALL.csv"
$file2 = Import-CSV -Path "DL1-Active.csv"
Compare-Object $file1 $file2 -Property PrimarySmtpAddress -SyncWindow 500
|Sort-Object PrimarySmtpAddress | Select-Object -Property PrimarySmtpAddress
|Export-Csv DL1-Inactive.csv -NoType
Alice
From: [email protected] [mailto:[email protected]] On
Behalf Of Gavin Wilby
Sent: Thursday, November 19, 2015 2:49 AM
To: '[email protected]' <[email protected]>;
[email protected]
Subject: [Exchange] RE: Distribution Group last used
That's perfect, thanks very much.
Gavin Wilby
IT Support Engineer
From: [email protected]<mailto:[email protected]>
[mailto:[email protected]] On Behalf Of Michael B. Smith
Sent: 18 November 2015 15:06
To: [email protected]<mailto:[email protected]>;
'[email protected]'
Subject: [NTSysADM] RE: Distribution Group last used
Were you here yesterday? :)
http://exchangepedia.com/2009/02/are-distribution-groups-really-being-used.html
I think message tracking logs are only kept around for 30 days by default, so
you'll likely need to bump that up for your purposes, unless you back them up.
From: [email protected]<mailto:[email protected]>
[mailto:[email protected]] On Behalf Of Gavin Wilby
Sent: Wednesday, November 18, 2015 9:45 AM
To: '[email protected]'; '[email protected]'
Subject: [Exchange] Distribution Group last used
Hi all,
We have a vast amount of distribution groups that need consolidating. To ease
the process is there a method to see when the last time a group was used.
It means that any that are say over 3 months old can just be deleted.
Gavin Wilby
IT Support Engineer
SMP Partners Ltd
Clinch's House, Lord Street,
Douglas, Isle of Man IM99 1RZ
Tel +44 1624 682214
Mob +44 7624 480575
[email protected]<mailto:[email protected]>
www.smppartners.com<http://www.smppartners.com/>
A member of the SMP Partners Group of Companies
SMP Partners Limited, SMP Trustees Limited and SMP Fund Services Limited are
licensed by the Isle of Man Financial Services Authority. SMP Accounting & Tax
Limited is a member of the ICAEW Practice Assurance Scheme.
SMP Partners Limited registered in the Isle of Man, Company Registration No:
000908V
Directors: M.W. Denton, M.J. Derbyshire, S.E McGowan, O. Peck, J.J. Scott, S.J.
Turner
SMP Trustees Limited registered in the Isle of Man, Company Registration No:
068396C
Directors: A.C. Baggesen, J.M. Cubbon, M.W. Denton, K.M. Goldie, O Peck, J.
Watterson
SMP Fund Services Limited registered in the Isle of Man, Company Registration
No: 120288C
Directors: V. Campbell, R.K. Corkhill, M.W. Denton, D.A. Manser, S.E McGowan,
J.J. Scott
SMP Accounting & Tax Limited registered in the Isle of Man, Company
Registration No: 001316V
Directors: I.F. Begley, A.J. Dowling, P. Duchars, J.J. Scott, S.J. Turner
SMP Capital Markets Limited registered in the Isle of Man, Company Registration
No: 002438V
Directors: M.W. Denton, M.J. Derbyshire, D.F Hudson, S.E McGowan, O. Peck, J.J.
Scott.
SMP Partners Limited, SMP Trustees Limited, SMP Fund Services Limited, SMP
Accounting & Tax Limited and SMP Capital Markets Limited are members of the SMP
Partners Group of Companies.
This email is confidential and is subject to disclaimers. Details can be found
at: http://www.smppartners.com/disclaimer.html
______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________
______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________