snagrat Posted January 23, 2017 Posted January 23, 2017 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?
robk Posted January 24, 2017 Posted January 24, 2017 Not sure, but would suspect not. The local and remote ou's are likely different.
snagrat Posted January 24, 2017 Author Posted January 24, 2017 Yeh not sure it is possible. Going to use CustomAttributes instead
Norphy Posted January 24, 2017 Posted January 24, 2017 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now