Importing and exporting Group Policy Preference items is really, _really_ easy. It’s as easy as drag&dropping the setting from the Group Policy Editor directly into a folder or right-clicking the setting and choosing “Copy” and later “Paste”.
In those Technet Forums, there was a guy reporting that Group Policy Preference “Scheduled Tasks” wouldn’t work. He created two scheduled tasks and exported the two settings. He used the button “Display the xml data…” (but copy and pasting the two setting would have resulted in the same data - except that the button only generates one file instead of two).
He would then go and import the two settings on another machine, but GPE fails with an error message: “the pasted document is invalid and will be ignored”
What happened? Luckily he had pasted the output-XML code that he exported so the forum visitors could have a look at it. Opening the XML file showed that there was a parsing error and that there were “white spaces” missing. Looking at the file manually, I could see that there wasÂ a syntax error in the file, as the scheduled task arguments for running an application had a double-quote, like
args=”"-arg value”" instead of args=”-arg value”.
Replacing the double quotes made the error go away. I checked with my own test-domain to see why there would be double quotes — and the reason was simple. The guy from the forums asking the question simply specified the arguments for exection enclosed in quotation marks instead of just writing the arguments in there. That resulted in GPE just adding the string (with quotation marks) the user entered in putting in the XML file.
Â instead of
It seems like GPE doesn’t check whether the user entered a set of quotation marks (”) which will result in an error. I have not checked that with other Preference settings but am pretty sure this might be an issue somewhere else. I’ve forwarded that to the Group Policy Team, let’s see if there’s a chance they can let GPE check for quotation marks with an update.