Link to home
Start Free TrialLog in
Avatar of pramod1
pramod1Flag for United States of America

asked on

exchange, powershell

I need to run this with result size unlimited? wher e do I add result size unlimied

Get-Mailbox | Get-MailboxPermission | where {$_.user.tostring() -ne "NT AUTHORITY\SELF" -and $_.IsInherited -eq $false}
Avatar of FOX
FOX
Flag of United States of America image

Get-Mailbox -ResultSize Unlimited | Get-MailboxPermission | where {$_.user.tostring() -ne "NT AUTHORITY\SELF" -and $_.IsInherited -eq $false}
Avatar of pramod1

ASKER

wondered if there is a way to get the Access Rights field to represent the level access (I.E Editor, Reviewer or Full access)?  
Get-Mailbox -Resultsize Unlimited | %{Get-MailboxPermission $_.Alias |  where {$_.user.tostring() -ne "NT AUTHORITY\SELF" -and $_.IsInherited -eq $false} | Select Identity,User,Accessrights |  Export-csv c:\temp\mailboxpermissions.csv -notypeinformation

Open in new window

Pramod- going forward try to let us know exactly what your requirements are in your initial inquiry
Avatar of pramod1

ASKER

sorry sir, appreciate your kind help
Avatar of pramod1

ASKER

InkedCapture_LI.jpg

error attached
Then you can't use the -ResultSize Unlimited 
You'd need to filter them out
#Mailboxes
$AllMailboxes = Get-Mailbox -ResultSize Unlimited | select Alias,User,IsInherited

@AllPermissions=@()

foreach($mailbox in $AllMailboxes){
    $AllPermissions+=Get-MailboxPermission $mailbox.Alias |  where {$mailbox.user.tostring() -ne "NT AUTHORITY\SELF" -and $mailbox.IsInherited -eq $false} | Select Identity,User,Accessrights
} 

$AllPermissions |  Export-csv c:\temp\mailboxpermissions.csv -notypeinformation



Open in new window


Avatar of pramod1

ASKER

1.PNG ( error attached)

I ran as .ps1 .


You're not doing the code I posted :) The line breaks are there for a reason buddy
if you want to use it as a single block of code then use ";" at the end of each line.
Avatar of pramod1

ASKER

 thanks ok I am trying this now, let me know

Get-Mailbox -resultsize unlimited | Get-MailboxPermission | where {$_.user.tostring() -ne "NT A
UTHORITY\SELF" -and $_.IsInherited -eq $false} | Select Identity,User,@{Name='AccessRights';Expression={[string]::join('
, ', $_.AccessRights)}} | Export-Csv c:\temp\mailboxpermissions.csv -NoTypeInformation
Avatar of pramod1

ASKER

Ok I just pasted as is what u sent

It just took lines as of now waiting for cursor to move
pramod- did you run this ?


Get-Mailbox -Resultsize Unlimited | %{Get-MailboxPermission $_.Alias |  where {$_.user.tostring() -ne "NT AUTHORITY\SELF" -and $_.IsInherited -eq $false} | Select Identity,User,Accessrights |  Export-csv c:\temp\mailboxpermissions.csv -notypeinformation
Avatar of pramod1

ASKER

Yrs I pasted the error in this thread above
what you pasted does not show my command for me to verify if it is what I sent you.
Avatar of pramod1

ASKER

Just a sec
Avatar of pramod1

ASKER

User generated image
Avatar of pramod1

ASKER

I am getting above, did you miss anything in command line?
I missed on bracket...go for it again below

Get-Mailbox -Resultsize Unlimited | %{Get-MailboxPermission $_.Alias |  where {$_.user.tostring() -ne "NT AUTHORITY\SELF" -and $_.IsInherited -eq $false}} | Select Identity,User,Accessrights |  Export-csv c:\temp\mailboxpermissions.csv -notypeinformation
Avatar of pramod1

ASKER

ok running now, thanks
Avatar of pramod1

ASKER

Fox:
it did give the results under identity , user rights but  wish we could see what exact permissions were granted, is there any way to do that?  it just gives below  for all identities, user rights.
AccessRights
Microsoft.Exchange.Management.RecipientTasks.MailboxRights[]

Please paste one line of output so I can see
Did you run this in Exchange management shell?
Avatar of pramod1

ASKER

yes sir
ASKER CERTIFIED SOLUTION
Avatar of FOX
FOX
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pramod1

ASKER

running , will update once done
Avatar of pramod1

ASKER

it worked, thanks for all help