Good Day All,
So we already have Parallels Desktop Business Edition deployed to a number of our clients but when it was deployed none of the settings were locked down. Our users are not admins but currently they can still create virtual machines as they please. I want to change the settings in Parallels to only allow administrators to have the ability to create new VMs and add existing VMs. Basically, I want to check all of these "Require Password" boxes on:
I found this older script on the Parallels website and I am able to modify it to do what I want, sort of. Here's the script I'm working on:
#!/bin/bash
vmdirectoryfile="/Library/Preferences/Parallels/vmdirectorylist.desktop.xml"
#Locking Snapshots
stringA='<CommonLockedOperations dyn_lists="LockedOperation"/>'
stringB='<CommonLockedOperations dyn_lists="LockedOperation">
<LockedOperation>24</LockedOperation>
<LockedOperation>8</LockedOperation>
<LockedOperation>7</LockedOperation>
<LockedOperation>44</LockedOperation>
</CommonLockedOperations>'
#sed -iE 's|$stringA|$stringB|g' $vmdirectoryfile #Locking down
perl -pi -w -e "s|$stringA|$stringB|g;" $vmdirectoryfile
# stringA="<LockedSign>0</LockedSign>"
# stringB="<LockedSign>1</LockedSign>"
# sed -i -e "s|$stringA|$stringB|g" $vmdirectoryfile
Basically, I'm able to do the find and replace going from stringA to stringB. The problem is that this will only work if the XML file doesn't already have any LockedOperations set. Some of our users might already have some LockedOperations. I need a way to always replace whatever they might already have set with what I want to be set. Does that make any sense?
Does anyone have any clues? I need some sort of wild cards and need a way for sed or perl to work with newlines.