Monday 17 September 2012

How to pull the report to only 500 group ids even if your organisation is having more than 10000 groups?

For example,  you are having more than 2000 groups in your organisation. Now you are in a situation to get the details of owners name of 500 groups only. How you will do?

We can use Get-content to get the data from the text file with the path name mentioned and do the pipeline to the command like below


[PS] C:\Users\sankar\desktop>$list = Get-Content .\groupid.txt | ?{$_ -ne ""} |%{$_.Trim()}
[PS] C:\Users\sankar\desktop>$list.Count
547
[PS] C:\Users\sankar\desktop>$list | % {Get-DistributionGroup -Identity $_ -ResultSize Unlimited | Select-
Object Name,@{L="ManagedBy";E={$_.ManagedBy}}} | Export-Csv -NoTypeInformation grouplistfromtext.csv


Friday 7 September 2012

Find out No longer Existing Group

This exchange cmdlet would be helpful if you are dong auditing in your organization. You could filter no longer users details using last log on time.


Get-MailboxStatistics -Server <ServerIdParameter> | Sort-Object LastLogonTime Descending

Wednesday 5 September 2012

How to get the details of email addresses Using Powershell

We can use the below exchange cmdlet to pull the details of email addresses. Then export it to the CSV file using Export-CSV cmdlet. 

Get-Mailbox -resultsize unlimited | Select Name, @{Name=’EmailAddresses’;Expression={[string]::join(";", ($_.EmailAddresses))}} | Export-CSV EmailAddress.csv