{"id":491,"date":"2011-03-03T20:53:01","date_gmt":"2011-03-04T03:53:01","guid":{"rendered":"http:\/\/jim-zimmerman.com\/?p=491"},"modified":"2011-03-03T20:53:01","modified_gmt":"2011-03-04T03:53:01","slug":"enabling-network-access-permission-via-command-line","status":"publish","type":"post","link":"https:\/\/jim-zimmerman.com\/?p=491","title":{"rendered":"Enabling Network Access Permission via command line."},"content":{"rendered":"<p>I needed an easy way to &#8220;Allow access&#8221; under &#8220;Network Access Permission&#8221; in the &#8220;Dial-in&#8221; tab of the &#8220;Active Directory Users and Computers&#8221; console for several users in a Windows 2003\/2008 ADS environment.  <\/p>\n<p>At first, I approached this task from a scripting angle.  I developed a VBscript that would worked in my test environments, but not in production.  I am still not sure why, but I have not had to time to look into it further.  I suspect it has to do with some policy restrictions or permissions.  I know the script was working, because I could see that the &#8220;msNAPllowDialin&#8221; ADS attribute was being modified.  However, when I opened up &#8220;Active Directory Users and Computers,&#8221; the change was not reflected.  Also, I was still not able to use our VPN that requires the attribute be enabled.  <\/p>\n<p>Being short on time, I looked for a powershell command, or some other command line solution.  It was then that I rediscovered the netsh command.  I had used this command in the past, but did not document anything about it.  I want to get something posted on it, because it is a tremendously powerful command and one that every seasoned Windows administrator should know about.  In my case, this command helped solve my issue quickly.  I used the following command syntax to choose &#8220;Allow access&#8221; on the &#8220;Network Access Permission&#8221; radio button:<\/p>\n<p>netsh RAS set user name=<em>username<\/em> dialin=PERMIT<\/p>\n<p>The netsh command has many options.  Among them, I found that looked pretty interesting (netsh dump).  It creates a script of your current settings.  There is another option, netsh exec, that you can use to execute a netsh script like the the &#8220;netsh dump&#8221; creates.  These could be incredible useful.  There are several other options.  You can find help and syntax for all the options by entering a &#8220;?&#8221; when you need more information.  For example, &#8220;netsh ?&#8221; or &#8220;netsh set ?&#8221;, etc.  You can add to question mark to any level to find more information.  Very useful command.  I wish I had written down what I used it for before.  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I needed an easy way to &#8220;Allow access&#8221; under &#8220;Network Access Permission&#8221; in the &#8220;Dial-in&#8221; tab of the &#8220;Active Directory Users and Computers&#8221; console for several users in a Windows 2003\/2008 ADS environment. At first, I approached this task from a scripting angle. I developed a VBscript that would worked in my test environments, but [&#038;hellip<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[163,162,36],"class_list":["post-491","post","type-post","status-publish","format-standard","hentry","category-documentation","tag-msnpallowdialin","tag-netsh","tag-windows"],"share_on_mastodon":{"url":"","error":""},"_links":{"self":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/491","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=491"}],"version-history":[{"count":1,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/491\/revisions"}],"predecessor-version":[{"id":492,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/491\/revisions\/492"}],"wp:attachment":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=491"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=491"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=491"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}