custom site subscribe CustomSite_Site_Name as “Site%20Name” on “Mon, 19 Jun 2006 15:14:23 -0700”
Note that spaces in the site name are translated to underscores in site name (the display name still contains a space).
Here’s some relevance for the action:
((not exists site “CustomSite_Site_Name”) OR (custom site subscription effective date “CustomSite_Site_Name” < universal time “Mon, 19 Jun 2006 15:14:23 -0700”))
I used the above in the past to set up a system where “Site_Name” was actually relevance substituted in based on the value of a location property. Computers would dynamically subscribe and unsubscribe to the correct custom site based on where they are located.
custom site subscribe CustomSite_-2d_FOO_-2d_BAR as "-%20FOO%20-%20BAR" on "Mon, 20 Aug 2007 12:00:00 -0600"
When I deploy this fixlet it fails. Looking in the .log file of the computer I deployed it to, I see the following:
Command failed (Error writing custom site designator to registry)
custom site subscribe CustomSite_-2d_FOO_-2d_BAR as "-%20FOO%20-%20BAR" on "Mon, 20 Aug 2007 12:00:00 -0600" (fixlet 4238)
Just create a custom site with the name you’d like using the console and subscribe a computer to it. You can pull the correct action script syntax by looking at the subscription action.
I took the recommendation of copying the action script from the subscription process changing the date with “now” so it’s always topical
custom site subscribe CustomSite_-2d_FOO_-2d_BAR as "%2d%20FOO%20%2d%20BAR" on now
When I go to deploy this it fails, and looking at the log on the target system, I get this error:
Command failed (Error writing custom site designator to registry) custom site subscribe CustomSite_-2d_PET_-2d_Infrastructure as "%2d%20FOO%20%2d%20BAR" on now (fixlet 4578)
I tested your action and it works, but you need to use relevance substitution for the ‘now’ command. To do so, you would write: “{now}”
However, instead of ‘now’, I would suggest you use ‘parameter “action issue date” of action’. That way, if you ever want to override the subscription action, you don’t need to stop the subscription action first. This is particularly important if you have multiple computers subscribed and you only want to stop subscription on one of them. Using ‘now’ you’d need to stop the main action and then issue 2 new actions, one for subscription and one for un-subscription. Long story short, use this:
custom site subscribe CustomSite_-2d_FOO_-2d_BAR as “%2d%20FOO%20%2d%20BAR” on “{parameter “action issue date” of action}”