Jump to content

Recommended Posts

Posted

I'm trying to filter a Get-Mailbox command in Office 365 so it only outputs user's of a particular OU on the on-premise domain.

 

We are using ADSync.

 

Is it possible?

Posted

Probably the "best" way would be to use Get-ADUser and put the results of that into a variable. You'd then be able to step through the variable and do a Get-Mailbox for the users.

 

Something like:

 

$Users = Get-ADUser -searchbase "ou=your,ou=ou,ou=here,dc=your,dc=domain,dc=here" -properties mail -filter {enabled -eq true}

$users | foreach
    {get-mailbox -identity $_.mail}

 

That's off the top of my head, I haven't tested it.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...