Below is a snippet from a PowerShell script I've written for creating accounts for new hires. This particular snippet is a question of whether to create & set the Home Directory for the newly created user in AD.
For reference, I have Global variables set through various methods and have verified that these are correct as the rest of the script works perfectly...
The part that ISN'T working is: "Exception calling "AddAccessRule" with "1" argument(s): "The trust relationship between this workstation and the primary domain failed."
Now, before anyone goes down the road of "You should unjoin and rejoin your computer from the domain", let me confirm THIS IS NOT THE ISSUE. Prior to this section of the script, I am able to authenticate to AD, create the new account and drop them into the OU I am an Admin of, as well as copy the Group Memberships...