Automatic Site Subscription

(imported topic written by SystemAdmin)

I am trying to automate the subscription of computers to custom sites. I see in the WinActions document the “subscribe” action but the example shows

subscribe "__Download\Sitename.fxm"

I can’t seem to find the .fxm files to subscribe these computers to.

Am I going about this in the wrong fashion? Is there another/easier way to automatically subscribe machines to a custom site?

Thanks,

Alan

(imported comment written by jessewk)

Hi Alan,

You can use this syntax:

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.

-Jesse

(imported comment written by SystemAdmin)

Perhaps I’m missing something…

Here is the contents of my fixlet action:

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)

(imported comment written by jessewk)

If you percent encode the dashes it should work:

custom site subscribe CustomSite_-2d_FOO_-2d_BAR as  "%2d%20FOO%20%2d%20BAR" on "Mon, 20 Aug 2007 12:00:00 -0600"

(imported comment written by SystemAdmin)

This still seems to fail

custom site subscribe CustomSite_-2d_FOO_-2d_BAR as  "%2d%20FOO%20%2d%20BAR" on "Mon, 20 Aug 2007 12:00:00 -0600"

I’m not sure how to properly format the site name “- FOO - BAR”

Thanks

(imported comment written by jessewk)

Hi Alan,

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.

Jesse

(imported comment written by StacyLee)

An easier way w/o having to do any custom fixlets is:

-right click any computer and select edit settings

-click more options

-check custom site membership

-subscribe to site <pick your site from the pull down.

-select the targets tab and pick all computers or however you want to targer your machines

-Contraints tab, uncheck “ends on”

-hit ok and enter your password

you are good to go with a automatic custom site membership for you group of machine set as a policy action.

cheers

(imported comment written by SystemAdmin)

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 have no idea why it’s failing.

(imported comment written by jessewk)

Hi Alan,

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}”

-Jesse

(imported comment written by SystemAdmin)

Thank you so much! That worked wonderfully.