This is a modified version of the PKISync.ps1 script provided by Microsoft. The original script and documentation can be found here. Microsoft's guidance regarding the entire procedure can be found here.
This modifed version includes code to allow for you to import objects into a different forest where there is not a 2 way trust. The script will prompt for source forest and target forest crednetials to allow the script to do its work. You will need to run this script from a server in the source forest. If you are getting an acces denied error when running the original script, this modified version should solve your problem.