Hi Don,
I don't have access to my lab at the moment but here are a few options I would try....
- Set the GUID as a variable like you did with domain and base path
- use backtick (i.e. this character ` ) to escape the curly brackets any other special meaning characters
- Use the Ldap-Display-Name e.g. https://learn.microsoft.com/en-us/windows/win32/adschema/a-gplink
- Find someone else's script and see if you can adapt that e.g. https://gist.github.com/leobouard/027bbcc9941d80c8175cb337147fc0e4
- Call CMD.exe to run the DSACLS command
Actually 4 should be 1 ....
Good luck - I hope one of these helps.