{"id":103494,"date":"2020-02-27T07:00:00","date_gmt":"2020-02-27T15:00:00","guid":{"rendered":"http:\/\/devblogs.microsoft.com\/oldnewthing\/?p=103494"},"modified":"2020-02-26T18:07:08","modified_gmt":"2020-02-27T02:07:08","slug":"20200227-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20200227-00\/?p=103494\/","title":{"rendered":"How can I configure my Windows NT service to autostart when the system gains Internet access?"},"content":{"rendered":"<p>When configuring a Windows NT service, you can set the <code>SERVICE_<\/code><code>TRIGGER_<\/code><code>INFO<\/code> to include a <code>SERVICE_<\/code><code>TRIGGER<\/code> that uses the <code>SERVICE_<\/code><code>TRIGGER_<\/code><code>TYPE_<\/code><code>IP_<\/code><code>ADDRESS_<\/code><code>AVAILABILITY<\/code> trigger, so that it starts and stops based on whether the system has network access.<\/p>\n<table class=\"cp3\" style=\"border-collapse: collapse;\" border=\"1\" cellspacing=\"3\" cellpadding=\"3\">\n<tbody>\n<tr>\n<th>\u00a0<\/th>\n<th>Start when access gained<\/th>\n<th>Stop when access lost<\/th>\n<\/tr>\n<tr>\n<td><code>dwTrigger<\/code><\/td>\n<td colspan=\"2\" align=\"center\"><code>SERVICE_<\/code><code>TRIGGER_<\/code><code>TYPE_<\/code><code>IP_<\/code><code>ADDRESS_<\/code><code>AVAILABILITY<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>dwAction<\/code><\/td>\n<td><code>SERVICE_<\/code><code>TRIGGER_<\/code><code>ACTION_<\/code><code>SERVICE_<\/code><code>START<\/code><\/td>\n<td><code>SERVICE_<\/code><code>TRIGGER_<\/code><code>ACTION_<\/code><code>SERVICE_<\/code><code>STOP<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>pTriggerSubtype<\/code><\/td>\n<td><code>&amp;NETWORK_<\/code><code>MANAGER_<\/code><code>FIRST_<\/code><code>IP_<\/code><code>ADDRESS_<\/code><code>ARRIVAL_<\/code><code>GUID<\/code><\/td>\n<td><code>&amp;NETWORK_<\/code><code>MANAGER_<\/code><code>LAST_<\/code><code>IP_<\/code><code>ADDRESS_<\/code><code>REMOVAL_<\/code><code>GUID<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Note that this will run your service when the system has an IP address, which is not the same as saying that the system has Internet access. It could be on an intranet, or it could be stuck behind a captive portal.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can ask to be started when the system gets an IP address.<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-103494","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>You can ask to be started when the system gets an IP address.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/103494","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=103494"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/103494\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=103494"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=103494"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=103494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}