Hi Readers,
I was analyzing the integration between the identity managemnt tool & exchange for one of the enviornment where mailboxes are not geeting auto deleted from idm. so I have got the list of ids that were disabled during last year. After that I have wriiten the below script to get the data out to excel so that I can compare.
## Script ot read from text or csv file & export to csv ##
## various exchange attributes for the list of users ##
## Author: Vikas Sukhija ##
## Date:- 03/21/2012 ##
## Description:- Csv or text file should be as below ##
## our enviornment cutom attribute contains employee id ##
###########################################################
## USR_LOGIN ##
## 10000013 ##
## 29990900 ##
## 99000000 ##
###########################################################
$data = import-csv $args[0]
# Create a collection to hold results (dynamic array)
$mbcombCollection = @()
# get all mailboxes so that looping occurs in memory
$mailbox = get-mailbox -resultsize unlimited
# loop thru the malboxes now
foreach ($i in $data)
{
$MBX = $mailbox | where {$_.CustomAttribute1 -eq $i.USR_LOGIN}
$MBXdisp = “” | select Name, ServerName, WhenChanged, HiddenFromAddressListsEnabled ,UserAccountControl,
ExchangeUserAccountControl, OrganizationalUnit
$MBXdisp.Name = $MBX.Name
$MBXdisp.ServerName = $MBX.ServerName
$MBXdisp.WhenChanged = $MBX.WhenChanged
$MBXdisp.HiddenFromAddressListsEnabled = $MBX.HiddenFromAddressListsEnabled
$MBXdisp.UserAccountControl = $MBX.UserAccountControl
$MBXdisp.ExchangeUserAccountControl = $MBX.ExchangeUserAccountControl
$MBXdisp.OrganizationalUnit = $MBX.OrganizationalUnit
$mbcombCollection += $MBXdisp
}
#export the collection to csv , change the path accordingly
$mbcombCollection | export-csv c:\idm\results\march2012.csv
####################################################################
You can customize it based on your enviornment.
