{"id":5570,"date":"2017-04-14T15:21:11","date_gmt":"2017-04-14T12:21:11","guid":{"rendered":"http:\/\/msbro.ru\/?p=5570"},"modified":"2017-04-14T16:02:13","modified_gmt":"2017-04-14T13:02:13","slug":"otpravka-otcheta-po-fajjlam-polzovatelejj-po-pochte","status":"publish","type":"post","link":"https:\/\/msbro.ru\/index.php\/archives\/5570","title":{"rendered":"\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u043e\u0442\u0447\u0435\u0442\u0430 \u043f\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c \u043d\u0430 \u043f\u043e\u0447\u0442\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0434\u043e\u043c\u0435\u043d\u0430."},"content":{"rendered":"<p>\u0412 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0438 \u043f\u043e\u0441\u0442\u0430 <a href=\"http:\/\/msbro.ru\/index.php\/archives\/5556\">&#8220;\u041f\u043e\u0438\u0441\u043a \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0430 Autoit&#8221;<\/a><\/p>\n<p>\u0423\u0441\u043b\u043e\u0432\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438:<br \/>\n1. \u0415\u0441\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0432\u0438\u0434\u0430 C:\\MSBRO\\Files_on_Computers\\report\\%computername%-%username%.txt<br \/>\n2. \u0412 \u0444\u0430\u0439\u043b\u0430\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445 \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<br \/>\n3. \u0414\u0430\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<br \/>\n4. \u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u043f\u043e\u0432\u0435\u0441\u0442\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u0443\u0442\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0438\u0441\u044c\u043c\u0430.<br \/>\n5. \u0412\u0441\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0438\u0441\u044c\u043c\u0430 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e, \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043c \u0432 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043d\u0430\u0447\u043d\u0435\u043c&#8230;<br \/>\n<!--more--><\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u0443\u0447\u0435\u043d\u0438\u0439 \u0441 \u043f\u043e\u043f\u044b\u0442\u043a\u0430\u043c\u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0433\u043d\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0430\u0439\u043b\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0432 CSV. \u041f\u043e\u0442\u043e\u043c \u0443\u0436\u0435 \u043e\u0442\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c CSV \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0433\u043e.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u0432\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0438 \u0442\u0440\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<br \/>\n1. \u041f\u0435\u0440\u0432\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 CSV \u0444\u0430\u0439\u043b.<br \/>\n2. \u041e\u0442\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c CSV<br \/>\n3. \u041e\u0442\u043f\u0440\u0430\u0432\u0438\u043c \u043e\u0442\u0447\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c.<\/p>\n<p>\u0424\u0430\u0439\u043b\u044b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439 <a href=\"http:\/\/msbro.ru\/index.php\/archives\/5556\">&#8220;\u041f\u043e\u0438\u0441\u043a \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0430 Autoit&#8221;<\/a><br \/>\n\u0432 \u043f\u0430\u043f\u043a\u0435 C:\\MSBRO\\Files_on_Computers\\report. \u041f\u0430\u043f\u043a\u0430 &#8220;report&#8221; \u043e\u0442\u043a\u0440\u044b\u0442\u0430 \u043a\u0430\u043a \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 \u0438 \u0441\u043f\u0443\u0441\u0442\u044f NN \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043e\u043a \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0432 \u0442\u0430\u043a\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435:<\/p>\n<pre>COMPUTER1-PC-ebadaev.txt\r\nCOMPUTER2-PK-ederbenev.txt\r\nCOMPUTER3-PC-esidorov.txt\r\nCOMPUTER4-PK-petrov.txt\r\n<\/pre>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0430\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445 \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/p>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0430\u043f\u043a\u0438 C:\\MSBRO\\Files_on_Computers\\report \u0438 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0432 CSV<br \/>\n\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u043d\u0430 PorerShell msbro-generate-csv.ps1:<\/p>\n<pre># \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0435\u0432\r\ncls\r\ncd c:\\\r\n$my_LanPath = 'C:\\MSBRO\\Files_on_Computers\\report'\r\n$arr = @()\r\ngci $my_LanPath | ? {$_.PSIsContainer -eq $False} | % {\r\n  $obj = New-Object PSObject\r\n  $obj | Add-Member NoteProperty Directory $_.DirectoryName\r\n  $obj | Add-Member NoteProperty Name $_.Name\r\n  $obj | Add-Member NoteProperty Length $_.Length\r\n  $arr += $obj\r\n  }\r\n  $arr | Export-CSV -notypeinformation \"C:\\MSBRO\\Files_on_Computers\\msbro-report.csv\"\r\n<\/pre>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0444\u0430\u0439\u043b C:\\MSBRO\\Files_on_Computers\\msbro-report.csv \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f:<\/p>\n<pre>#TYPE Selected.System.IO.FileInfo\r\n\"FullName\",\"LastWriteTime\",\"Length\",\"BaseName\"\r\n\"C:\\MSBRO\\Files_on_Computers\\report\\COMPUTER3-PC-esidorov.txt\",\"08.12.2016 15:03:37\",\"644\",\"COMPUTER3-PC-esidorov\"\r\n\"C:\\MSBRO\\Files_on_Computers\\report\\COMPUTER4-PK-epetrov.txt\",\"27.12.2016 10:17:52\",\"2088\",\"COMPUTER4-PK-epetrov\"\r\n\"C:\\MSBRO\\Files_on_Computers\\report\\COMPUTER1-PC-ebadaev.txt\",\"20.01.2017 11:03:09\",\"4095\",\"COMPUTER1-PC-ebadaev\"\r\n\"C:\\MSBRO\\Files_on_Computers\\report\\COMPUTER2-PK-ederbenev.txt\",\"19.01.2017 9:25:29\",\"8248\",\"COMPUTER2-PK-ederbenev\"\r\n<\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 CSV \u043f\u0440\u043e\u0441\u0442\u0430\u044f. \u041d\u0430\u0441 \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u043f\u043e\u043b\u0435 &#8220;FullName&#8221; \u0438 &#8220;BaseName&#8221;. \u041f\u043e\u043b\u0435 &#8220;BaseName&#8221; \u043c\u043e\u0436\u043d\u043e \u043f\u0430\u0440\u0441\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0434\u043e\u043c\u0435\u043d\u0435 \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u0441\u043b\u0435 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f &#8220;-&#8221; \u0441\u0442\u043e\u0438\u0442 \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0434\u043e\u043c\u0435\u043d\u0430. \u0410 \u043f\u043e\u043b\u0435 &#8220;FullName&#8221; \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0443\u0442\u0438 \u0434\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u041a\u043e\u043c\u0443 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0444\u0430\u0439\u043b\u044b &#8211; \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e CSV \u0444\u0430\u043b\u0430.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0444\u0430\u0439\u043b\u044b.<br \/>\n\u041f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c PowerShell \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c.<br \/>\n\u042f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b \u0435\u0433\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u043e\u0432 (Windows 2012R2 Eng) \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0441\u0435\u0440\u0432\u0435\u0440 \u043a\u043e\u043d\u0441\u043e\u043b\u0435\u0439 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0434\u043e\u043c\u0435\u043d\u0435. \u041d\u0430 \u044d\u0442\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f AD (\u0438\u043d\u0430\u0447\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 Import-Module activedirectory \u043d\u0435 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442). \u0415\u0441\u043b\u0438 \u043b\u0435\u043d\u044c \u043c\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 \u043a\u043e\u043d\u0441\u043e\u043b\u0435\u0439 &#8211; \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u0434\u043e\u043c\u0435\u043d\u0430. \u042f \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b, \u043d\u043e \u0434\u0443\u043c\u0430\u044e \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e PowerShell \u0434\u043e\u043b\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Windows.<\/p>\n<p>\u0421\u0430\u043c \u0441\u043a\u0440\u0438\u043f\u0442 msbro-send-report.ps1 (\u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 mydomain.ru \u043d\u0430 \u0432\u0430\u0448\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f):<\/p>\n<pre># \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435\r\ncls\r\ncd c:\\\r\nImport-Module activedirectory\r\n$Smtp = 'hub1.mydomain.ru'\r\n$from = 'reports@mydomain.ru'\r\n$my_LanPath = 'C:\\MSBRO\\Files_on_Computers\\report'\r\n$my_LanPathCSV = 'C:\\MSBRO\\Files_on_Computers\\msbro-report.csv'\r\n$my_Date = Get-Date -UFormat \"%Y-%m-%d\"\r\n\r\n#\u0431\u0435\u0440\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f C:\\MSBRO\\Files_on_Computers\\msbro-report.csv \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\r\n$BulkImport = Import-Csv $my_LanPathCSV\r\n\r\nForEach ($Entry in $BulkImport) {\r\nWrite-host \u201c\u041f\u043e\u0448\u043b\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430: \u201c$Entry.Basename -ForegroundColor Green\r\nsleep 1\r\n\r\n#\u0431\u0435\u0440\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u043c\u0435\u043d\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u0438 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0432 $UserNameFromFile\r\n$a = $Entry.BaseName\r\n$b = $a.Split(\"-\")\r\n$b.Count\r\n$UserNameFromFile = $b[-1]\r\n\r\n#\u0441\u0442\u0430\u0432\u0438\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438. \u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435 \u0444\u0430\u0439\u043b\u044b C:\\MSBRO\\Files_on_Computers\\report \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c. \r\n#\u041c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 C:\\MSBRO\\Files_on_Computers\\report \u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442 \u0447\u0442\u043e \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u043c\u0430\u043b\u043e \u0444\u0430\u0439\u043b\u043e\u0432\r\n#\u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0432\u043e\u0434\u0443\r\nif((Get-Item $Entry.FullName).length -gt 2kb){\r\nWrite-Host \"\u0424\u0430\u0439\u043b \u0431\u043e\u043b\u044c\u0448\u0435\"\r\n\r\n#\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c e-mail \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438\u0437 AD\r\n$user2Find = $UserNameFromFile\r\n$user = Get-ADUser $user2Find -Properties mail\r\n$EmailFromFile = $user.mail\r\n\r\n#\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0442\u0435\u043b\u043e \u043f\u0438\u0441\u044c\u043c\u0430\r\n$Subject = '\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435: \u043d\u0430\u0439\u0434\u0435\u043d\u044b \u0444\u0430\u0439\u043b\u044b \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435'\r\n#\u0441\u0430\u043c\u043e \u0442\u0435\u043b\u043e \u043f\u0438\u0441\u044c\u043c\u0430\r\n$Body = $Null\r\n$Body += \"\"\r\n$Body += \"\u0414\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c!\"\r\n$Body += \"\u041f\u0440\u0438 \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0412\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u0431\u044b\u043b\u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u044b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u043c\u044b\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b, \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u0438\u0438.\"\r\n$Body += \"\u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u0432\u0430\u043c, \u0447\u0442\u043e \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0430 \u0436\u0435\u0441\u0442\u043a\u043e\u043c \u0434\u0438\u0441\u043a\u0435 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0442\u0430\u043d\u0446\u0438\u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u043e.\"\r\n$Body += \"\u041f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0438\u0442\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \u043d\u0430 \u043e\u0431\u0449\u0435\u043c \u0441\u0435\u0442\u0435\u0432\u043e\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u0435.\"\r\n$Body += \"\u0414\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430 \u043d\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u0439\u0442\u0435 \u043d\u0430 \u043d\u0435\u0433\u043e.\"\r\n$Body += \"\"\r\n\r\n#\u041a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0443 \u0432 utf8\r\n$enc = New-Object System.Text.utf8encoding\r\n#\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\r\nSend-MailMessage -From $from -To $EmailFromFile -Subject $Subject -BodyAsHtml $Body -Encoding $enc -SmtpServer $Smtp -Attachments $Entry.FullName\r\n}\r\nelse {\r\nWrite-Host \"\u0424\u0430\u0439\u043b \u043c\u0435\u043d\u044c\u0448\u0435\"\r\n}\r\n}\r\n<\/pre>\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u0441\u0435.<br \/>\n\u0415\u0441\u043b\u0438, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0431\u044b\u043b \u0444\u0430\u043b\u0438\u043a C:\\MSBRO\\Files_on_Computers\\report\\COMPUTER56-PC-ivanov.txt<br \/>\n\u0442\u043e \u0441\u043a\u0440\u0438\u043f\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0432 \u043f\u043e\u043b\u0435 e-mail \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f &#8216;ivanov&#8217; \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442 \u043d\u0430 \u044d\u0442\u043e\u0442 e-mail \u043f\u0438\u0441\u044c\u043c\u043e.<\/p>\n<p>\u0412\u0440\u043e\u0434\u0435 \u0432\u0441\u0435.<br \/>\n\u0423\u0434\u0430\u0447\u0438!<\/p>\n<p>&nbsp;<\/p>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u0442\u0443\u0442: \u00a0<a href=\"http:\/\/msbro.ru\/wp-content\/uploads\/2017\/04\/Files_on_Computers.zip\">Files_on_Computers<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0438 \u043f\u043e\u0441\u0442\u0430 &#8220;\u041f\u043e\u0438\u0441\u043a \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0430 Autoit&#8221; \u0423\u0441\u043b\u043e\u0432\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438: 1. \u0415\u0441\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0432\u0438\u0434\u0430 C:\\MSBRO\\Files_on_Computers\\report\\%computername%-%username%.txt 2. \u0412 \u0444\u0430\u0439\u043b\u0430\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445 \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. 3. \u0414\u0430\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. 4. \u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u043f\u043e\u0432\u0435\u0441\u0442\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u0443\u0442\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0438\u0441\u044c\u043c\u0430. 5. \u0412\u0441\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0438\u0441\u044c\u043c\u0430 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e, \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043c \u0432 &#8230;<\/p>\n<p><a href=\"https:\/\/msbro.ru\/index.php\/archives\/5570\" class=\"more-link\">Continue reading &lsquo;\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u043e\u0442\u0447\u0435\u0442\u0430 \u043f\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c \u043d\u0430 \u043f\u043e\u0447\u0442\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0434\u043e\u043c\u0435\u043d\u0430.&rsquo; &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[1833,17,1838],"class_list":["post-5570","post","type-post","status-publish","format-standard","hentry","category-scripts","tag-autoit","tag-powershell","tag-script"],"_links":{"self":[{"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/posts\/5570"}],"collection":[{"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/comments?post=5570"}],"version-history":[{"count":2,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/posts\/5570\/revisions"}],"predecessor-version":[{"id":5593,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/posts\/5570\/revisions\/5593"}],"wp:attachment":[{"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/media?parent=5570"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/categories?post=5570"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/tags?post=5570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<!-- WP Super Cache is installed but broken. The constant WPCACHEHOME must be set in the file wp-config.php and point at the WP Super Cache plugin directory. -->