Announcement

Collapse
No announcement yet.

Simple Powershell Question - Please Help :)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Simple Powershell Question - Please Help :)

    Hi Peeps,

    I am trying to display the users who have the GenericAll and Send-As permission on a mailbox via Powershell.

    I can run the following command to get the GenericAll permission:

    get-mailbox "MailboxName" | get-ADPermission | where { ($_.AccessRights -like "*GenericAll*") }


    The Send-As Permissions as follows:

    get-mailbox "Mailbox" | get-ADPermission | where {($_.ExtendedRights -Like "*Send-As*") }


    However the problem is I am unable to join these two commands to one command. I have tried the following:


    Get-mailbox "Mailbox" | get-ADPermission | where { ($_.AccessRights -like "*GenericAll*") -and ($_.ExtendedRights -Like "*Send-As*") }

    This does not produce an error, it just returns me to the prompt.

    Can anyone help?

  • #2
    Re: Simple Powershell Question - Please Help

    Hi Pdog,

    I think Get-mailbox "Mailbox" | get-ADPermission | where { ($_.AccessRights -like "*GenericAll*") -or ($_.ExtendedRights -Like "*Send-As*") } works..

    Because -and operator wil display if the both arguments met... so try this one..

    Cheers!
    Kottees

    Comment


    • #3
      Re: Simple Powershell Question - Please Help

      I'll give it a go and report back.

      Thanks

      Comment

      Working...
      X