Got the same error - even using your last example.
My command is :
New-Object System.DirectoryServices.ActiveDirectoryAccessRule $AdminSID, "GenericWrite", "Allow"
New-Object : Cannot find an overload for "ActiveDirectoryAccessRule" and the argument count: "3".
Or using the method syntax :
[System.DirectoryServices.ActiveDirectoryAccessRule]::new(
$AdminSID,
[System.DirectoryServices.ActiveDirectoryRights]::GenericWrite,
[System.Security.AccessControl.AccessControlType]::Allow)
Cannot find an overload for "new" and the argument count: "3".
Any suggestion ?
Thanks :-)