Azure / ArcEnabledServersGroupPolicy

Guidance and sample code to perform at-scale onboarding of servers to Arc via Group Policy
MIT License
10 stars 12 forks source link

Setting -AssessOnly does not work & does not support subfolders for ArcRemoteShare in 1.0.8 #25

Open Borgquite opened 5 months ago

Borgquite commented 5 months ago

In version 1.0.8, the AssessOnly check doesn't work at all. The issues I can see are:

In ScheduledTask.xml, the ArcRemoteShare switch parameter in the Scheduled Task now has single quotations around it:

https://github.com/Azure/ArcEnabledServersGroupPolicy/blob/4ab7424082c3ac7dda5fc9a7fe2f59a705fa2162/ArcGPO/%7B1BAEEB14-8CB1-42FC-960B-55C4B45AFB0B%7D/DomainSysvol/GPO/Machine/Preferences/ScheduledTasks/ScheduledTasks.xml#L4

But the code that updates it in DeployGPO still assumes there are no single quotes (from a previous version?)

https://github.com/Azure/ArcEnabledServersGroupPolicy/blob/4ab7424082c3ac7dda5fc9a7fe2f59a705fa2162/DeployGPO.ps1#L179

In addition, if the ArcRemoteShare has a backslash in it (e.g. ShareName\FolderName to store the logs in a subfolder) then the regular expression will break.

I'll submit a PR shortly with both of these fixed.