locked
FULL AcceptMessagesOnlyFrom RRS feed

  • Question

  • Hello,

    I use Exchange 2007 and run the below script to get the accept message only from:

    Get-Content C:\Scripts\List.txt | Get-DistributionGroup | Select-Object DisplayName, AcceptMessagesOnlyFrom > C:\RIGHTS.csv
    
    
    C:\RIGHTS.csv
    


    It results that I am not able to see the entire AcceptMessagesOnlyFrom field on the notepad file:

    DisplayName                             AcceptMessagesOnlyFrom                
    -----------                             ----------------------                
    Infra-IT_MANAGER            {JOHN SMITH, STEPHANE DOWLING, ANDR...


    Would you know how I can get the full AcceptMessagesOnlyFrom field in the notepad?

    Thanks,
    Graig

    Friday, August 24, 2012 9:03 AM

Answers

  • Try this:

    Get-content c:\list.txt| foreach{
    
    $DisplayName=(Get-distributiongroup -identity $_).DisplayName
    
    $users=(Get-distributiongroup -identity $_).AcceptMessagesOnlyFrom|%{$_.Name}
    
    "DisplayName:"
    
    $DisplayName
    
    "AcceptMessagesOnlyFrom:"
    
    $users
    
    } > c:\rights.txt

    Thanks,

    Evan


    Evan Liu

    TechNet Community Support

    Thursday, August 30, 2012 10:07 AM
    Moderator

All replies

  • Hi,

    What output you get when run this command ?

    Get-Content C:\Scripts\List.txt | Get-DistributionGroup -ResultSize unlimited | Select-Object DisplayName, AcceptMessagesOnlyFrom > C:\RIGHTS.csv
    
    


    Thanks, Swapnil Prajapati

    Friday, August 24, 2012 10:24 AM
  • Hello Graig,

    You can change your command to this:

    Get-Content C:\Scripts\List.txt | Get-DistributionGroup | fl DisplayName, AcceptMessagesOnlyFrom > C:\RIGHTS.csv

    Thanks,

    Evan


    Evan Liu

    TechNet Community Support


    Monday, August 27, 2012 6:42 AM
    Moderator
  • Hi Swapnil,

    I tried but I still get the .. at the end the list

    Tuesday, August 28, 2012 10:48 AM
  • Hello Evan,

    I finally get the entire list thank you!! Would you know If I could get it as is:

    JOHN SMITH
    STEPHANE DOWLING
    ANDREA SBROLA

    Thanks again,
    Graig

    Tuesday, August 28, 2012 10:50 AM
  • Try this:

    Get-content c:\list.txt| foreach{
    
    $DisplayName=(Get-distributiongroup -identity $_).DisplayName
    
    $users=(Get-distributiongroup -identity $_).AcceptMessagesOnlyFrom|%{$_.Name}
    
    "DisplayName:"
    
    $DisplayName
    
    "AcceptMessagesOnlyFrom:"
    
    $users
    
    } > c:\rights.txt

    Thanks,

    Evan


    Evan Liu

    TechNet Community Support

    Thursday, August 30, 2012 10:07 AM
    Moderator