{"id":111,"date":"2006-12-10T22:50:16","date_gmt":"2006-12-10T20:50:16","guid":{"rendered":"http:\/\/contoso.se\/blog\/?p=111"},"modified":"2006-12-29T18:22:23","modified_gmt":"2006-12-29T16:22:23","slug":"kor-tasks-med-run-as","status":"publish","type":"post","link":"http:\/\/contoso.se\/blog\/?p=111","title":{"rendered":"Run tasks with extended permissions"},"content":{"rendered":"<p><font face=\"Calibri\" size=\"3\">Tasks is programs that you have access to directly from Operators Console. It is basic commands like ping but also more advanced commands for Active Directory troubleshooting. After you import more management packs you will get more tasks. You can also create your own tasks in Administrator console, management packs and tasks. <\/font><\/p>\n<p><font face=\"Calibri\" size=\"3\">\u00c2\u00a0When you run a task from Operators console it runs only the current user permissions. Often the operator have very restricted permissions. But there is always a more trusted group of operators with a little bit more permissions, they use to have a &#8220;admin&#8221; account too, to do some basic administered tasks. \u00c2\u00a0Unfortunately you cannot use the non-admin account to run operators console and the &#8220;little-admin&#8221; account to run tasks, at least not with basic MOM functions.<\/font><\/p>\n<p><font face=\"Calibri\" size=\"3\">If your operators have one regular account named Kalle and one named kalle-admin you can change the command line for tasks to this<\/font><\/p>\n<p><code>cmd \/C \"runas.exe \/noprofile \/user:%username%-admin@domain.com \"mmc compmgmt.msc -s \/computer:\"$TargetComputer$\"\"<\/code><\/p>\n<p><font face=\"Calibri\" size=\"3\">Then the problem will be run as a user named kalle-admin (if you are login as kalle) and you will then be prompt to input password. <\/font><\/p>\n<p><font face=\"Calibri\" size=\"3\">But if you need to change both login and password it is a little more complicated. You then will need a script that first ask for username and password, and then it starts the software with those credentials. This script will do that for you<\/font><\/p>\n<p>strUserName = InputBox(&#8220;Please input your administration username?&#8221;, &#8220;UserName&#8221;)<br \/>\nstrComputer = Wscript.Arguments(0)<br \/>\ndim OShell<br \/>\nSet objShell = Wscript.CreateObject(&#8220;WScript.Shell&#8221;)<br \/>\nobjshell.run &#8220;runas.exe \/noprofile \/user:&#8221; &#038; strUserName &#038; &#8221; &#8221; &#038; Chr(34) &#038; &#8220;mmc compmgmt.msc \/s \/computer:&#8221; &#038;strComputer &#038; &#8221; &#8221; &#038; Chr(34)<br \/>\n<font face=\"Calibri\" size=\"3\">\u00c2\u00a0<\/font><\/p>\n<p><font face=\"Calibri\" size=\"3\"><br \/>\nTo run this you will have to change the command line to scriptname.vbs $Computer Name$<\/font><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tasks is programs that you have access to directly from Operators Console. It is basic commands like ping but also more advanced commands for Active Directory troubleshooting. After you import more management packs you will get more tasks. You can also create your own tasks in Administrator console, management packs and tasks. \u00c2\u00a0When you run &hellip; <a href=\"http:\/\/contoso.se\/blog\/?p=111\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[2,13],"tags":[],"_links":{"self":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/111"}],"collection":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=111"}],"version-history":[{"count":0,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/111\/revisions"}],"wp:attachment":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=111"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}