Powershell: AD + Exchange | Export-Csv

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

bsimon

Thread Starter
Joined
Apr 16, 2013
Messages
38
I'm very new to Powershell, but I've got a task that requires me to pull information from our AD users as well as their corresponding mailboxes in Exchange. We were recently bought out by another company and some departments are switching email domains while others are not.

I'd like to take this initiative to clean up inactive users in AD, hide inactive AD users from the GAL, update the default mail profile, and a few other things; however, I'm not about to go plugging in scripts and pretending like I know what I'm doing.

I can get all of it out by piping to Export-Csv, but it comes in patches. What I would like to do is gather some information from both AD and Exchange in the same export, but I'm not too familiar with the syntax to do so.

I'm getting what I want on disabled users in AD with:

Get-ADUser * | select SamAccountName,Enabled

And I'm also getting what I want (to some extent) in Exchange with:

Get-Mailbox * | select PrimarySMTPAddress,HiddenFromAddressListsEnabled
There are a few other things I'd like (e.g., mailbox size, which I've seen I can get with Get-MailboxStatistics), but the issues remains the same:

How can I get the indenting things above into one export?


Any suggestions or recommendations (or online study material) would be greatly appreciated.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top