send as access for each user powershell exchange 2013/2010

I am trying to pull send as access for each user and having a hard time

I am getting this error below

Pipeline not run because a pipeline is already running. Pipelines cannot be run concurrently.
    + CategoryInfo          : OperationStopped: (Microsoft.Power...tHelperRunspace:ExecutionCmdletHelperRunspace) []
    + FullyQualifiedErrorId : RemotePipelineExecutionFailed

here is the code I am running.

$lusers = get-content c:\temp\alias.csv
$lusers | foreach-object {get-mailbox -id $_ } | `
Get-ADpermission | ? {($_.ExtendedRights -like "*send-as*") -and -not ($_.Trustee -like "nt authority\self")}
Who is Participating?
$lusers = get-content c:\temp\alias.csv
$lusers | foreach { Get-ADpermission -Identity $_ } | Where{($_.ExtendedRights -like "*send-as*") -and -not ($_.Trustee -like "nt authority\self")}

Open in new window

techdriveAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.