Looking for Export two report in one powershell Get-Mailbox | Get-mailboxpermission -


i working 5000 users in csv file, want check each has service account applied full-access mailbox.

i want output result along email , display name csv file.

so far code this:

get-mailbox -abc.xyz@test.com | select displayname,email  import-csv c:\test1.csv | foreach { get-mailboxpermission $_.name -user "svc-ex-@test.onmicrosoft.com"} 

try this:

import-csv c:\test1.csv | foreach-object {      $mailbox = get-mailbox -identity $_.name     $permission = ($mailbox | get-mailboxpermission -user "svc-ex-@test.onmicrosoft.com").accessrights      $properties = @{         name = $mailbox.displayname         email = $mailbox.primarysmtpaddress         permissions = $permission     }     new-object -typename psobject -property $properties } 

Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -