Jump to content

Recommended Posts

Posted

Hi,

 

I must be having a bad day but i cannot figure out or find the information on how i can use get-mailbox but filter it down bases on department or title.

I want to set some options on some mailboxes.

 

Thanks

Posted

Hi,

 

I do not believe department is an attribute shown in the Get-Mailbox output, but the following should help. Department is shown in Get-MsolUser.

 

This Command will allow you to bring back all the users whom have X value in the Office Attribute.

 

get-mailbox | Where {$_.Office -ilike "MyOffice"}

 

This Command will allow you to bring back all the users whom have X value in the Department Attribute.

 

Get-MsolUser| Where {$_.Department -ilike "MyDepartment"}

 

I hope that helps,

James.

  • Thanks 1
Posted (edited)
Hi,

 

I do not believe department is an attribute shown in the Get-Mailbox output, but the following should help. Department is shown in Get-MsolUser.

 

This Command will allow you to bring back all the users whom have X value in the Office Attribute.

 

get-mailbox | Where {$_.Office -ilike "MyOffice"}

 

This Command will allow you to bring back all the users whom have X value in the Department Attribute.

 

Get-MsolUser| Where {$_.Department -ilike "MyDepartment"}

 

I hope that helps,

James.

 

 

But that would then pickup users who do not have mailboxes wouldn't it?

 

Thanks

Edited by FN-GM
Posted (edited)
But that would then pickup users who do not have mailboxes wouldn't it?

 

Thanks

 

If you were to run Get-MsolUser that indeed is the case. If you do want to use Department then in order to get ONLY Mailboxes back it would need to be more specific i.e. What License SKU they have for example.

 

You could use the following, but then this assumes that the license assigned to all users includes Exchange.

 

Get-MsolUser | Where {($_.Department -ilike "GBS") -and ($_.IsLicensed)}

 

 

Thanks,

James.

Edited by EduTech

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...