[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 641
  • Last Modified:

Get-Exchange mailbox users

As per our client requirement we need to generate a report of all unity servers users who are enabled/not enabled in GAL in the below format (hide from Addresslist)

displayName  sAMAccountName  email  msExchHideFromAddressLists  Description server

I have tried a script which gives me the users who are not enabled from GAL, but getting output in a different format.

$serverlist = "C:\unity.txt"

foreach ($server in Get-Content $serverlist)
{

Get-Mailbox -ResultSize unlimited |Where{($_.servername -eq "$server") -and ($_.HiddenFromAddressListsEnabled -eq $false)}

}

the format i am getting is
  Name      Alias      ServerName

Can u help me in finetuning this script to get the required format
0
AhmedAliShaik
Asked:
AhmedAliShaik
  • 2
  • 2
1 Solution
 
Manpreet SIngh KhatraSolutions Architect, Project LeadCommented:
Get-Mailbox -ResultSize unlimited |Where{($_.servername -eq "$server") -and ($_.HiddenFromAddressListsEnabled -eq $false)} | FL DisplayName, sAMAccountName, email, msExchHideFromAddressLists, Server

- Rancy
0
 
AhmedAliShaikAuthor Commented:
I accept with you, but the powershell gives only the mailboxes where the msExchHideFromAddressLists is false.

Please correct me if i am wrong.

I need all the list and will filter it manually by the msExchHideFromAddressLists result as per requirement.
0
 
Manpreet SIngh KhatraSolutions Architect, Project LeadCommented:
Get-Mailbox -ResultSize unlimited |Where{($_.servername -eq "$server") | FL DisplayName, sAMAccountName, email, msExchHideFromAddressLists, Server

- Rancy
0
 
AhmedAliShaikAuthor Commented:
Rancy :- Thanks a lot.
0

Featured Post

Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now