{"id":962,"date":"2019-12-18T15:47:02","date_gmt":"2019-12-18T12:47:02","guid":{"rendered":"https:\/\/blog.airmeno.ru\/?p=962"},"modified":"2019-12-18T15:47:03","modified_gmt":"2019-12-18T12:47:03","slug":"upravlenie-nastrojkami-seti-cherez-powershell","status":"publish","type":"post","link":"https:\/\/blog.airmeno.ru\/?p=962","title":{"rendered":"\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0441\u0435\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 PowerShell"},"content":{"rendered":"\n<p>\u041d\u0438 \u043a\u0442\u043e \u043d\u0435 \u043e\u0442\u043c\u0435\u043d\u044f\u043b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0435\u0442\u0435\u0432\u044b\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 Windows \u0447\u0435\u0440\u0435\u0437 GUI, \u043d\u043e \u0431\u044b\u0432\u0430\u044e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043a\u043e\u0433\u0434\u0430 \u043b\u0438\u0431\u043e \u043d\u0435\u0442 \u044d\u0442\u043e\u0433\u043e GUI (\u0432 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 Core), \u043b\u0438\u0431\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/blog.airmeno.ru\/?p=701\">\u0443\u0434\u0430\u043b\u0435\u043d\u043d\u0443\u044e \u0441\u0435\u0441\u0441\u0438\u044e PowerShell<\/a>.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u043b\u0435\u0442\u044b \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0435\u0442\u0435\u0432\u044b\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0433\u0440\u0443\u043f\u043f\u0435 NET. <\/p>\n\n\n\n<p>\u0412\u044b\u0437\u043e\u0432 \u0432\u0441\u0435\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0433\u0440\u0443\u043f\u043f\u044b Net:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Get-Command Get-Net*<\/code><\/pre>\n\n\n\n<p><strong>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a <\/strong><\/p>\n\n\n\n<p>\u0421\u0435\u0442\u0435\u0432\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u043e\u0432:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Get-NetIPAddress<\/code><\/pre>\n\n\n\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Get-NetIPAddress -InterfaceIndex %InterfaceIndex%\n\n\u0433\u0434\u0435 %InterfaceIndex% = \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430 \n\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0441\u043f\u0440\u0430\u0432\u043a\u0430 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438:\nGet-Help Get-NetIPAddress -Examples<\/code><\/pre>\n\n\n\n<p>\u0415\u0449\u0435 \u043a\u043e\u043c\u043d\u0430\u0434\u043b\u0435\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441\u0435\u0442\u0435\u0432\u044b\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Get-NetIPConfiguration - \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0441\u0435\u0442\u0438\nGet-NetIPConfiguration -Detailed -All - \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\n\nGet-NetAdapter - \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u044b\n\nGet-NetAdapterHardwareInfo - \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0441\u0435\u0442\u0435\u0432\u043e\u043c \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0435\nGet-NetAdapterHardwareInfo -Name \"name\" - \u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0435\nGet-NetAdapterHardwareInfo -Name \"name\" | fl * - \u0432\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \n\nGet-NetTCPConnection - \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 TCP \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439<\/code><\/pre>\n\n\n\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u043b\u0435\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 DNS:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Resolve-DnsName ya.ru - \u0430\u043d\u0430\u043b\u043e\u0433 nslookup \nResolve-DnsName ya.ru -Type mx -Server 77.88.8.8 \n\nGet-DnsClientCache - \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u043a\u0435\u0448\u0430 DNS \nClear-DnsClientCache - \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u043a\u0435\u0448 DNS <\/code><\/pre>\n\n\n\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u0435\u0442\u0438:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Test-Connection - \u0430\u043d\u0430\u043b\u043e\u0433 \u043f\u0438\u043d\u0433\u0430\nTest-Connection -ComputerName %name% -Count 2 \n\nTest-NetConnection - \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043b\u0435\u0442, \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0445\u043e\u0441\u0442\u0430, \u0447\u0435\u0440\u0435\u0437 \u043a\u0430\u043a\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u043a\u043b\u0438\u043a\u0430 \n\nTest-NetConnection ya.ru -TraceRoute - \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 traceroute\nTest-NetConnection %dns_or_ip% -Port 22 - \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0440\u0442\u0430 \u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c \u0445\u043e\u0441\u0442\u0435<\/code><\/pre>\n\n\n\n<p><strong>\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0435\u0442\u0435\u0432\u044b\u043c\u0438 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430\u043c\u0438<\/strong><\/p>\n\n\n\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0430\u0434\u0430\u043f\u0442\u0435\u0440:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Restart-NetAdapter<\/code><\/pre>\n\n\n\n<p>\u0417\u0430\u0434\u0430\u0442\u044c \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>New-NetIPAddress -InterfaceIndex %id% -IPAddress %ip% -PrefixLength %mask% -DefaultGateway %gate%\n\n\u0438\u043b\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 DHCP\nSet-NetIPInterface -InterfaceIndex %id% -Dhcp Enabled<\/code><\/pre>\n\n\n\n<p>\u0417\u0430\u0434\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 DNS \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Set-DnsClientServerAddress -InterfaceIndex %id% -ServerAddress (\"%ip%\",\"%ip%\")<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u041d\u0438 \u043a\u0442\u043e \u043d\u0435 \u043e\u0442\u043c\u0435\u043d\u044f\u043b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0435\u0442\u0435\u0432\u044b\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 Windows \u0447\u0435\u0440\u0435\u0437 GUI, \u043d\u043e \u0431\u044b\u0432\u0430\u044e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043a\u043e\u0433\u0434\u0430 \u043b\u0438\u0431\u043e \u043d\u0435\u0442 \u044d\u0442\u043e\u0433\u043e GUI (\u0432 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 Core), \u043b\u0438\u0431\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[65],"tags":[22],"_links":{"self":[{"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=\/wp\/v2\/posts\/962"}],"collection":[{"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=962"}],"version-history":[{"count":3,"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=\/wp\/v2\/posts\/962\/revisions"}],"predecessor-version":[{"id":965,"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=\/wp\/v2\/posts\/962\/revisions\/965"}],"wp:attachment":[{"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=962"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=962"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=962"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}