Welcome to Powergui.org - an open source community for Windows Powershell

PowerGUI.org PowerGUI.org and blogs

Forums » Active Directory and PowerShell

Thread: query Multivalued Properties exchange 2007 GrantSendonBehalfto

This question is answered.


Permlink Replies: 6 - Pages: 1 - Last Post: Nov 9, 2009 7:16 AM by: FuserKill
FuserKill

Posts: 28
Registered: 9/29/08
query Multivalued Properties exchange 2007 GrantSendonBehalfto
Posted: Nov 6, 2009 1:54 PM
 
  Click to reply to this thread Reply

On a Given Distribution list I get a {} instead of names when I run the following command in powershell. How do I get an output of the users in the GrantSendonBehalfto parameter?

[PS] C:\Windows\System32>Get-DistributionGroup "Choice - All Mailboxes" | Format
-List Name, GrantSendOnBehalfTo


Name                : Choice - All Mailboxes
GrantSendOnBehalfTo : {}

Many thanks

Tom




Shay Levy


Posts: 1,919
Registered: 1/31/08
Re: query Multivalued Properties exchange 2007 GrantSendonBehalfto
Posted: Nov 8, 2009 3:33 AM   in response to: FuserKill
Helpful
  Click to reply to this thread Reply

If the value of GrantSendOnBehalfTo is "{}" (blank) then no other mailbox user has permission to send on behalf of this distribution group.

Shay Levy [MVP]
http://blogs.microsoft.co.il/blogs/ScriptFanatic
PowerShell Toolbar
FuserKill

Posts: 28
Registered: 9/29/08
Re: query Multivalued Properties exchange 2007 GrantSendonBehalfto
Posted: Nov 9, 2009 6:08 AM   in response to: Shay Levy
 
  Click to reply to this thread Reply

Shay,

Thanks for the response, so I know this list has a list of approved senders, perhaps I am looking at the wrong parameter. See the attached screen shot.

I am trying to expose the list of usernames compiled under Accept Messages from Only the senders on this list.

The list is populated in the Gui as you can see, so I have to assume I am using the wrong parameter.

could you help me figure out what parameter would expose this list, and the syntax of that command?


Thx in advance ,

Tom

*****Update*******

Ok I have found the command

Get-DistributionGroup "Choice - All Mailboxes" | Select-Object -property DisplayName,AcceptMessagesOnlyFrom

When I run this in the command line I get a cutoff list
 

DisplayName                             
-----------                           
Choice - All Mailboxes 

AcceptMessagesOnlyFrom
----------------------
{Chalian, Hrag, Gonzalez, Elba, Belt...



So When I try to exportit to a csv or html I get an output like so...

DisplayName            
Choice - All Mailboxes

AcceptMessagesOnlyFrom 
Microsoft.Exchange.Data.MultiValuedProperty`1[Microsoft.Exchange.Data.Directory.ADObjectId]


How Do I get this thing exposed??

Message was edited by: FuserKill


Shay Levy


Posts: 1,919
Registered: 1/31/08
Re: query Multivalued Properties exchange 2007 GrantSendonBehalfto
Posted: Nov 9, 2009 6:24 AM   in response to: FuserKill
Helpful
  Click to reply to this thread Reply

It's the wrong attribute :), Try this:Get-DistributionGroup -Filter {AcceptMessagesOnlyFrom -ne $null} | Format-List Name,AcceptMessagesOnlyFrom



Shay Levy [MVP]
http://blogs.microsoft.co.il/blogs/ScriptFanatic
PowerShell Toolbar
FuserKill

Posts: 28
Registered: 9/29/08
Re: query Multivalued Properties exchange 2007 GrantSendonBehalfto
Posted: Nov 9, 2009 6:49 AM   in response to: Shay Levy
 
  Click to reply to this thread Reply

Ok we are getting closer, I narrowed down your command to just the list I want but It cuts it off and does not seem to be exportable to csv or html. Now that we have properly identified the attribute how can I extract the full list? (I also tried a different set of commands with similar results that I posted as an edit before your last response)

[PS] U:\>Get-DistributionGroup "Choice - All Mailboxes" | Format-List Name,Accep
tMessagesOnlyFrom


Name                   : Choice - All Mailboxes
AcceptMessagesOnlyFrom : {Chalian, Hrag, Gonzalez, Elba, Beltran, Wendy, Kearne
                         y, Kate, Plonisch, Gregg, Baum, Helmuth, Lawson, Natha
                         niel, Mullings, Leacer, Thomas, Darlene, Velasquez, Je
                         nnie, McKoy, Larry, Somma, Vikki, Beros, Chris, Rolon,
                          Hector, Iuzzini, Fran, Tolbert, Ernest...}


Thanks you for your help...

Message was edited by: FuserKill


Shay Levy


Posts: 1,919
Registered: 1/31/08
Re: query Multivalued Properties exchange 2007 GrantSendonBehalfto
Posted: Nov 9, 2009 7:05 AM   in response to: FuserKill
Answered
  Click to reply to this thread Reply

This will make output ready for exporting to csv file. It joins all the users name, delimited by semicolon:

Get-DistributionGroup "Choice - All Mailboxes" | select name,@{Name="AcceptMessagesOnlyFrom";Expression={[string]::join(";",($_.AcceptMessagesOnlyFrom | foreach {$_.Name}))}}


You should get results similar to:

Name   AcceptMessagesOnlyFrom
----   ----------------------
TestDG Chalian, Hrag, Gonzalez, Elba, Beltran...


To save it to csv file pipe the command to export-csv.


Shay Levy [MVP]
http://blogs.microsoft.co.il/blogs/ScriptFanatic
PowerShell Toolbar
FuserKill

Posts: 28
Registered: 9/29/08
Re: query Multivalued Properties exchange 2007 GrantSendonBehalfto
Posted: Nov 9, 2009 7:16 AM   in response to: Shay Levy
 
  Click to reply to this thread Reply

Yes that is it thank you also found something similar from an old post you helped someone with here...http://social.technet.microsoft.com/Forums/en/ITCG/thread/6b5fbd76-8c9a-4d41-b291-9496ba9626e0

Thanks for you help Shay. This forum always comes though.

Tom


Legend
MVP: 2501 + pts
Guru: 2001 - 2500 pts
Expert: 751 - 2000 pts
Enthusiast: 31 - 750 pts
Novice: 0 - 30 pts
Moderators
Helpful answer (5 pts)
Answered (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums