Author Posts

August 3, 2018 at 6:10 pm

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)
}

August 4, 2018 at 11:56 pm

Try this:

August 9, 2018 at 4:47 pm

That worked. Thanks a lot!