{"id":11517,"date":"2023-02-12T22:34:55","date_gmt":"2023-02-13T06:34:55","guid":{"rendered":"https:\/\/www.coretechnologies.com\/blog\/?p=11517"},"modified":"2023-02-12T22:34:55","modified_gmt":"2023-02-13T06:34:55","slug":"start-service-without-admin-rights","status":"publish","type":"post","link":"https:\/\/www.coretechnologies.com\/blog\/alwaysup\/start-service-without-admin-rights\/","title":{"rendered":"Q&#038;A: How can a Non-Admin User Start my AlwaysUp Service?"},"content":{"rendered":"<div align=\"center\"><img loading=\"lazy\" decoding=\"async\" class=\"no-lazy-load\" src=\"\/blog\/images\/qa-start-without-admin-rights.webp\" style=\"margin-bottom:20px;\" title=\"How can a Non-Admin User Start my AlwaysUp Service?\" alt=\"How can a Non-Admin User Start my AlwaysUp Service?\" border=\"0\" width=\"380\" height=\"160\" \/><\/div>\n<div class=\"blog-qa-question-box\">\n<img loading=\"lazy\" decoding=\"async\" class=\"no-lazy-load\" src=\"https:\/\/cdn.coretechnologies.com\/images\/quotes-transparent-21x21.webp\" width=\"21\" height=\"21\" \/>&nbsp;&nbsp;Hi &mdash; long time user of AlwaysUp here!<\/p>\n<p>I followed your suggestion in the FAQ to <a href=\"\/products\/AlwaysUp\/AlwaysUp_FAQ.html#ServicePermissions\">allow my non-admin user to control<\/a> the Windows Service that AlwaysUp created. Now he can run the NET command to start and stop our application in Session 0 whenever he likes, which is great. But we&#8217;re still having one problem.<\/p>\n<p>Sometimes the user needs to start the application in the current session to make changes. The <a href=\"\/products\/AlwaysUp\/AlwaysUpUserManual.pdf\" target=\"_blank\" rel=\"noopener\">user manual<\/a> says that running AlwaysUp.exe with the &#8220;-restart-in-current-session&#8221; parameter will do the trick.<\/p>\n<p>And that command works fine for me (I&#8217;m an admin). However, the non-admin user is prompted for admin credentials because his account doesn&#8217;t have the rights to run AlwaysUp.<\/p>\n<p>Is there any way to start AlwaysUp.exe without needing admin credentials?<\/p>\n<p align=\"right\">&mdash; Steve<\/p>\n<\/div>\n<p>Hi Steve. Thanks for getting in touch &mdash; and for being a loyal customer!<\/p>\n<p>Permissions is always a thorny topic but we can help you. Let&#8217;s start by reviewing why there is no direct remedy from the AlwaysUp executable (AlwaysUp.exe).<\/p>\n<h2 class=\"blog-caption\">AlwaysUp needs admin rights to do its work<\/h2>\n<p>Unfortunately it&#8217;s not possible to launch AlwaysUp without elevated rights. That&#8217;s because AlwaysUp needs to:<\/p>\n<ol style=\"margin-bottom:24px\">\n<li>\n<p>Read, create and update your Windows Services<\/p>\n<\/li>\n<li>\n<p>Interrogate the Windows Event logs for errors and warnings<\/p>\n<\/li>\n<li>\n<p>Carefully monitor your important applications and react quickly when they use too much memory, hog the CPU, hang or crash.<\/p>\n<\/li>\n<\/ol>\n<p>Typically only administrators &mdash; with broad access to low-level systems &mdash; can perform those actions.<\/p>\n<p>So your non-admin user won&#8217;t be able to run AlwaysUp.exe. But as you know, there are other ways to start or stop the Windows Service created by AlwaysUp. Let&#8217;s explore the NET command since you&#8217;re already familiar with how it works.<\/p>\n<h2 class=\"blog-caption\">Use NET to start your application in a given session<\/h2>\n<p>To recap, you&#8217;re already using the NET command to start your application. If your application is called &#8220;MyServer&#8221; in AlwaysUp, then this command will do the trick:<\/p>\n<div class=\"code-box\">\nNET START &quot;MyServer (managed by AlwaysUpService)&quot;\n<\/div>\n<p>Notice that you must add the &quot;(managed by AlwaysUpService)&quot; suffix as that is how the service is named in the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Service_Control_Manager\" target=\"_blank\" rel=\"noopener\">Service Control Manager<\/a>.<\/p>\n<p>In any case, running that command instructs AlwaysUp to start your application <b>in Session 0<\/b> &mdash; the background desktop hosting Windows Services. You won&#8217;t see the application on your normal desktop.<\/p>\n<p>Fortunately slight variants of the NET command will enable you to launch your application in a specific session.<\/p>\n<h3 class=\"blog-caption\">Provide a Session ID<\/h3>\n<p>To start in a specific session, add the session&#8217;s numeric identifier (the Session ID) to the command. The format is:<\/p>\n<div class=\"code-box\">\nNET START &quot;&lt;ApplicationName&gt; (managed by AlwaysUpService)&quot; \/&lt;SessionID&gt;\n<\/div>\n<p>For example, to start &#8220;MyServer&#8221; in Session 2, run:<\/p>\n<div class=\"code-box\">\nNET START &quot;MyServer (managed by AlwaysUpService)&quot; \/2\n<\/div>\n<p>That will launch your application in Session 2, regardless of who is logged in there.<\/p>\n<h3 class=\"blog-caption\">Provide a Windows username<\/h3>\n<p>Alternately, you can pass a username to start the application in the session occupied by that Windows user. The format of that command is:<\/p>\n<div class=\"code-box\">\nNET START &quot;&lt;ApplicationName&gt; (managed by AlwaysUpService)&quot; \/&quot;user:&lt;UserName&gt;&quot;<\/b>\n<\/div>\n<p>For example, to start &#8220;MyServer&#8221; in the session where &#8220;psmith&#8221; is logged in, run:<\/p>\n<div class=\"code-box\">\nNET START &quot;MyServer (managed by AlwaysUpService)&quot; \/&quot;user:psmith&quot;<\/b>\n<\/div>\n<p>Note that if the given user is not logged in, AlwaysUp will start the application in Session 0.<\/p>\n<h2 class=\"blog-caption\">How to use NET to start your application in the current session<\/h2>\n<p>To achieve what you&#8217;re trying to do, we recommend going with the username variant of the NET command.<\/p>\n<p>This command &mdash; which features the <a href=\"https:\/\/ss64.com\/nt\/syntax-variables.html\" target=\"_blank\" rel=\"noopener\">USERNAME environment variable<\/a> &mdash; will start your application on the current user&#8217;s desktop:<\/p>\n<div class=\"code-box\">\nNET START &quot;&lt;ApplicationName&gt; (managed by AlwaysUpService)&quot; \/&quot;user:%USERNAME%&quot;<\/b>\n<\/div>\n<p>Again, if your application is called &#8220;MyServer&#8221;, the precise syntax is:<\/p>\n<div class=\"code-box\">\nNET START &quot;MyServer (managed by AlwaysUpService)&quot; \/&quot;user:%USERNAME%&quot;<\/b>\n<\/div>\n<p>When you run the command, %USERNAME% expands to the username of the account invoking the command. In that way, the command works for whoever runs it.<\/p>\n<p>We recommend saving the command to a batch file and placing the file on the user&#8217;s desktop, for easy access. With that, your application will only be a double-click away.<\/p>\n<p style=\"margin-top: 30px\">\nEnjoy!\n<\/p>\n<div align=\"center\">\n<div class=\"cta-button-1\">\n<table role=\"presentation\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" align=\"left\">\n<tbody>\n<tr>\n<td align=\"center\"><a href=\"\/blog\/tag\/alwaysup-tag\/\" title=\"More articles about AlwaysUp\"><span><nobr>Read more articles about AlwaysUp&#8230;<\/nobr><\/span><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<!-- relpost-thumb-wrapper --><div class=\"relpost-thumb-wrapper\"><!-- filter-class --><div class=\"relpost-thumb-container\"><style>.relpost-block-single-image, .relpost-post-image { margin-bottom: 10px; }<\/style><h3>You may also like...<\/h3><div style=\"clear: both\"><\/div><div style=\"clear: both\"><\/div><!-- relpost-block-container --><div class=\"relpost-block-container relpost-block-column-layout\" style=\"--relposth-columns: 3;--relposth-columns_t: 2; --relposth-columns_m: 2\"><a href=\"https:\/\/www.coretechnologies.com\/blog\/alwaysup\/alwaysup-8-7-restart-application-when-pc-resumes\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><img decoding=\"async\" loading=\"lazy\" class=\"relpost-block-single-image\" alt=\"Restart your Application when the PC Resumes\"  src=\"https:\/\/www.coretechnologies.com\/blog\/wp-content\/uploads\/windows-sleep-150x150.png\" style=\"aspect-ratio:1\/1\" style=\"aspect-ratio:1\/1\"><\/img><div class=\"relpost-block-single-text\"  style=\"height: 75px;font-family: Arial;  font-size: 12px;  color: #333333;\"><h2 class=\"relpost_card_title\">AlwaysUp 8.7: Restart your Application when the PC Resumes<\/h2><\/div><\/div><\/a><a href=\"https:\/\/www.coretechnologies.com\/blog\/alwaysup\/multiple-alpha-servers\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><img decoding=\"async\" loading=\"lazy\" class=\"relpost-block-single-image\" alt=\"Q &amp; A: How do I Prevent Multiple Alpha Application Servers from Running?\"  src=\"https:\/\/www.coretechnologies.com\/blog\/wp-content\/uploads\/qa-150x150.png\" style=\"aspect-ratio:1\/1\" style=\"aspect-ratio:1\/1\"><\/img><div class=\"relpost-block-single-text\"  style=\"height: 75px;font-family: Arial;  font-size: 12px;  color: #333333;\"><h2 class=\"relpost_card_title\">Q &amp; A: How do I Prevent Multiple Alpha Application Servers from Running?<\/h2><\/div><\/div><\/a><a href=\"https:\/\/www.coretechnologies.com\/blog\/alwaysup\/python-windows-service-output\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><img decoding=\"async\" loading=\"lazy\" class=\"relpost-block-single-image\" alt=\"Q&amp;A: How Do I See the Output\/Traceback From my Python Windows Service?\"  src=\"https:\/\/www.coretechnologies.com\/blog\/wp-content\/uploads\/console-output-150x150.png\" style=\"aspect-ratio:1\/1\" style=\"aspect-ratio:1\/1\"><\/img><div class=\"relpost-block-single-text\"  style=\"height: 75px;font-family: Arial;  font-size: 12px;  color: #333333;\"><h2 class=\"relpost_card_title\">Q&amp;A: How Do I See the Output\/Traceback From my Python Windows Service?<\/h2><\/div><\/div><\/a><\/div><!-- close relpost-block-container --><div style=\"clear: both\"><\/div><\/div><!-- close filter class --><\/div><!-- close relpost-thumb-wrapper -->","protected":false},"excerpt":{"rendered":"<p>&nbsp;&nbsp;Hi &mdash; long time user of AlwaysUp here! I followed your suggestion in the FAQ to allow my non-admin user to control the Windows Service that AlwaysUp created. Now he can run the NET command to start and stop our &hellip; <a href=\"https:\/\/www.coretechnologies.com\/blog\/alwaysup\/start-service-without-admin-rights\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":11552,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[26,108,127,195],"class_list":["post-11517","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-alwaysup","tag-alwaysup-tag","tag-net-exe","tag-qa","tag-windows-service-rights"],"_links":{"self":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/11517","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/comments?post=11517"}],"version-history":[{"count":21,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/11517\/revisions"}],"predecessor-version":[{"id":11834,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/11517\/revisions\/11834"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/media\/11552"}],"wp:attachment":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/media?parent=11517"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/categories?post=11517"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/tags?post=11517"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}