{"id":325207,"date":"2021-06-20T15:00:37","date_gmt":"2021-06-20T15:00:37","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=325207"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=325207","title":{"rendered":"Powershell \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0421\u043a\u0440\u0438\u043f\u0442 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0443\u0442\u0438\u043d\u044b \u0432 \u0442\u0435\u0445\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0420\u0430\u0431\u043e\u0442\u0430\u044f \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 IT-\u0430\u0443\u0442\u0441\u043e\u0440\u0441\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044f 3 \u043b\u0438\u043d\u0438\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438, \u0437\u0430\u0434\u0443\u043c\u0430\u043b\u0441\u044f, \u043a\u0430\u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432 \u043f\u043e RDP, \u0447\u0435\u0440\u0435\u0437 VPN \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>\u0422\u0430\u0431\u043b\u0438\u0447\u043a\u0438 \u0441 \u0430\u0434\u0440\u0435\u0441\u0430\u043c\u0438, \u043f\u0430\u0440\u043e\u043b\u044f\u043c\u0438 \u0438 \u043f\u0440\u043e\u0447\u0438\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0445\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u043f\u043e\u0438\u0441\u043a \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0432\u0431\u0438\u0432\u0430\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0441 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430\u043c\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f.<br \/>\u0414\u0435\u0440\u0436\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a VPN \u0432 Windows \u043d\u0435 \u0441\u0430\u043c\u0430\u044f \u043b\u0443\u0447\u0448\u0430\u044f \u0438\u0434\u0435\u044f, \u0434\u0430 \u0438 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043e\u043d\u043e\u0433\u043e, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c VPN\u044b \u0442\u043e\u0436\u0435 \u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435.<br \/>\u041f\u043b\u044e\u0441 \u043a \u0442\u043e\u043c\u0443, \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c VPN \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0448\u043b\u044e\u0437\u0430. \u0434\u0430\u0431\u044b \u043d\u0435 \u0433\u043e\u043d\u044f\u0442\u044c \u0432\u0435\u0441\u044c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u0442\u0440\u0430\u0444\u0438\u043a \u0447\u0435\u0440\u0435\u0437 \u043a\u043b\u0438\u0435\u043d\u0442\u0430.<br \/>\u0417\u0430\u0434\u0430\u0447\u0430, \u043a \u0442\u043e\u043c\u0443 \u0436\u0435, \u043e\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u0443 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 pptp, \u0443 \u043a\u043e\u0433\u043e-\u0442\u043e l2tp, \u0443 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u0441\u0435\u0442\u0435\u0439, \u0442\u0443\u043d\u043d\u0435\u043b\u0438 \u0438 \u0442.\u043f.<\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0431\u044b\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043d\u0430 Powershell \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u043d\u043e \u043f\u043e\u0437\u0436\u0435, \u0443\u0437\u043d\u0430\u0432, \u0447\u0442\u043e \u0432 Powershell \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Winforms \u043e\u043d\u0438 \u043f\u0435\u0440\u0435\u0440\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u0432 \u043d\u0435\u043a\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u043e\u0433\u043e \u0436\u0435 Powershell.<\/p>\n<p>\u0414\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043d\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0441\u044f \u0432\u043e\u043e\u0431\u0449\u0435, \u0440\u0430\u0437\u0432\u0435 \u0447\u0442\u043e \u043b\u0435\u0442 20 \u043d\u0430\u0437\u0430\u0434 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b \u043d\u0430 VBS \u0432 MS Excel \u0438 MS Access, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u044e \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e \u043a\u0440\u0438\u0442\u0438\u043a\u0443 \u043e\u0442 \u043e\u043f\u044b\u0442\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u0435\u0435.<\/p>\n<p>\u0412 Powershell, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 Windows 8 \u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0432 Windows 10, \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c VPN \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 Add-VpnConnection \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441 \u044d\u0442\u0438\u043c\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 Add-VpnConnectionRoute, \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f VPN \u0431\u0435\u0437 \u0448\u043b\u044e\u0437\u0430.<\/p>\n<p>\u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u0442\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u043e \u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041d\u043e, \u043e\u0431\u043e \u0432\u0441\u0435\u043c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0432 Google Disk \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c\u0438:<br \/> Number; Name; VPNname; ServerAddress; RemoteNetwork; VPNLogin; VPNPass; VPNType; l2tpPsk; RDPcomp; RDPuser; RDPpass; DefaultGateway; PortWinbox; WinboxLogin; WinboxPwd; Link; Inform<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/91b\/0e5\/a4a\/91b0e5a4aec4ad34ef63095bd5fd7f83.png\" width=\"624\" height=\"36\"><figcaption><\/figcaption><\/figure>\n<ul>\n<li>\n<p>VPNname \u2013 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f \u0434\u043b\u044f VPN \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>ServerAddress \u2013 \u0430\u0434\u0440\u0435\u0441 VPN \u0441\u0435\u0440\u0432\u0435\u0440\u0430 <\/p>\n<\/li>\n<li>\n<p>RemoteNetwork \u2013 \u0430\u0434\u0440\u0435\u0441\u0430 \u043f\u043e\u0434\u0441\u0435\u0442\u0438 \u0438\u043b\u0438 \u043f\u043e\u0434\u0441\u0435\u0442\u0435\u0439 \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u00ab;\u00bb<\/p>\n<\/li>\n<li>\n<p>VPNLogin; VPNPass \u2013 \u0443\u0447\u0435\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c VPN<\/p>\n<\/li>\n<li>\n<p>VPNType -\u0442\u0438\u043f VPN &nbsp;(\u043f\u043e\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f pptp \u0438\u043b\u0438 l2tp) <\/p>\n<\/li>\n<li>\n<p>l2tpPsk \u2013 PSK \u0434\u043b\u044f l2tp, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 pptp \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0443\u0441\u0442\u044b\u043c <\/p>\n<\/li>\n<li>\n<p>RDPcomp \u2013 \u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 RPD <\/p>\n<\/li>\n<li>\n<p>RDPuser; RDPpass \u2013 \u0443\u0447\u0435\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c RPD <\/p>\n<\/li>\n<li>\n<p>DefaultGateway \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 TRUE \u0438\u043b\u0438 FALSE \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0442\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u0438 \u00ab\u0428\u043b\u044e\u0437 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e\u00bb \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f. \u0412 90% \u0441\u043b\u0443\u0447\u0430\u0435\u0432 = FALSE<\/p>\n<\/li>\n<li>\n<p>PortWinbox; WinboxLogin; WinboxPwd \u2013 \u043f\u043e\u0440\u0442, \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f Winbox, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0443 \u043d\u0430\u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Mikrotik)<\/p>\n<\/li>\n<li>\n<p>Link \u2013 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430 \u0434\u0438\u0441\u043a\u0435 Google, \u0438\u043b\u0438 \u0432 \u043b\u044e\u0431\u043e\u043c \u0434\u0440\u0443\u0433\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u043f\u043e\u043b\u0435 \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043d\u0443\u0436\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438<\/p>\n<\/li>\n<\/ul>\n<p>Inform \u2013 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 <\/p>\n<p><a href=\"https:\/\/docs.google.com\/spreadsheets\/d\/1O-W1YCM4x3o5W1w6XahCJZpkTWs8cREXVF69gs1dD0U\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435<\/a><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"68\" width=\"68\">\n<p><strong>Number<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"73\" width=\"73\">\n<p><strong>Name<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"67\" width=\"67\">\n<p><strong>VPNname<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"90\" width=\"90\">\n<p><strong>ServerAddress<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"152\" width=\"152\">\n<p><strong>RemoteNetwork<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"82\" width=\"82\">\n<p><strong>VPNLogin<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"96\" width=\"96\">\n<p><strong>VPNPass<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"95\" width=\"95\">\n<p><strong>VPNType<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p><strong>l2tpPsk<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"112\" width=\"112\">\n<p><strong>RDPcomp<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"90\" width=\"90\">\n<p><strong>RDPuser<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"102\" width=\"102\">\n<p><strong>RDPpass<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"92\" width=\"92\">\n<p><strong>DefaultGateway<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"81\" width=\"81\">\n<p><strong>PortWinbox<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"85\" width=\"85\">\n<p><strong>WinboxLogin<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"86\" width=\"86\">\n<p><strong>WinboxPwd<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"143\" width=\"143\">\n<p><strong>Link<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p><strong>Inform<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"68\" width=\"68\">\n<p>1<\/p>\n<\/td>\n<td data-colwidth=\"73\" width=\"73\">\n<p>\u0422\u0435\u0441\u04421<\/p>\n<\/td>\n<td data-colwidth=\"67\" width=\"67\">\n<p>Test1<\/p>\n<\/td>\n<td data-colwidth=\"90\" width=\"90\">\n<p>a.b.c.d<\/p>\n<\/td>\n<td data-colwidth=\"152\" width=\"152\">\n<p>192.168.10.0\/24: 10.10.0.0\/24<\/p>\n<\/td>\n<td data-colwidth=\"82\" width=\"82\">\n<p>vpnuser<\/p>\n<\/td>\n<td data-colwidth=\"96\" width=\"96\">\n<p>passWord<\/p>\n<\/td>\n<td data-colwidth=\"95\" width=\"95\">\n<p>pptp<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p>none<\/p>\n<\/td>\n<td data-colwidth=\"112\" width=\"112\">\n<p>192.168.10.1<\/p>\n<\/td>\n<td data-colwidth=\"90\" width=\"90\">\n<p>user<\/p>\n<\/td>\n<td data-colwidth=\"102\" width=\"102\">\n<p>passWord<\/p>\n<\/td>\n<td data-colwidth=\"92\" width=\"92\">\n<p>TRUE<\/p>\n<\/td>\n<td data-colwidth=\"81\" width=\"81\">\n<p>8291<\/p>\n<\/td>\n<td data-colwidth=\"85\" width=\"85\">\n<p>Admin<\/p>\n<\/td>\n<td data-colwidth=\"86\" width=\"86\">\n<p>Admin<\/p>\n<\/td>\n<td data-colwidth=\"143\" width=\"143\">\n<p><a href=\"http:\/\/yandex.ru\" rel=\"noopener noreferrer nofollow\"><u>http:\/\/yandex.ru<\/u><\/a><\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p>\u0442\u0435\u0441\u0442<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"68\" width=\"68\">\n<p>2<\/p>\n<\/td>\n<td data-colwidth=\"73\" width=\"73\">\n<p>\u0422\u0435\u0441\u04422<\/p>\n<\/td>\n<td data-colwidth=\"67\" width=\"67\">\n<p>Test2<\/p>\n<\/td>\n<td data-colwidth=\"90\" width=\"90\">\n<p>e.f.j.k<\/p>\n<\/td>\n<td data-colwidth=\"152\" width=\"152\">\n<p>192.168.2.0\/24<\/p>\n<\/td>\n<td data-colwidth=\"82\" width=\"82\">\n<p>vpnuser<\/p>\n<\/td>\n<td data-colwidth=\"96\" width=\"96\">\n<p>passWord<\/p>\n<\/td>\n<td data-colwidth=\"95\" width=\"95\">\n<p>l2tp<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p>KdoSDtdP<\/p>\n<\/td>\n<td data-colwidth=\"112\" width=\"112\">\n<p>192.168.2.1<\/p>\n<\/td>\n<td data-colwidth=\"90\" width=\"90\">\n<p>user<\/p>\n<\/td>\n<td data-colwidth=\"102\" width=\"102\">\n<p>passWord<\/p>\n<\/td>\n<td data-colwidth=\"92\" width=\"92\">\n<p>FALSE<\/p>\n<\/td>\n<td data-colwidth=\"81\" width=\"81\">\n<p>8291<\/p>\n<\/td>\n<td data-colwidth=\"85\" width=\"85\">\n<p>Admin<\/p>\n<\/td>\n<td data-colwidth=\"86\" width=\"86\">\n<p>Admin<\/p>\n<\/td>\n<td data-colwidth=\"143\" width=\"143\">\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0421\u043a\u0440\u0438\u043d\u0448\u043e\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u0437\u0430\u0442\u0435\u0440\u0442\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/497\/5f0\/b65\/4975f0b6562b70ae609daec5f5839f5f.png\" width=\"623\" height=\"387\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043b\u0438\u0441\u0442\u0438\u043d\u0433 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 \u0438 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f\u043c\u0438. \u0415\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043d\u043e \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0437\u0430\u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043f\u0440\u043e\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c <\/p>\n<pre><code class=\"powershell\">function Get-Clients #\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0430\u0434\u0440\u0435\u0441\u0430 \u0444\u0430\u0439\u043b\u0430 \u0432 Google Drive \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u0445 \t{ \t\tparam \t\t( \t\t\t[string]$google_url = \"\" \t\t)  \t\t[string]$xlsFile = $google_url \t\t$csvFile = \"$env:temp\\clients.csv\" \t\t$Comma = ',' \t\tInvoke-WebRequest $xlsFile -OutFile $csvFile \t\t \t\t$clients = Import-Csv -Delimiter $Comma -Path \"$env:temp\\clients.csv\" \t\tRemove-Item -Path $csvFile \t\treturn $clients \t}  function Main { &lt;#     \u0424\u0443\u043d\u043a\u0446\u0438\u044f, \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u0430\u044f \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 #&gt; \tParam ([String]$Commandline) \t \t#\u0418\u043d\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0417\u0434\u0435\u0441\u044c \u0436\u0435, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0443\u0442\u044c \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438 \t \t$Global:Clients = $null \t$Global:Current \t$Global:CurrentRDPcomp \t$Global:google_file = \"https:\/\/docs.google.com\/spreadsheets\/d\/1O-W1YCM4x3o5W1w6XahCJZpkTWs8cREXVF69gs1dD0U\/export?format=csv\" # \u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0440\u0430\u0437\u0443 \u0432 \u0432\u0438\u0434\u0435 csv-\u0444\u0430\u0439\u043b\u0430 \t \t$Global:Clients = Get-Clients ($Global:google_file) # \u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0443  \t \t#\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c Winbox64 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \t \t$download_url = \"https:\/\/download.mikrotik.com\/winbox\/3.27\/winbox64.exe\" \t$Global:local_path = \"$env:temp\\winbox64.exe\" \tIf ((Test-Path $Global:local_path) -ne $true) \t{ \t\t$WebClient = New-Object System.Net.WebClient \t\t$WebClient.DownloadFile($download_url, $Global:local_path) \t} \t   #\u0420\u0430\u0437\u0440\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u0442\u0435\u043a\u0443\u0449\u0438\u0435 VPN \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f (\u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439) \t \tforeach ($item in get-vpnconnection | where { $_.ConnectionStatus -eq \"Connected\" }) \t{ \t\tRasdial $item.Name \/disconnect \t} \t   #\u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0432\u0441\u0435, \u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u0435\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 \u043d\u0435 \u0443\u0434\u0430\u043b\u0438\u043b\u0438\u0441\u044c \u043f\u0440\u0438 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u043c \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \t \tget-vpnconnection | where { $_.Name -match \"tmp\" } | Remove-VpnConnection -Force \t \t#\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \t \tShow-MainForm_psf }  #\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0441\u0430\u043c\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435  function Show-MainForm_psf { \t \t[void][reflection.assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') \t[void][reflection.assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') \t \t#\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u043e\u0440\u043c\u0443 \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0444\u043e\u0440\u043c\u044b \t \t[System.Windows.Forms.Application]::EnableVisualStyles() \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441 = New-Object 'System.Windows.Forms.Form' \t$statusbar1 = New-Object 'System.Windows.Forms.StatusBar' \t$groupboxTools = New-Object 'System.Windows.Forms.GroupBox' \t$buttonPing = New-Object 'System.Windows.Forms.Button' \t$button\u0412\u044b\u0445\u043e\u0434 = New-Object 'System.Windows.Forms.Button' \t$buttonWindox = New-Object 'System.Windows.Forms.Button' \t$button\u041f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c\u0414\u0430\u043d\u043d\u044b\u0435 = New-Object 'System.Windows.Forms.Button' \t$buttonPingAll = New-Object 'System.Windows.Forms.Button' \t$groupboxRDP = New-Object 'System.Windows.Forms.GroupBox' \t$comboboxRDP = New-Object 'System.Windows.Forms.ComboBox' \t$textboxRDPLogin = New-Object 'System.Windows.Forms.TextBox' \t$textboxRdpPwd = New-Object 'System.Windows.Forms.TextBox' \t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cRDP = New-Object 'System.Windows.Forms.Button' \t$groupboxVPN = New-Object 'System.Windows.Forms.GroupBox' \t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN = New-Object 'System.Windows.Forms.Button' \t$button\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN = New-Object 'System.Windows.Forms.Button' \t$checkbox\u0428\u043b\u044e\u0437\u041f\u043e\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e = New-Object 'System.Windows.Forms.CheckBox' \t$richtextboxinfo = New-Object 'System.Windows.Forms.RichTextBox' \t$listbox_clients = New-Object 'System.Windows.Forms.ListBox' \t$InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState'    \t#---------------------------------------------- \t# \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \t#---------------------------------------------- \t \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441_Load = { \t\t#\u041f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u043e\u0440\u043c\u044b \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u043f\u043e\u043b\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u043e\u043b\u0435 \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438 (\u0438\u0445 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u043c\u0438)  \t\t$richtextboxinfo.Clear() \t\t$Global:Clients | ForEach-Object { \t\t\t[void]$listbox_clients.Items.Add($_.Name) \t\t\t \t\t} # \u0412 \u043b\u0438\u0441\u0442\u0431\u043e\u043a\u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u0441\u0435\u0445 \u043d\u0430\u0448\u0438\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u043f\u043e \u0438\u043c\u0435\u043d\u0430\u043c \u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u043e\u0440\u043c\u044b \t} \t \t$listbox_clients_SelectedIndexChanged = { \t\t#\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u0435\u0433\u043e \u0432 \u043f\u043e\u043b\u0435 listbox_clients (\u043c\u0430\u0441\u0441\u0438\u0432, \u043a\u0430\u043a \u043c\u044b \u043f\u043e\u043c\u043d\u0438\u043c \u0441\u0447\u0438\u0442\u0430\u043d \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u0441 \u0434\u0438\u0441\u043a\u0430 Google) \t\t \t\t$statusbar1.Text = '\u0412\u044b\u0431\u0440\u0430\u043d \u043a\u043b\u0438\u0435\u043d\u0442: ' + $listbox_clients.SelectedItem.ToString() # \u041f\u0438\u0448\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0432 \u0441\u0442\u0430\u0442\u0443\u0441\u0431\u0430\u0440 \t\t \t\t$Global:Current = $Global:Clients.Where({ $_.Name -eq $listbox_clients.SelectedItem.ToString() }) \t\tIf ($Current.PortWinbox -ne 0) # \u0415\u0441\u043b\u0438 \u043f\u043e\u0440\u0442 Winbox \u0443\u043a\u0430\u0437\u0430\u043d, \u0442\u043e \u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 Mikrotik, \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u043a\u043d\u043e\u043f\u043a\u0443 \t\t{ \t\t\t$buttonWindox.Enabled = $true \t\t\t \t\t\t$buttonWindox.Text = \"Winbox\" \t\t} \t\t \t\t$VPNname = $Global:Current.VPNname + \"-tmp\" #\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a \u0438\u043c\u0435\u043d\u0438 VPN \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \"-tmp\" \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043a\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0445 \t\t \t\tswitch ($Global:Current.VPNType) #\u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 VPN \u043f\u0438\u0448\u0435\u043c \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0435 \"\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c pptp VPN\" \u0438\u043b\u0438 \"\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c l2tp VPN\", \u0435\u0441\u043b\u0438 \u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043d\u0435\u0442 VPN, \u0442\u043e \u043f\u0438\u0448\u0435\u043c \"\u0417\u0434\u0435\u0441\u044c \u043d\u0435\u0442 VPN\" \t\t{ \t\t\t \t\t\t\"pptp\" { \t\t\t\t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Enabled = $true \t\t\t\t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Text = \"\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c pptp VPN\" \t\t\t} \t\t\t\"l2tp\" { \t\t\t\t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Enabled = $true \t\t\t\t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Text = \"\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c l2tp VPN\" \t\t\t} \t\t\tDEFAULT \t\t\t \t\t\t{ \t\t\t\t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Enabled = $false \t\t\t\t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Text = \"\u0417\u0434\u0435\u0441\u044c \u043d\u0435\u0442 VPN\" \t\t\t} \t\t} \t\tswitch ($Global:Current.DefaultGateway) #\u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043b\u0438 \u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \"\u0428\u043b\u044e\u0437 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e\" \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0447\u0435\u043a\u0431\u043e\u043a\u0441 \t\t{ \t\t\t\"FALSE\" \t\t\t{ $checkbox\u0428\u043b\u044e\u0437\u041f\u043e\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.Checked = $false } \t\t\t\"\u041d\u0435\u0442\" \t\t\t{ $checkbox\u0428\u043b\u044e\u0437\u041f\u043e\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.Checked = $false } \t\t\t\"TRUE\" \t\t\t{ $checkbox\u0428\u043b\u044e\u0437\u041f\u043e\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.Checked = $true } \t\t\t\"\u0414\u0430\" \t\t\t{ $checkbox\u0428\u043b\u044e\u0437\u041f\u043e\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.Checked = $true } \t\t\tDEFAULT \t\t\t{ $checkbox\u0428\u043b\u044e\u0437\u041f\u043e\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.Checked = $false } \t\t} \t\t \t\t$VPNStatus = (ipconfig | Select-String $VPNname -Quiet) #\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043b\u0438 \u0443\u0436\u0435 \u044d\u0442\u043e VPN \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435? \t\t \t\tIf ($VPNStatus) #\u0415\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e, \u0442\u043e \u0440\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443 \"\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c RDP\" \t\t{ \t\t\t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cRDP.Enabled = $true \t\t} \t\telse \t\t{ \t\t\t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cRDP.Enabled = $false \t\t} \t\t \t\t$richtextboxinfo.Clear() #\u041e\u0447\u0438\u0449\u0430\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043f\u043e\u043b\u0435  \t\t \t\t# \u0418 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \t\t$richtextboxinfo.SelectionColor = 'Black' \t\t$richtextboxinfo.Text = \"\u041a\u043b\u0438\u0435\u043d\u0442: \" + $Global:Current.Name + [System.Environment]::NewLine + ` \t\t\"\u0418\u043c\u044f VPN: \" + $Global:Current.VPNname + [System.Environment]::NewLine + ` \t\t\"\u0422\u0438\u043f VPN: \" + $Global:Current.VPNType + [System.Environment]::NewLine + ` \t\t\"\u0410\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430: \" + $Global:Current.ServerAddress + [System.Environment]::NewLine + ` \t\t\"\u041f\u043e\u0434\u0441\u0435\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430: \" + $Global:Current.RemoteNetwork + [System.Environment]::NewLine + ` \t\t\"\u0410\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 RDP: \" + $Global:Current.RDPcomp + [System.Environment]::NewLine + [System.Environment]::NewLine + ` \t\t\"DefaultGateway: \" + $Global:Current.DefaultGateway + [System.Environment]::NewLine + [System.Environment]::NewLine + ` \t\t\"\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \" + [System.Environment]::NewLine + $Global:Current.Inform + [System.Environment]::NewLine + ` \t\t\"Connection '\" + $VPNname + \"' status is \" + $button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cRDP.Enabled + [System.Environment]::NewLine \t\t$richtextboxinfo.AppendText($Global:Current.Link) \t\t \t\t$RDPServers = $Global:Current.RDPcomp.Split(';') -replace '\\s', '' #\u0421\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0438 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c RDP \u0441\u0435\u0440\u0432\u0435\u0440\u044b \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0435\u043c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \t\t \t\t#\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u0437 \u0432 \u0432\u044b\u043f\u0430\u0434\u0430\u044e\u0449\u0435\u0435 \u043f\u043e\u043b\u0435 \u0432\u044b\u0431\u043e\u0440\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \t\t$comboboxRDP.Items.Clear() \t\t$comboboxRDP.Text = $RDPServers[0] \t\tforeach ($RDPServer in $RDPServers) \t\t{ \t\t\t$comboboxRDP.Items.Add($RDPServer) \t\t} \t\t \t\t#\u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u043e\u043b\u044f \u0438\u043c\u0435\u043d\u0438 \u0438 \u043f\u0430\u0440\u043e\u043b\u044f RDP \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0435 (\u043f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0432 \u043e\u043a\u043d\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b) \t\t$textboxRdpPwd.Text = $Global:Current.RDPpass \t\t$textboxRdpLogin.Text = $Global:Current.RDPuser \t} # \u0424\u043e\u0440\u043c\u0430 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0430, \u043f\u0440\u0438 \u0441\u043c\u0435\u043d\u0435 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0435\u0439 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \t \t \t$buttonWindox_Click = { \t\t#\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043a\u043d\u043e\u043f\u043a\u0438 Winbox \t\tIf ($Global:Current.PortWinbox -ne 0) #\u0415\u0441\u043b\u0438 \u043f\u043e\u0440\u0442 Winbox \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d, \u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0441\u043a\u0430\u0447\u0430\u043d\u043d\u044b\u0439 \u0440\u0430\u043d\u0435\u0435 Winbox, \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u0443\u0434\u0430 \u0438\u043c\u044f \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u043a \u043d\u0435\u043c\u0443 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \t\t{ \t\t\t$runwinbox = \"$env:temp\\winbox64.exe\" \t\t\t$ServerPort = $Global:Current.ServerAddress + \":\" + $Global:Current.PortWinbox \t\t\t$ServerLogin = \" \"\"\" + $Global:Current.WinboxLogin + \"\"\"\" \t\t\t$ServerPass = \" \"\"\" + $Global:Current.WinboxPwd + \"\"\"\" \t\t\t$Arg = \"$ServerPort $ServerLogin $ServerPass \" \t\t\tStart-Process -filePath $runwinbox -ArgumentList $Arg \t\t} \t} \t \t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN_Click = { \t\t#\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043a\u043d\u043e\u043f\u043a\u0438 \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN \t\t$VPNname = $Global:Current.VPNname + \"-tmp\" #\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a \u0438\u043c\u0435\u043d\u0438 VPN \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \"-tmp\" \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043a\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0445 \t\t$richtextboxinfo.Clear() #\u041e\u0447\u0438\u0449\u0430\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043f\u043e\u043b\u044f \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0442\u0443\u0434\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \t\t \t\t$richtextboxinfo.Text = \"\u041a\u043b\u0438\u0435\u043d\u0442: \" + $Global:Current.Name + [System.Environment]::NewLine \t\t \t\tforeach ($item in get-vpnconnection | where { $_.ConnectionStatus -eq \"Connected\" }) #\u0420\u0430\u0437\u0440\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \t\t{ \t\t\t$richtextboxinfo.Text = $richtextboxinfo.Text + \"\u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \" + $item.Name + \" \u0440\u0430\u0437\u0440\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e\" + [System.Environment]::NewLine \t\t\tRasdial $item.Name \/disconnect \t\t} \t\t \t\tRemove-VpnConnection $VPNname -Force #\u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u0440\u0430\u043d\u0435\u0435 \u043e\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043e \t\t \t\t$RemoteNetworks = $Global:Current.RemoteNetwork.Split(';') -replace '\\s', '' #\u0421\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0438 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u0434\u0441\u0435\u0442\u0435\u0439 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 ; \t\t \t\tswitch ($Global:Current.VPNType) #\u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 VPN\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u043c pptp \u0438\u043b\u0438 l2tp \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \t\t{ \t\t\t \t\t\t\"pptp\" { \t\t\t\t$richtextboxinfo.Text = $richtextboxinfo.Text + \"\u0421\u043e\u0437\u0434\u0430\u0435\u043c pptp \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \" + $VPNname + [System.Environment]::NewLine \t\t\t\tIf ($checkbox\u0428\u043b\u044e\u0437\u041f\u043e\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.Checked -eq $false) #\u0415\u0441\u043b\u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \"\u0428\u043b\u044e\u0437 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e\", \u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c VPN \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e \u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \t\t\t\t{ \t\t\t\t\t$Errcon = (Add-VpnConnection -Name $VPNname -ServerAddress $Global:Current.ServerAddress -TunnelType $Global:Current.VPNType -SplitTunneling -Force -RememberCredential -PassThru) #\u0417\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 VPN \t\t\t\t\t \t\t\t\t\tforeach ($RemoteNetwork in $RemoteNetworks) #\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u0441\u0435 \u043f\u043e\u0434\u0441\u0435\u0442\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043a \u044d\u0442\u043e\u043c\u0443 VPN \t\t\t\t\t{ \t\t\t\t\t\t$richtextboxinfo.AppendText('\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043a ' + $RemoteNetwork + [System.Environment]::NewLine) \t\t\t\t\t\tAdd-VpnConnectionRoute -ConnectionName $VPNname -DestinationPrefix $RemoteNetwork -PassThru \t\t\t\t\t} \t\t\t\t\t \t\t\t\t} \t\t\t\t \t\t\t\telse #\u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \"\u0428\u043b\u044e\u0437 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e\", \u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c VPN \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u043d\u0438\u043c \u0438 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u043a \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \t\t\t\t{ \t\t\t\t\t$Errcon = (Add-VpnConnection -Name $VPNname -ServerAddress $Global:Current.ServerAddress -TunnelType $Global:Current.VPNType -Force -RememberCredential -PassThru) \t\t\t\t} \t\t\t\t \t\t\t} \t\t\t\"l2tp\" { \t\t\t\t$richtextboxinfo.Text = $richtextboxinfo.Text + \"\u0421\u043e\u0437\u0434\u0430\u0435\u043c l2tp \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \" + $Global:Current.VPNname + [System.Environment]::NewLine \t\t\t\tIf ($checkbox\u0428\u043b\u044e\u0437\u041f\u043e\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.Checked -eq $false) #\u0415\u0441\u043b\u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \"\u0428\u043b\u044e\u0437 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e\", \u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c VPN \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e \u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \t\t\t\t{ \t\t\t\t\t$Errcon = (Add-VpnConnection -Name $VPNname -ServerAddress $Global:Current.ServerAddress -TunnelType $Global:Current.VPNType -L2tpPsk $Global:Current.l2tpPsk -SplitTunneling -Force -RememberCredential -PassThru) #\u0417\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 VPN \t\t\t\t\tforeach ($RemoteNetwork in $RemoteNetworks) #\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u0441\u0435 \u043f\u043e\u0434\u0441\u0435\u0442\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043a \u044d\u0442\u043e\u043c\u0443 VPN \t\t\t\t\t{ \t\t\t\t\t\t$richtextboxinfo.AppendText('\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043a ' + $RemoteNetwork + [System.Environment]::NewLine) \t\t\t\t\t\tAdd-VpnConnectionRoute -ConnectionName $VPNname -DestinationPrefix $RemoteNetwork -PassThru \t\t\t\t\t} \t\t\t\t} \t\t\t\telse #\u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \"\u0428\u043b\u044e\u0437 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e\", \u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c VPN \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u043d\u0438\u043c \u0438 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u043a \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \t\t\t\t{ \t\t\t\t\t$Errcon = (Add-VpnConnection -Name $VPNname -ServerAddress $Global:Current.ServerAddress -TunnelType $Global:Current.VPNType -L2tpPsk $Global:Current.l2tpPsk -Force -RememberCredential -PassThru) \t\t\t\t} \t\t\t\t \t\t\t} \t\t\t \t\t} \t\t \t\t \t\t$richtextboxinfo.AppendText(\"\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \" + $Global:Current.VPNType + \" \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \" + $VPNname + [System.Environment]::NewLine) \t\t$Errcon = Rasdial $VPNname $Global:Current.VPNLogin $Global:Current.VPNPass #\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0435 VPN \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 \u043f\u043e\u043b\u0435 \t\t \t\t$richtextboxinfo.Text = $richtextboxinfo.Text + [System.Environment]::NewLine + $Errcon + [System.Environment]::NewLine \t\t \t\tIf ((ipconfig | Select-String $VPNname -Quiet)) #\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0438, \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u0443\u0434\u0430\u0447\u043d\u043e, \u0440\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443 RDP  \u0438 \u043a\u043d\u043e\u043f\u043a\u0443 \"\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c VPN\" \t\t{ \t\t\t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cRDP.Enabled = $true \t\t\t$button\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Visible = $true \t\t\t$button\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Enabled = $true \t\t\t$statusbar1.Text = $Global:Current.Name + ' \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d' \t\t} \t\t \t} \t \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441_FormClosing = [System.Windows.Forms.FormClosingEventHandler]{ \t\t \t\t#\u041f\u0440\u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0438 \u0444\u043e\u0440\u043c\u044b \u043f\u043e\u0434\u0447\u0438\u0449\u0430\u0435\u043c \u0437\u0430 \u0441\u043e\u0431\u043e\u0439. \u0420\u0430\u0437\u0440\u044b\u0432\u0430\u0435\u043c \u0438 \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0432\u0441\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f.  \t\t \t\tforeach ($item in get-vpnconnection | where { $_.ConnectionStatus -eq \"Connected\" }) \t\t{ \t\t\t$richtextboxinfo.Text = $richtextboxinfo.Text + \"\u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \" + $item.Name + \" \u0440\u0430\u0437\u0440\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e\" + [System.Environment]::NewLine \t\t\tRasdial $item.Name \/disconnect \t\t} \t\t$richtextboxinfo.Text = $richtextboxinfo.Text + \"\u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0432\u0441\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f\" + [System.Environment]::NewLine \t\tget-vpnconnection | where { $_.Name -match \"tmp\" } | Remove-VpnConnection -Force \t\t \t\t#\u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e RPD-\u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 \u0438\u0437 \u0440\u0435\u0435\u0441\u0442\u0440\u0430 \t\t$Global:Clients | ForEach-Object { \t\t\t$term = \"TERMSRV\/\" + $_.RDPcomp \t\t\tcmdkey \/delete:$term \t\t} \t} \t \t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cRDP_Click = { \t\t#\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043a\u043d\u043e\u043f\u043a\u0438 \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cRDP \t\t$RDPcomp = $comboboxRDP.Text \t\t$RDPuser = $textboxRDPLogin.Text \t\t$RDPpass = $textboxRdpPwd.Text \t\tcmdkey \/generic:\"TERMSRV\/$RDPcomp\" \/user:\"$RDPuser\" \/pass:\"$RDPpass\" \t\tmstsc \/v:$RDPcomp \t\t \t} \t \t$button\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN_Click = { \t\t#\u041f\u0440\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 VPN \u043f\u043e\u0434\u0447\u0438\u0449\u0430\u0435\u043c \u0437\u0430 \u0441\u043e\u0431\u043e\u0439 \u0438 \u043e\u043f\u043e\u0432\u0435\u0449\u0430\u0435\u043c \u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0432 \u043f\u043e\u043b\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \t\tforeach ($item in get-vpnconnection | where { $_.ConnectionStatus -eq \"Connected\" }) \t\t{ \t\t\t$richtextboxinfo.Text = $richtextboxinfo.Text + \"\u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \" + $item.Name + \" \u0440\u0430\u0437\u0440\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e\" + [System.Environment]::NewLine \t\t\tRasdial $item.Name \/disconnect \t\t} \t\t$richtextboxinfo.Text = $richtextboxinfo.Text + \"\u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0432\u0441\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f\" + [System.Environment]::NewLine \t\tget-vpnconnection | where { $_.Name -match \"tmp\" } | Remove-VpnConnection -Force \t\t \t\t$button\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Visible = $false \t\t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cRDP.Enabled = $false \t\t$statusbar1.Text = $Global:Current.Name + ' \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d' \t\t \t} \t \t$buttonPingAll_Click={ \t\t#\u041f\u0438\u043d\u0433\u0443\u0435\u043c \u0432\u0441\u0435\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0438 \u043e\u043f\u043e\u0432\u0435\u0449\u0430\u0435\u043c \u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u0445 \t\t$I=0 \t\t$richtextboxinfo.Clear() \t\t$richtextboxinfo.SelectionColor = 'Black' \t\t$clientscount = $Global:Clients.count \t\t\t\t \t\t$Global:Clients | ForEach-Object { \t\t\tif ((test-connection -Count 1 -computer $_.ServerAddress -quiet) -eq $True) \t\t\t{ \t\t\t\t$richtextboxinfo.SelectionColor = 'Green' \t\t\t\t$richtextboxinfo.AppendText($_.Name +' ('+ $_.ServerAddress +') \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d' + [System.Environment]::NewLine) \t\t\t\t \t\t\t} \t\t\telse \t\t\t{ \t\t\t\t$richtextboxinfo.SelectionColor = 'Red' \t\t\t\t$richtextboxinfo.AppendText($_.Name + ' (' + $_.ServerAddress + ')  \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d (\u0438\u043b\u0438 \u0437\u0430\u043a\u0440\u044b\u0442 ICMP)' + [System.Environment]::NewLine) \t\t\t} \t\t\t$richtextboxinfo.ScrollToCaret() \t\t\t$I = $I + 1 \t\t\tWrite-Progress -Activity \"Ping in Progress\" -Status \"$i clients of $clientscount pinged\" -PercentComplete ($i\/$clientscount*100) \t\t\t \t\t} \t\t$richtextboxinfo.SelectionColor = 'Black' \t\tWrite-Progress -Activity \"Ping in Progress\" -Status \"Ready\" -Completed \t} \t \t \t \t$button\u041f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c\u0414\u0430\u043d\u043d\u044b\u0435_Click={ \t\t#\u041f\u0435\u0440\u0435\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b Google \t\t$Global:Clients = Get-Clients ($Global:google_file) \t\t$listbox_clients.Items.Clear() \t\t$Global:Clients | ForEach-Object { \t\t\t[void]$listbox_clients.Items.Add($_.Name) \t\t} \t\t \t} \t$button\u0412\u044b\u0445\u043e\u0434_Click = { \t\t#\u0412\u044b\u0445\u043e\u0434 \t\t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441.Close() \t} \t$richtextboxinfo_LinkClicked=[System.Windows.Forms.LinkClickedEventHandler]{ \t#\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043d\u0430 \u0441\u0441\u044b\u043b\u043a\u0443 \u0432 \u043e\u043a\u043d\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \t\tStart-Process $_.LinkText.ToString() \t} \t \t$buttonPing_Click={ \t\t#\u041f\u0438\u043d\u0433\u0443\u0435\u043c ip \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u043f\u043e\u043b\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \t\tif ((test-connection -Count 1 -computer $Global:Current.ServerAddress -quiet) -eq $True) \t\t{ \t\t\t$richtextboxinfo.AppendText([System.Environment]::NewLine) \t\t\t$richtextboxinfo.SelectionColor = 'Green' \t\t\t$richtextboxinfo.AppendText($Global:Current.Name + ' (' + $Global:Current.ServerAddress + ') \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d' + [System.Environment]::NewLine) \t\t\t \t\t} \t\telse \t\t{ \t\t\t$richtextboxinfo.AppendText([System.Environment]::NewLine) \t\t\t$richtextboxinfo.SelectionColor = 'Red' \t\t\t$richtextboxinfo.AppendText($Global:Current.Name + ' (' + $Global:Current.ServerAddress + ')  \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d (\u0438\u043b\u0438 \u0437\u0430\u043a\u0440\u044b\u0442 ICMP)' + [System.Environment]::NewLine) \t\t} \t}  \t#---------------------------------------------- \t#\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0444\u043e\u0440\u043c\u044b \t#---------------------------------------------- \t# \t# form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441 \t# \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441.Controls.Add($statusbar1) \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441.Controls.Add($groupboxTools) \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441.Controls.Add($groupboxRDP) \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441.Controls.Add($groupboxVPN) \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441.Controls.Add($richtextboxinfo) \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441.Controls.Add($listbox_clients) \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441.AutoScaleDimensions = '6, 13' \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441.AutoScaleMode = 'Font' \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441.AutoSize = $True \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441.ClientSize = '763, 446' \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441.FormBorderStyle = 'FixedSingle' \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441.MaximizeBox = $False \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441.Name = 'form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441' \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441.SizeGripStyle = 'Hide' \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441.StartPosition = 'CenterScreen' \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441.Text = '\u041a\u043b\u0438\u0435\u043d\u0442\u044b \u0410\u043b\u044c\u0431\u0443\u0441' \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441.add_FormClosing($form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441_FormClosing) \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441.add_Load($form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441_Load) \t# \t# statusbar1 \t# \t$statusbar1.Location = '0, 424' \t$statusbar1.Name = 'statusbar1' \t$statusbar1.Size = '763, 22' \t$statusbar1.TabIndex = 17 \t# \t# groupboxTools \t# \t$groupboxTools.Controls.Add($buttonPing) \t$groupboxTools.Controls.Add($button\u0412\u044b\u0445\u043e\u0434) \t$groupboxTools.Controls.Add($buttonWindox) \t$groupboxTools.Controls.Add($button\u041f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c\u0414\u0430\u043d\u043d\u044b\u0435) \t$groupboxTools.Controls.Add($buttonPingAll) \t$groupboxTools.Location = '308, 258' \t$groupboxTools.Name = 'groupboxTools' \t$groupboxTools.Size = '147, 163' \t$groupboxTools.TabIndex = 10 \t$groupboxTools.TabStop = $False \t$groupboxTools.Text = 'Tools' \t$groupboxTools.UseCompatibleTextRendering = $True \t# \t# buttonPing \t# \t$buttonPing.Location = '7, 44' \t$buttonPing.Name = 'buttonPing' \t$buttonPing.Size = '133, 23' \t$buttonPing.TabIndex = 12 \t$buttonPing.Text = 'Ping' \t$buttonPing.UseCompatibleTextRendering = $True \t$buttonPing.UseVisualStyleBackColor = $True \t$buttonPing.add_Click($buttonPing_Click) \t# \t# button\u0412\u044b\u0445\u043e\u0434 \t# \t$button\u0412\u044b\u0445\u043e\u0434.Location = '7, 125' \t$button\u0412\u044b\u0445\u043e\u0434.Name = 'button\u0412\u044b\u0445\u043e\u0434' \t$button\u0412\u044b\u0445\u043e\u0434.Size = '133, 23' \t$button\u0412\u044b\u0445\u043e\u0434.TabIndex = 15 \t$button\u0412\u044b\u0445\u043e\u0434.Text = '\u0412\u044b\u0445\u043e\u0434' \t$button\u0412\u044b\u0445\u043e\u0434.UseCompatibleTextRendering = $True \t$button\u0412\u044b\u0445\u043e\u0434.UseVisualStyleBackColor = $True \t$button\u0412\u044b\u0445\u043e\u0434.add_Click($button\u0412\u044b\u0445\u043e\u0434_Click) \t# \t# buttonWindox \t# \t$buttonWindox.Enabled = $False \t$buttonWindox.Location = '7, 17' \t$buttonWindox.Name = 'buttonWindox' \t$buttonWindox.Size = '133, 23' \t$buttonWindox.TabIndex = 11 \t$buttonWindox.Text = 'Windox' \t$buttonWindox.UseCompatibleTextRendering = $True \t$buttonWindox.UseVisualStyleBackColor = $True \t$buttonWindox.add_Click($buttonWindox_Click) \t# \t# button\u041f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c\u0414\u0430\u043d\u043d\u044b\u0435 \t# \t$button\u041f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c\u0414\u0430\u043d\u043d\u044b\u0435.Location = '7, 98' \t$button\u041f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c\u0414\u0430\u043d\u043d\u044b\u0435.Name = 'button\u041f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c\u0414\u0430\u043d\u043d\u044b\u0435' \t$button\u041f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c\u0414\u0430\u043d\u043d\u044b\u0435.Size = '133, 23' \t$button\u041f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c\u0414\u0430\u043d\u043d\u044b\u0435.TabIndex = 14 \t$button\u041f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c\u0414\u0430\u043d\u043d\u044b\u0435.Text = '\u041f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435' \t$button\u041f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c\u0414\u0430\u043d\u043d\u044b\u0435.UseCompatibleTextRendering = $True \t$button\u041f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c\u0414\u0430\u043d\u043d\u044b\u0435.UseVisualStyleBackColor = $True \t$button\u041f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c\u0414\u0430\u043d\u043d\u044b\u0435.add_Click($button\u041f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c\u0414\u0430\u043d\u043d\u044b\u0435_Click) \t# \t# buttonPingAll \t# \t$buttonPingAll.Location = '7, 71' \t$buttonPingAll.Name = 'buttonPingAll' \t$buttonPingAll.Size = '133, 23' \t$buttonPingAll.TabIndex = 13 \t$buttonPingAll.Text = 'Ping All' \t$buttonPingAll.UseCompatibleTextRendering = $True \t$buttonPingAll.UseVisualStyleBackColor = $True \t$buttonPingAll.add_Click($buttonPingAll_Click) \t# \t# groupboxRDP \t# \t$groupboxRDP.Controls.Add($comboboxRDP) \t$groupboxRDP.Controls.Add($textboxRDPLogin) \t$groupboxRDP.Controls.Add($textboxRdpPwd) \t$groupboxRDP.Controls.Add($button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cRDP) \t$groupboxRDP.Location = '308, 128' \t$groupboxRDP.Name = 'groupboxRDP' \t$groupboxRDP.Size = '147, 126' \t$groupboxRDP.TabIndex = 5 \t$groupboxRDP.TabStop = $False \t$groupboxRDP.Text = 'RDP' \t$groupboxRDP.UseCompatibleTextRendering = $True \t# \t# comboboxRDP \t# \t$comboboxRDP.FormattingEnabled = $True \t$comboboxRDP.Location = '7, 17' \t$comboboxRDP.Name = 'comboboxRDP' \t$comboboxRDP.Size = '133, 21' \t$comboboxRDP.TabIndex = 6 \t$comboboxRDP.Text = 'IP RDP \u0441\u0435\u0440\u0432\u0435\u0440\u0430' \t# \t# textboxRDPLogin \t# \t$textboxRDPLogin.Location = '7, 44' \t$textboxRDPLogin.Name = 'textboxRDPLogin' \t$textboxRDPLogin.Size = '133, 20' \t$textboxRDPLogin.TabIndex = 7 \t$textboxRDPLogin.Text = 'RDP-login' \t# \t# textboxRdpPwd \t# \t$textboxRdpPwd.Location = '7, 69' \t$textboxRdpPwd.Name = 'textboxRdpPwd' \t$textboxRdpPwd.PasswordChar = '*' \t$textboxRdpPwd.Size = '133, 20' \t$textboxRdpPwd.TabIndex = 8 \t$textboxRdpPwd.Text = 'RDP-Password' \t# \t# button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cRDP \t# \t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cRDP.Enabled = $False \t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cRDP.Location = '7, 94' \t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cRDP.Name = 'button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cRDP' \t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cRDP.Size = '133, 20' \t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cRDP.TabIndex = 9 \t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cRDP.Text = '\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c RDP' \t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cRDP.UseCompatibleTextRendering = $True \t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cRDP.UseVisualStyleBackColor = $True \t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cRDP.add_Click($button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cRDP_Click) \t# \t# groupboxVPN \t# \t$groupboxVPN.Controls.Add($button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN) \t$groupboxVPN.Controls.Add($button\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN) \t$groupboxVPN.Controls.Add($checkbox\u0428\u043b\u044e\u0437\u041f\u043e\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e) \t$groupboxVPN.Location = '308, 27' \t$groupboxVPN.Name = 'groupboxVPN' \t$groupboxVPN.Size = '147, 98' \t$groupboxVPN.TabIndex = 1 \t$groupboxVPN.TabStop = $False \t$groupboxVPN.Text = 'VPN' \t$groupboxVPN.UseCompatibleTextRendering = $True \t# \t# button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN \t# \t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Enabled = $False \t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Location = '7, 45' \t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Name = 'button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN' \t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Size = '133, 20' \t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.TabIndex = 3 \t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Text = '\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c VPN' \t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.UseCompatibleTextRendering = $True \t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.UseVisualStyleBackColor = $True \t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.add_Click($button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN_Click) \t# \t# button\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN \t# \t$button\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Enabled = $False \t$button\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Location = '7, 67' \t$button\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Name = 'button\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN' \t$button\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Size = '133, 20' \t$button\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.TabIndex = 4 \t$button\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Text = '\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c VPN' \t$button\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.UseCompatibleTextRendering = $True \t$button\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.UseVisualStyleBackColor = $True \t$button\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Visible = $False \t$button\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.add_Click($button\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN_Click) \t# \t# checkbox\u0428\u043b\u044e\u0437\u041f\u043e\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \t# \t$checkbox\u0428\u043b\u044e\u0437\u041f\u043e\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.Location = '7, 19' \t$checkbox\u0428\u043b\u044e\u0437\u041f\u043e\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.Name = 'checkbox\u0428\u043b\u044e\u0437\u041f\u043e\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e' \t$checkbox\u0428\u043b\u044e\u0437\u041f\u043e\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.Size = '133, 24' \t$checkbox\u0428\u043b\u044e\u0437\u041f\u043e\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.TabIndex = 2 \t$checkbox\u0428\u043b\u044e\u0437\u041f\u043e\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.Text = '\u0428\u043b\u044e\u0437 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e' \t$checkbox\u0428\u043b\u044e\u0437\u041f\u043e\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.TextAlign = 'MiddleRight' \t$checkbox\u0428\u043b\u044e\u0437\u041f\u043e\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.UseCompatibleTextRendering = $True \t$checkbox\u0428\u043b\u044e\u0437\u041f\u043e\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.UseVisualStyleBackColor = $True \t# \t# richtextboxinfo \t# \t$richtextboxinfo.Cursor = 'Default' \t$richtextboxinfo.ForeColor = 'WindowText' \t$richtextboxinfo.HideSelection = $False \t$richtextboxinfo.Location = '461, 27' \t$richtextboxinfo.Name = 'richtextboxinfo' \t$richtextboxinfo.ReadOnly = $True \t$richtextboxinfo.ScrollBars = 'ForcedVertical' \t$richtextboxinfo.ShowSelectionMargin = $True \t$richtextboxinfo.Size = '290, 394' \t$richtextboxinfo.TabIndex = 16 \t$richtextboxinfo.Text = '' \t$richtextboxinfo.add_LinkClicked($richtextboxinfo_LinkClicked) \t# \t# listbox_clients \t# \t$listbox_clients.FormattingEnabled = $True \t$listbox_clients.Location = '12, 27' \t$listbox_clients.Name = 'listbox_clients' \t$listbox_clients.Size = '290, 394' \t$listbox_clients.TabIndex = 0 \t$listbox_clients.add_SelectedIndexChanged($listbox_clients_SelectedIndexChanged)    \t#Save the initial state of the form \t$InitialFormWindowState = $form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441.WindowState \t#Init the OnLoad event to correct the initial state of the form \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441.add_Load($Form_StateCorrection_Load) \t#Clean up the control events \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441.add_FormClosed($Form_Cleanup_FormClosed) \t#Store the control values when form is closing \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441.add_Closing($Form_StoreValues_Closing) \t#Show the Form \treturn $form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441.ShowDialog()  }   #\u0417\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f! Main ($CommandLine)  <\/code><\/pre>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u0430\u043a \u0441\u043a\u0440\u0438\u043f\u0442 ps1 \u0438\u043b\u0438 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 exe \u0447\u0435\u0440\u0435\u0437 ps2exe \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/563686\/\"> https:\/\/habr.com\/ru\/post\/563686\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0420\u0430\u0431\u043e\u0442\u0430\u044f \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 IT-\u0430\u0443\u0442\u0441\u043e\u0440\u0441\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044f 3 \u043b\u0438\u043d\u0438\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438, \u0437\u0430\u0434\u0443\u043c\u0430\u043b\u0441\u044f, \u043a\u0430\u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432 \u043f\u043e RDP, \u0447\u0435\u0440\u0435\u0437 VPN \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>\u0422\u0430\u0431\u043b\u0438\u0447\u043a\u0438 \u0441 \u0430\u0434\u0440\u0435\u0441\u0430\u043c\u0438, \u043f\u0430\u0440\u043e\u043b\u044f\u043c\u0438 \u0438 \u043f\u0440\u043e\u0447\u0438\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0445\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u043f\u043e\u0438\u0441\u043a \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0432\u0431\u0438\u0432\u0430\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0441 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430\u043c\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f.<br \/>\u0414\u0435\u0440\u0436\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a VPN \u0432 Windows \u043d\u0435 \u0441\u0430\u043c\u0430\u044f \u043b\u0443\u0447\u0448\u0430\u044f \u0438\u0434\u0435\u044f, \u0434\u0430 \u0438 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043e\u043d\u043e\u0433\u043e, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c VPN\u044b \u0442\u043e\u0436\u0435 \u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435.<br \/>\u041f\u043b\u044e\u0441 \u043a \u0442\u043e\u043c\u0443, \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c VPN \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0448\u043b\u044e\u0437\u0430. \u0434\u0430\u0431\u044b \u043d\u0435 \u0433\u043e\u043d\u044f\u0442\u044c \u0432\u0435\u0441\u044c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u0442\u0440\u0430\u0444\u0438\u043a \u0447\u0435\u0440\u0435\u0437 \u043a\u043b\u0438\u0435\u043d\u0442\u0430.<br \/>\u0417\u0430\u0434\u0430\u0447\u0430, \u043a \u0442\u043e\u043c\u0443 \u0436\u0435, \u043e\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u0443 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 pptp, \u0443 \u043a\u043e\u0433\u043e-\u0442\u043e l2tp, \u0443 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u0441\u0435\u0442\u0435\u0439, \u0442\u0443\u043d\u043d\u0435\u043b\u0438 \u0438 \u0442.\u043f.<\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0431\u044b\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043d\u0430 Powershell \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u043d\u043e \u043f\u043e\u0437\u0436\u0435, \u0443\u0437\u043d\u0430\u0432, \u0447\u0442\u043e \u0432 Powershell \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Winforms \u043e\u043d\u0438 \u043f\u0435\u0440\u0435\u0440\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u0432 \u043d\u0435\u043a\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u043e\u0433\u043e \u0436\u0435 Powershell.<\/p>\n<p>\u0414\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043d\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0441\u044f \u0432\u043e\u043e\u0431\u0449\u0435, \u0440\u0430\u0437\u0432\u0435 \u0447\u0442\u043e \u043b\u0435\u0442 20 \u043d\u0430\u0437\u0430\u0434 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b \u043d\u0430 VBS \u0432 MS Excel \u0438 MS Access, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u044e \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e \u043a\u0440\u0438\u0442\u0438\u043a\u0443 \u043e\u0442 \u043e\u043f\u044b\u0442\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u0435\u0435.<\/p>\n<p>\u0412 Powershell, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 Windows 8 \u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0432 Windows 10, \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c VPN \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 Add-VpnConnection \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441 \u044d\u0442\u0438\u043c\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 Add-VpnConnectionRoute, \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f VPN \u0431\u0435\u0437 \u0448\u043b\u044e\u0437\u0430.<\/p>\n<p>\u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u0442\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u043e \u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041d\u043e, \u043e\u0431\u043e \u0432\u0441\u0435\u043c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0432 Google Disk \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c\u0438:<br \/> Number; Name; VPNname; ServerAddress; RemoteNetwork; VPNLogin; VPNPass; VPNType; l2tpPsk; RDPcomp; RDPuser; RDPpass; DefaultGateway; PortWinbox; WinboxLogin; WinboxPwd; Link; Inform<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<ul>\n<li>\n<p>VPNname \u2013 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f \u0434\u043b\u044f VPN \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>ServerAddress \u2013 \u0430\u0434\u0440\u0435\u0441 VPN \u0441\u0435\u0440\u0432\u0435\u0440\u0430 <\/p>\n<\/li>\n<li>\n<p>RemoteNetwork \u2013 \u0430\u0434\u0440\u0435\u0441\u0430 \u043f\u043e\u0434\u0441\u0435\u0442\u0438 \u0438\u043b\u0438 \u043f\u043e\u0434\u0441\u0435\u0442\u0435\u0439 \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u00ab;\u00bb<\/p>\n<\/li>\n<li>\n<p>VPNLogin; VPNPass \u2013 \u0443\u0447\u0435\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c VPN<\/p>\n<\/li>\n<li>\n<p>VPNType -\u0442\u0438\u043f VPN &nbsp;(\u043f\u043e\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f pptp \u0438\u043b\u0438 l2tp) <\/p>\n<\/li>\n<li>\n<p>l2tpPsk \u2013 PSK \u0434\u043b\u044f l2tp, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 pptp \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0443\u0441\u0442\u044b\u043c <\/p>\n<\/li>\n<li>\n<p>RDPcomp \u2013 \u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 RPD <\/p>\n<\/li>\n<li>\n<p>RDPuser; RDPpass \u2013 \u0443\u0447\u0435\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c RPD <\/p>\n<\/li>\n<li>\n<p>DefaultGateway \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 TRUE \u0438\u043b\u0438 FALSE \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0442\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u0438 \u00ab\u0428\u043b\u044e\u0437 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e\u00bb \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f. \u0412 90% \u0441\u043b\u0443\u0447\u0430\u0435\u0432 = FALSE<\/p>\n<\/li>\n<li>\n<p>PortWinbox; WinboxLogin; WinboxPwd \u2013 \u043f\u043e\u0440\u0442, \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f Winbox, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0443 \u043d\u0430\u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Mikrotik)<\/p>\n<\/li>\n<li>\n<p>Link \u2013 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430 \u0434\u0438\u0441\u043a\u0435 Google, \u0438\u043b\u0438 \u0432 \u043b\u044e\u0431\u043e\u043c \u0434\u0440\u0443\u0433\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u043f\u043e\u043b\u0435 \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043d\u0443\u0436\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438<\/p>\n<\/li>\n<\/ul>\n<p>Inform \u2013 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 <\/p>\n<p><a href=\"https:\/\/docs.google.com\/spreadsheets\/d\/1O-W1YCM4x3o5W1w6XahCJZpkTWs8cREXVF69gs1dD0U\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435<\/a><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"68\" width=\"68\">\n<p><strong>Number<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"73\" width=\"73\">\n<p><strong>Name<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"67\" width=\"67\">\n<p><strong>VPNname<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"90\" width=\"90\">\n<p><strong>ServerAddress<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"152\" width=\"152\">\n<p><strong>RemoteNetwork<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"82\" width=\"82\">\n<p><strong>VPNLogin<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"96\" width=\"96\">\n<p><strong>VPNPass<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"95\" width=\"95\">\n<p><strong>VPNType<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p><strong>l2tpPsk<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"112\" width=\"112\">\n<p><strong>RDPcomp<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"90\" width=\"90\">\n<p><strong>RDPuser<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"102\" width=\"102\">\n<p><strong>RDPpass<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"92\" width=\"92\">\n<p><strong>DefaultGateway<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"81\" width=\"81\">\n<p><strong>PortWinbox<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"85\" width=\"85\">\n<p><strong>WinboxLogin<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"86\" width=\"86\">\n<p><strong>WinboxPwd<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"143\" width=\"143\">\n<p><strong>Link<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p><strong>Inform<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"68\" width=\"68\">\n<p>1<\/p>\n<\/td>\n<td data-colwidth=\"73\" width=\"73\">\n<p>\u0422\u0435\u0441\u04421<\/p>\n<\/td>\n<td data-colwidth=\"67\" width=\"67\">\n<p>Test1<\/p>\n<\/td>\n<td data-colwidth=\"90\" width=\"90\">\n<p>a.b.c.d<\/p>\n<\/td>\n<td data-colwidth=\"152\" width=\"152\">\n<p>192.168.10.0\/24: 10.10.0.0\/24<\/p>\n<\/td>\n<td data-colwidth=\"82\" width=\"82\">\n<p>vpnuser<\/p>\n<\/td>\n<td data-colwidth=\"96\" width=\"96\">\n<p>passWord<\/p>\n<\/td>\n<td data-colwidth=\"95\" width=\"95\">\n<p>pptp<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p>none<\/p>\n<\/td>\n<td data-colwidth=\"112\" width=\"112\">\n<p>192.168.10.1<\/p>\n<\/td>\n<td data-colwidth=\"90\" width=\"90\">\n<p>user<\/p>\n<\/td>\n<td data-colwidth=\"102\" width=\"102\">\n<p>passWord<\/p>\n<\/td>\n<td data-colwidth=\"92\" width=\"92\">\n<p>TRUE<\/p>\n<\/td>\n<td data-colwidth=\"81\" width=\"81\">\n<p>8291<\/p>\n<\/td>\n<td data-colwidth=\"85\" width=\"85\">\n<p>Admin<\/p>\n<\/td>\n<td data-colwidth=\"86\" width=\"86\">\n<p>Admin<\/p>\n<\/td>\n<td data-colwidth=\"143\" width=\"143\">\n<p><a href=\"http:\/\/yandex.ru\" rel=\"noopener noreferrer nofollow\"><u>http:\/\/yandex.ru<\/u><\/a><\/p>\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<p>\u0442\u0435\u0441\u0442<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"68\" width=\"68\">\n<p>2<\/p>\n<\/td>\n<td data-colwidth=\"73\" width=\"73\">\n<p>\u0422\u0435\u0441\u04422<\/p>\n<\/td>\n<td data-colwidth=\"67\" width=\"67\">\n<p>Test2<\/p>\n<\/td>\n<td data-colwidth=\"90\" width=\"90\">\n<p>e.f.j.k<\/p>\n<\/td>\n<td data-colwidth=\"152\" width=\"152\">\n<p>192.168.2.0\/24<\/p>\n<\/td>\n<td data-colwidth=\"82\" width=\"82\">\n<p>vpnuser<\/p>\n<\/td>\n<td data-colwidth=\"96\" width=\"96\">\n<p>passWord<\/p>\n<\/td>\n<td data-colwidth=\"95\" width=\"95\">\n<p>l2tp<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p>KdoSDtdP<\/p>\n<\/td>\n<td data-colwidth=\"112\" width=\"112\">\n<p>192.168.2.1<\/p>\n<\/td>\n<td data-colwidth=\"90\" width=\"90\">\n<p>user<\/p>\n<\/td>\n<td data-colwidth=\"102\" width=\"102\">\n<p>passWord<\/p>\n<\/td>\n<td data-colwidth=\"92\" width=\"92\">\n<p>FALSE<\/p>\n<\/td>\n<td data-colwidth=\"81\" width=\"81\">\n<p>8291<\/p>\n<\/td>\n<td data-colwidth=\"85\" width=\"85\">\n<p>Admin<\/p>\n<\/td>\n<td data-colwidth=\"86\" width=\"86\">\n<p>Admin<\/p>\n<\/td>\n<td data-colwidth=\"143\" width=\"143\">\n<\/td>\n<td data-colwidth=\"77\" width=\"77\">\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0421\u043a\u0440\u0438\u043d\u0448\u043e\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u0437\u0430\u0442\u0435\u0440\u0442\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043b\u0438\u0441\u0442\u0438\u043d\u0433 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 \u0438 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f\u043c\u0438. \u0415\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043d\u043e \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0437\u0430\u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043f\u0440\u043e\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c <\/p>\n<pre><code class=\"powershell\">function Get-Clients #\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0430\u0434\u0440\u0435\u0441\u0430 \u0444\u0430\u0439\u043b\u0430 \u0432 Google Drive \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u0445 \t{ \t\tparam \t\t( \t\t\t[string]$google_url = \"\" \t\t)  \t\t[string]$xlsFile = $google_url \t\t$csvFile = \"$env:temp\\clients.csv\" \t\t$Comma = ',' \t\tInvoke-WebRequest $xlsFile -OutFile $csvFile \t\t \t\t$clients = Import-Csv -Delimiter $Comma -Path \"$env:temp\\clients.csv\" \t\tRemove-Item -Path $csvFile \t\treturn $clients \t}  function Main { &lt;#     \u0424\u0443\u043d\u043a\u0446\u0438\u044f, \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u0430\u044f \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 #&gt; \tParam ([String]$Commandline) \t \t#\u0418\u043d\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0417\u0434\u0435\u0441\u044c \u0436\u0435, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0443\u0442\u044c \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438 \t \t$Global:Clients = $null \t$Global:Current \t$Global:CurrentRDPcomp \t$Global:google_file = \"https:\/\/docs.google.com\/spreadsheets\/d\/1O-W1YCM4x3o5W1w6XahCJZpkTWs8cREXVF69gs1dD0U\/export?format=csv\" # \u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0440\u0430\u0437\u0443 \u0432 \u0432\u0438\u0434\u0435 csv-\u0444\u0430\u0439\u043b\u0430 \t \t$Global:Clients = Get-Clients ($Global:google_file) # \u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0443  \t \t#\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c Winbox64 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \t \t$download_url = \"https:\/\/download.mikrotik.com\/winbox\/3.27\/winbox64.exe\" \t$Global:local_path = \"$env:temp\\winbox64.exe\" \tIf ((Test-Path $Global:local_path) -ne $true) \t{ \t\t$WebClient = New-Object System.Net.WebClient \t\t$WebClient.DownloadFile($download_url, $Global:local_path) \t} \t   #\u0420\u0430\u0437\u0440\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u0442\u0435\u043a\u0443\u0449\u0438\u0435 VPN \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f (\u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439) \t \tforeach ($item in get-vpnconnection | where { $_.ConnectionStatus -eq \"Connected\" }) \t{ \t\tRasdial $item.Name \/disconnect \t} \t   #\u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0432\u0441\u0435, \u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u0435\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 \u043d\u0435 \u0443\u0434\u0430\u043b\u0438\u043b\u0438\u0441\u044c \u043f\u0440\u0438 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u043c \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \t \tget-vpnconnection | where { $_.Name -match \"tmp\" } | Remove-VpnConnection -Force \t \t#\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \t \tShow-MainForm_psf }  #\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0441\u0430\u043c\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435  function Show-MainForm_psf { \t \t[void][reflection.assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') \t[void][reflection.assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') \t \t#\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u043e\u0440\u043c\u0443 \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0444\u043e\u0440\u043c\u044b \t \t[System.Windows.Forms.Application]::EnableVisualStyles() \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441 = New-Object 'System.Windows.Forms.Form' \t$statusbar1 = New-Object 'System.Windows.Forms.StatusBar' \t$groupboxTools = New-Object 'System.Windows.Forms.GroupBox' \t$buttonPing = New-Object 'System.Windows.Forms.Button' \t$button\u0412\u044b\u0445\u043e\u0434 = New-Object 'System.Windows.Forms.Button' \t$buttonWindox = New-Object 'System.Windows.Forms.Button' \t$button\u041f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c\u0414\u0430\u043d\u043d\u044b\u0435 = New-Object 'System.Windows.Forms.Button' \t$buttonPingAll = New-Object 'System.Windows.Forms.Button' \t$groupboxRDP = New-Object 'System.Windows.Forms.GroupBox' \t$comboboxRDP = New-Object 'System.Windows.Forms.ComboBox' \t$textboxRDPLogin = New-Object 'System.Windows.Forms.TextBox' \t$textboxRdpPwd = New-Object 'System.Windows.Forms.TextBox' \t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cRDP = New-Object 'System.Windows.Forms.Button' \t$groupboxVPN = New-Object 'System.Windows.Forms.GroupBox' \t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN = New-Object 'System.Windows.Forms.Button' \t$button\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN = New-Object 'System.Windows.Forms.Button' \t$checkbox\u0428\u043b\u044e\u0437\u041f\u043e\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e = New-Object 'System.Windows.Forms.CheckBox' \t$richtextboxinfo = New-Object 'System.Windows.Forms.RichTextBox' \t$listbox_clients = New-Object 'System.Windows.Forms.ListBox' \t$InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState'    \t#---------------------------------------------- \t# \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \t#---------------------------------------------- \t \t$form\u041a\u043b\u0438\u0435\u043d\u0442\u044b\u0410\u043b\u044c\u0431\u0443\u0441_Load = { \t\t#\u041f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u043e\u0440\u043c\u044b \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u043f\u043e\u043b\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u043e\u043b\u0435 \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438 (\u0438\u0445 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u043c\u0438)  \t\t$richtextboxinfo.Clear() \t\t$Global:Clients | ForEach-Object { \t\t\t[void]$listbox_clients.Items.Add($_.Name) \t\t\t \t\t} # \u0412 \u043b\u0438\u0441\u0442\u0431\u043e\u043a\u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u0441\u0435\u0445 \u043d\u0430\u0448\u0438\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u043f\u043e \u0438\u043c\u0435\u043d\u0430\u043c \u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u043e\u0440\u043c\u044b \t} \t \t$listbox_clients_SelectedIndexChanged = { \t\t#\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u0435\u0433\u043e \u0432 \u043f\u043e\u043b\u0435 listbox_clients (\u043c\u0430\u0441\u0441\u0438\u0432, \u043a\u0430\u043a \u043c\u044b \u043f\u043e\u043c\u043d\u0438\u043c \u0441\u0447\u0438\u0442\u0430\u043d \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u0441 \u0434\u0438\u0441\u043a\u0430 Google) \t\t \t\t$statusbar1.Text = '\u0412\u044b\u0431\u0440\u0430\u043d \u043a\u043b\u0438\u0435\u043d\u0442: ' + $listbox_clients.SelectedItem.ToString() # \u041f\u0438\u0448\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0432 \u0441\u0442\u0430\u0442\u0443\u0441\u0431\u0430\u0440 \t\t \t\t$Global:Current = $Global:Clients.Where({ $_.Name -eq $listbox_clients.SelectedItem.ToString() }) \t\tIf ($Current.PortWinbox -ne 0) # \u0415\u0441\u043b\u0438 \u043f\u043e\u0440\u0442 Winbox \u0443\u043a\u0430\u0437\u0430\u043d, \u0442\u043e \u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 Mikrotik, \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u043a\u043d\u043e\u043f\u043a\u0443 \t\t{ \t\t\t$buttonWindox.Enabled = $true \t\t\t \t\t\t$buttonWindox.Text = \"Winbox\" \t\t} \t\t \t\t$VPNname = $Global:Current.VPNname + \"-tmp\" #\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a \u0438\u043c\u0435\u043d\u0438 VPN \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \"-tmp\" \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043a\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0445 \t\t \t\tswitch ($Global:Current.VPNType) #\u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 VPN \u043f\u0438\u0448\u0435\u043c \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0435 \"\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c pptp VPN\" \u0438\u043b\u0438 \"\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c l2tp VPN\", \u0435\u0441\u043b\u0438 \u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043d\u0435\u0442 VPN, \u0442\u043e \u043f\u0438\u0448\u0435\u043c \"\u0417\u0434\u0435\u0441\u044c \u043d\u0435\u0442 VPN\" \t\t{ \t\t\t \t\t\t\"pptp\" { \t\t\t\t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Enabled = $true \t\t\t\t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Text = \"\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c pptp VPN\" \t\t\t} \t\t\t\"l2tp\" { \t\t\t\t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Enabled = $true \t\t\t\t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Text = \"\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c l2tp VPN\" \t\t\t} \t\t\tDEFAULT \t\t\t \t\t\t{ \t\t\t\t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Enabled = $false \t\t\t\t$button\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044cVPN.Text = \"\u0417\u0434\u0435\u0441\u044c \u043d\u0435\u0442 VPN\" \t\t\t} \t\t} \t\tswitch ($Global:Current.DefaultGateway) #\u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043b\u0438 \u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \"\u0428\u043b\u044e\u0437 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e\" \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0447\u0435\u043a\u0431\u043e\u043a\u0441 \t\t{ \t\t\t\"FALSE\" \t\t\t{ $checkbox\u0428\u043b\u044e\u0437\u041f\u043e\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.Checked = $false } \t\t\t\"\u041d\u0435\u0442\" \t\t\t{ $checkbox\u0428\u043b\u044e\u0437\u041f\u043e\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.Checked = $false } \t\t\t\"TRUE\" \t\t\t{ $checkbox\u0428\u043b\u044e\u0437\u041f\u043e\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.Checked = $true } \t\t\t\"\u0414\u0430\"<\/code><\/pre>\n<\/p>\n<p><\/br><\/br><\/p>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-325207","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/325207","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=325207"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/325207\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=325207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=325207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=325207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}