Powershell - Forest.SetSelectiveAuthenticationStatus Method - Not working RRS feed

  • Question

  • I have written a script to create an Active Directory Trust. The trust creation works fine, but when I attempt to set the selective authentication it does not work.

    $SourceContext = New-Object System.DirectoryServices.ActiveDirectory.DirectoryContext("Forest","mydomain.com")
    $SourceDomainOBJ = [System.DirectoryServices.ActiveDirectory.Forest]::GetForest($SourceContext)
    $SourceDomainOBJ.SetSelectiveAuthenticationStatus("otherdomain.com", $false)

    The code executes and returns what is expected, but if you open he actual trusts from Active Directory Domains and Trusts it hasn't made the change.

    Any ideas why it wouldn't be applying?

    Wednesday, February 12, 2014 11:33 AM


  • Hi,

    If you want to enable selective authentication, the value for the should be $true, please change the value to true and check the result:

    $SourceDomainOBJ.SetSelectiveAuthenticationStatus("otherdomain.com", $true)

    Yan Li

    Regards, Yan Li

    • Marked as answer by Yan Li_ Tuesday, February 25, 2014 1:47 AM
    Thursday, February 13, 2014 8:44 AM