Add Public Folder to AuthOrig Property

Welcome Forums General PowerShell Q&A Add Public Folder to AuthOrig Property

This topic contains 2 replies, has 2 voices, and was last updated by

 
Participant
3 months ago.

  • Author
    Posts
  • #105875

    Participant
    Points: 1
    Rank: Member

    I am currently looking for a way to update the AuthOrig property of a distribution group via PowerShell. We currently have an issue wherein modifying the SendAs field in the Exchange GUI will remove all our public folders that ARE permitted to sendas, so we've resorted to manually updating this field via ADSI edit. However, depending on the amount of users or groups to modify this can be very tedious and time consuming. I know I can use the bellow command to add a user and the get command does list the public folders, but I can't seem to add a public folder (I have tried via name, Canonical DN & DistinguishedName). Any tips or advise are greatly appreciated, perhaps there is a way to do this via the ADSI class?

    Set-DistributionGroup -Identity TestGroup -AcceptMessagesOnlyFrom user@test.com
    
    (Get-DistributionGroup -Identity TestGroup).AcceptMessagesOnlyFrom | ForEach {Write-Host $_.DistinguishedName}
    

    Here's my attempt at something via ADSI but I'm not sure how I would specifically add to the AuthOrig property. So far this just adds a user to a group.

    function Get-TEST_ADSPathUser ($username) {
        $string = Get-ADUser $username|Select-Object -ExpandProperty DistinguishedName
        $string = 'LDAP://' + $string
        [ADSI]$ADSPath = $string
        $ADSPath
    }
    
    function Get-TEST_ADSPathGroup ($group) {
        $string = Get-ADGroup $group|Select-Object -ExpandProperty DistinguishedName
        $string = 'LDAP://' + $string
        [ADSI]$ADSPath = $string
        $ADSPath
    }
    
    function Add-TEST_ADSIUser($username, $group) {
        $user = Get-TEST_ADSPathUser $username
        $group = Get-TEST_ADSPathGroup $group
        $group.Add($user.ADSPath)
    }
    
    
  • #105923

    Participant
    Points: 7
    Rank: Member

    Try this:

    • #108056

      Participant
      Points: 1
      Rank: Member

      That worked. Thanks a lot!

The topic ‘Add Public Folder to AuthOrig Property’ is closed to new replies.