0

How do I expand the

 $thisPerms  = Get-Mailbox username  -ResultSize unlimited 

 Get-ADPermission $thisPerms.Identity 
           | Where {$_.ExtendedRights -like "Send-As" -and $_.User.ToString() -ne "NT AUTHORITY\SELF" -and $_.Deny -eq $false}  
           | select user, ExtendedRights, identity, isinherited -ExpandProperty ExtendedRights
           | Export-Csv c:\out.csv\]

Output to screen

User                          ExtendedRights                Identity                                        IsInherited
----                          --------------                --------                                        -----------
domain\user                   {Send-As}                      company.com/Division/Corporate...                         False                    

Output to text file

Notice how ExtendedRightIdParameter is rendered instead of the SendAs permission

#TYPE Microsoft.Exchange.Configuration.Tasks.ExtendedRightIdParameter
"User","ExtendedRights","Identity","IsInherited"
company\user","Microsoft.Exchange.Configuration.Tasks.ExtendedRightIdParameter[]","company.com/Division/Corporate Services/User","False"

How do I get the CSV to contain the output of ExpandProperty?

2

It looks like you need to convert the ExtendedRights property to string.. to do this.. use the ToString method

Name           MemberType   Definition
----           ----------   ----------
Equals         Method       bool Equals(System.Object obj)
GetHashCode    Method       int GetHashCode()
GetType        Method       type GetType()
ToString       Method       string ToString()
ExtendedRights NoteProperty  ExtendedRights=null
| improve this answer | |
  • How did you get all the members and the member type? – goodguys_activate May 2 '13 at 0:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.