PS Script not working on Windows 10 Task Sequence RRS feed

  • Question

  • I use this script on my Windows 7 and 8 task sequences to add a computer account into a security group and it works perfectly.  However, it is not working on my Windows 10 task sequence.  

    See the picture for the error message I get.

    Thanks for your help.

    $ComputerName = get-content env:computername
    $GroupPath = "LDAP://CN=DirectAccessComputers,OU=Security Groups,DC=yada,DC=yada,DC=yada,DC=yada"
    $computerPath = "LDAP://CN=$ComputerName,OU=NewComputers,DC=yada,DC=yada,DC=yada,DC=yada" 

    $Group =[ADSI]"$GroupPath"

    Thursday, February 25, 2016 6:51 PM

All replies