{"id":269296,"date":"2015-11-30T13:41:02","date_gmt":"2015-11-30T10:41:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=269296"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=269296","title":{"rendered":"\u0410\u0443\u0434\u0438\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u041f\u043e\u0438\u0441\u043a \u043f\u043e \u0436\u0443\u0440\u0430\u043d\u0430\u043b\u0443 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. Power Powershell"},"content":{"rendered":"<p>       \u0410\u0443\u0434\u0438\u0442 \u0436\u0443\u0440\u043d\u0430\u043b\u0430 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u043c\u043e\u0433 \u043c\u043e\u0435\u043c\u0443 \u043a\u043e\u043b\u043b\u0435\u0433\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043b\u044e\u0431\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 \u0445\u043e\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c \u0438\u043b\u0438 ActiveDirectory. <\/p>\n<p>  \u0412 \u0442\u043e\u043f\u0438\u043a\u0435 \u0431\u0443\u0434\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0431\u0443\u0434\u0435\u0442 \u0432\u0430\u043c \u043f\u043e\u043b\u0435\u0437\u0435\u043d. <\/p>\n<p>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c. \u0427\u0442\u043e\u0431\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u0435\u043a\u0441\u0442\u0430, \u044f \u0441\u043e\u0437\u0434\u0430\u043b\u0430 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e ID \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432\u044b\u0434\u0430\u0435\u0442 \u0435\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435:<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<pre><code class=\"bash\">Function DefineReason ($Id){     switch ($Id){         4741{ Return &quot;\u0421\u043e\u0437\u0434\u0430\u043d\u0430 \u0443\u0447\u0435\u0442\u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430&quot;}         4742{ Return &quot;\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0430 \u0443\u0447\u0435\u0442\u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430&quot; }         4743{ Return &quot;\u0423\u0434\u0430\u043b\u0435\u043d\u0430 \u0443\u0447\u0435\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430&quot;}         4727{ Return &quot;\u0421\u043e\u0437\u0434\u0430\u043d\u0430 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u0433\u0440\u0443\u043f\u043f\u0430 \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c\u044e&quot;}         4728{ Return &quot;\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043a \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435 \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c\u044e&quot;}         4729{ Return &quot;\u0423\u0434\u0430\u043b\u0435\u043d \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0438\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c\u044e&quot;}         4730{ Return &quot;\u0423\u0434\u0430\u043b\u0435\u043d\u0430 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u0433\u0440\u0443\u043f\u043f\u0430 \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c\u044e&quot;}         4731{ Return &quot;\u0421\u043e\u0437\u0434\u0430\u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0433\u0440\u0443\u043f\u043f\u0430 \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c\u044e&quot;}         4732{ Return &quot;\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0433\u0440\u0443\u043f\u043f\u0443 \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c\u044e&quot;}         4733{ Return &quot;\u0423\u0434\u0430\u043b\u0435\u043d \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0438\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c\u044e&quot;}         4734{ Return &quot;\u0423\u0434\u0430\u043b\u0435\u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0433\u0440\u0443\u043f\u043f\u0430 \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c\u044e&quot;}         4735{ Return &quot;\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0433\u0440\u0443\u043f\u043f\u0430 \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c\u044e&quot;}         4737{ Return &quot;\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0430 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u0433\u0440\u0443\u043f\u043f\u0430 \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c\u044e&quot;}         4743{ Return &quot;\u0423\u0434\u0430\u043b\u0435\u043d\u0430 \u0443\u0447\u0435\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430&quot;}         4754{ Return &quot;\u0421\u043e\u0437\u0434\u0430\u043d\u0430 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0430\u044f \u0433\u0440\u0443\u043f\u043f\u0430 \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c\u044e&quot; }         4755{ Return &quot;\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0430 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0430\u044f \u0433\u0440\u0443\u043f\u043f\u0430 \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c\u044e&quot;}         4756{ Return &quot;\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043a \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435 \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c\u044e&quot;}         4757{ Return &quot;\u0423\u0434\u0430\u043b\u0435\u043d \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0438\u0437 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c\u044e&quot;}         4758{ Return &quot;\u0423\u0434\u0430\u043b\u0435\u043d\u0430 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0430\u044f \u0433\u0440\u0443\u043f\u043f\u0430 \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c\u044e&quot;}         4764{ Return &quot;\u0418\u0437\u043c\u0435\u043d\u0435\u043d \u0442\u0438\u043f \u0433\u0440\u0443\u043f\u043f\u044b&quot;}         4720{ Return &quot;\u0421\u043e\u0437\u0434\u0430\u043d\u0430 \u0443\u0447\u0435\u0442\u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c&quot;}         4722{ Return &quot;\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0443\u0447\u0435\u0442\u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c&quot;}         4724{ Return &quot;\u0421\u0431\u0440\u043e\u0441 \u043f\u0430\u0440\u043e\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f&quot;}         4725{ Return &quot;\u0423\u0447\u0435\u0442\u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0430&quot;}         4726{ Return &quot;\u0423\u0447\u0435\u0442\u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0430&quot;}         4738{ Return &quot;\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0430 \u0443\u0447\u0435\u0442\u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c&quot;}         4740{ Return &quot;\u0423\u0447\u0435\u0442\u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0430&quot;}         4767{ Return &quot;\u0423\u0447\u0435\u0442\u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0440\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0430&quot;}         4780{ Return &quot;\u0421\u043f\u0438\u0441\u043e\u043a \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0414\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u0431\u044b\u043b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043d\u0430 \u0443\u0447\u0435\u0442\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0447\u043b\u0435\u043d\u0430\u043c\u0438 \u0433\u0440\u0443\u043f\u043f\u044b \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u0432&quot;}         4781{ Return &quot;\u0411\u044b\u043b\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043e \u0438\u043c\u044f \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438&quot;}         4794{ Return &quot;\u0411\u044b\u043b\u0430 \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u043d\u044f\u0442\u0430 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0437\u0430\u0434\u0430\u0442\u044c \u0440\u0435\u0436\u0438\u043c \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043b\u0443\u0436\u0431 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432&quot;}         5376{ Return &quot;\u0414\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440 \u0443\u0447\u0435\u0442\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445: \u0443\u0447\u0435\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u044b\u043b\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u044b&quot;}         5377{ Return &quot;\u0414\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440 \u0443\u0447\u0435\u0442\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445: \u0443\u0447\u0435\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u044b\u043b\u0438 \u0432\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0438\u0437 \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u043e\u0439 \u043a\u043e\u043f\u0438\u0438&quot;}         4825{ Return &quot;\u0417\u0430\u043f\u0440e\u0449\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0440\u0430\u0431\u043e\u0447\u0435\u043c\u043e \u0441\u0442\u043e\u043b\u0443, \u043d\u0435 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u0433\u0440\u0443\u043f\u043f\u0443 RDP&quot;}         1102{ Return &quot;\u0423\u0434\u0430\u043b\u0435\u043d \u0436\u0443\u0440\u043d\u0430\u043b Security&quot;}     } } <\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u043c\u0430\u0441\u043a\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0430:<\/p>\n<pre><code class=\"bash\"># \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u043e \u043c\u0430\u0441\u043a\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0430  Function DefineReasonByAccessMask ($AccessMask){     switch($AccessMask){         &quot;0xc0000064&quot;  { Return &quot;\u0418\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442&quot; }         &quot;0xc000006A&quot;  { Return &quot;\u0412\u0435\u0440\u043d\u043e\u0435 \u0438\u043c\u044f, \u043d\u043e \u043d\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u043e\u043b\u044c&quot;}         &quot;0xc0000234&quot;  { Return &quot;\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d&quot; }         &quot;0xc0000072&quot;  { Return &quot;\u0423\u0447\u0435\u0442\u043a\u0430 \u0434\u0435\u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u0430&quot;}         &quot;0xc0000006F&quot; { Return &quot;\u0412\u0445\u043e\u0434 \u0432\u043d\u0435 \u0440\u0430\u0431\u043e\u0447\u0435\u0435 \u0432\u0440\u0435\u043c\u044f&quot;}         &quot;0xc00000070&quot; { Return &quot;\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u043d\u0446\u0438\u0438&quot;}         &quot;0xc00000193&quot; { Return &quot;\u0421\u0440\u043e\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0438\u0441\u0442\u0435\u043a&quot;}         &quot;0xc00000071&quot; { Return &quot;\u0421\u0440\u043e\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u0430\u0440\u043e\u043b\u044f \u0418\u0441\u0442\u0435\u043a&quot;}         &quot;0xc00000224&quot; { Return &quot;\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u043f\u0440\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0432\u0445\u043e\u0434\u0435&quot;}         &quot;0xc000015b&quot;  { Return &quot;\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d \u0432\u0445\u043e\u0434 \u043d\u0430 \u044d\u0442\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435&quot;}         &quot;0xc000006d&quot;  { Return &quot;\u041d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u043f\u0430\u0440\u043e\u043b\u044c&quot;}     } } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0437\u0430 \u0447\u0435\u043c \u0445\u043e\u0442\u0438\u043c \u0441\u043b\u0435\u0434\u0438\u0442\u044c. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433 \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u043e \u0430\u0443\u0434\u0438\u0442\u0443 \u2014 \u044d\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0436\u0443\u0440\u043d\u0430\u043b\u0430 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 XML, \u0442\u0430\u043a \u043a\u0430\u043a \u0435\u0441\u043b\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043c\u043d\u043e\u0433\u043e, \u0442\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. <\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0438\u0437 \u0436\u0443\u0440\u043d\u0430\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u043d\u0443 \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434, \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438:<\/p>\n<h4>1. Get-LogEvent security<\/h4>\n<p>  \u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430:<\/p>\n<p>   \u2014 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f;<br \/>   \u2014 \u043d\u0435 \u043d\u0443\u0436\u043d\u0430 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f.<\/p>\n<p>  \u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438:<\/p>\n<p>   \u2014 \u0434\u043e\u0441\u0442\u0443\u043f \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u043c\u0443 \u0436\u0443\u0440\u043d\u0430\u043b\u0443 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043f\u043e \u043f\u0443\u0442\u0438: Windows\/System32\/winevt\/security.evtx;<br \/>   \u2014 \u0434\u043e\u043b\u0433\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0442\u0435\u0433\u0430 . \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0443\u0442\u0435\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e\u0439 \u0441\u0435\u043f\u0430\u0440\u0430\u0446\u0438\u0438 \u0441 \u043b\u0438\u043a\u0432\u0438\u0434\u0430\u0446\u0438\u0435\u0439 \u0441\u043f\u0435\u0446\u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.<\/p>\n<h4>2. Get-WinEvent \u2013path \u201cD:\/\u201d<\/h4>\n<p>  \u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430:<\/p>\n<p>   \u2014 \u0431\u044b\u0441\u0442\u0440\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0436\u0443\u0440\u043d\u0430\u043b\u0430;<br \/>   \u2014 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043b\u044e\u0431\u043e\u043c\u0443 \u0436\u0443\u0440\u043d\u0430\u043b\u0443. \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c.<\/p>\n<p>  \u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438:<\/p>\n<p>   \u2014 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0436\u0443\u0440\u043d\u0430\u043b\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430.<\/p>\n<pre><code class=\"bash\">Try { $Events = Get-WinEvent -FilterHashTable $MyFilter  } Catch {&quot;No events were found in $Log&quot;; Continue}     ForEach ($Raw_Event in $Events)     {\t           Try{           $EventXML = [xml]$Raw_Event.ToXML()       } Catch {Write-Host &quot;Unable to convert an event to XML&quot;}       $Event = @{}       ForEach ($object in $EventXML.Event.EventData.Data) {         $Event.Add($object.name,$object.'#text')       }        $Event.Add(&quot;ID&quot;,$Raw_Event.ID)       $Event.Add(&quot;TimeCreated&quot;,$Raw_Event.TimeCreated) <\/code><\/pre>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433 \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0436\u0443\u0440\u043d\u0430\u043b\u0443, \u044d\u0442\u043e \u0432\u044b\u0442\u044f\u0433\u0438\u0432\u0430\u0442\u044c \u0438\u0437 \u0436\u0443\u0440\u043d\u0430\u043b\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043f\u043e \u043d\u0438\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u2013 \u044d\u0442\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u0430 \u043f\u043e\u0447\u0442\u0443 \u0438\u043b\u0438 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b.<\/p>\n<p>  \u0417\u0430\u0434\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u0442\u044f\u0433\u0438\u0432\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u0414\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0435 \u043e\u043a\u043d\u043e \u0441 \u0432\u0432\u043e\u0434\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/upload.akusherstvo.ru\/image891446.png\" alt=\"image\"\/><\/p>\n<p>  1. \u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442, \u0447\u0442\u043e \u0436\u0443\u0440\u043d\u0430\u043b\u044b \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u0434\u0430\u0442\u044c. \u0415\u0441\u043b\u0438 \u0436\u0443\u0440\u043d\u0430\u043b \u043e\u0434\u0438\u043d, \u0442\u043e \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0436\u0443\u0440\u043d\u0430\u043b\u043e\u0432: \u00abC:\\Windows\\System32\\winevt\\Logs\u00bb.<\/p>\n<p>  2. \u0412\u0442\u043e\u0440\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u043b\u043e\u0433\u0438. \u0415\u0441\u043b\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0434\u0438\u043d, \u0442\u043e \u0441\u0442\u0430\u0432\u0438\u043c \u00ab*\u00bb.<\/p>\n<p>  3. \u0422\u0440\u0435\u0442\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u0435\u043d: * \u2014 \u0438\u0449\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0437\u0430 \u0432\u0435\u0441\u044c \u043f\u0435\u0440\u0438\u043e\u0434, \u0435\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u043d\u0430 \u0434\u0430\u0442\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 30.11.2015, \u0442\u043e \u0438\u0449\u0435\u043c \u0437\u0430 \u044d\u0442\u0443 \u0434\u0430\u0442\u0443. \u041f\u043e\u0438\u0441\u043a \u0437\u0430 \u043f\u0435\u0440\u0438\u043e\u0434 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0432\u043e\u0434\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0434\u0430\u0442\u044b \u0447\u0435\u0440\u0435\u0437 \u0442\u0438\u0440\u0435 (01.11.2015-30.11.2015).<\/p>\n<p>  4. \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0443\u0442\u044c \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u00abD:\\log.log\u00bb. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043a\u043e\u0434, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430:<\/p>\n<pre><code class=\"bash\">$objForm = New-Object System.Windows.Forms.Form  $objForm.Text = &quot;\u0412\u0432\u043e\u0434 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445&quot; $objForm.Size = New-Object System.Drawing.Size(300,450)  $objForm.StartPosition = &quot;CenterScreen&quot;  # Events path $objLabel1 = New-Object System.Windows.Forms.Label $objLabel1.Location = New-Object System.Drawing.Size(10,20)  $objLabel1.Size = New-Object System.Drawing.Size(280,40)  $objLabel1.Text = &quot;\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u0436\u0443\u0440\u043d\u0430\u043b\u0430\u043c \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435`nD:\/...\/...\/ :&quot; $objForm.Controls.Add($objLabel1)   $objTextBox1 = New-Object System.Windows.Forms.TextBox  $objTextBox1.Location = New-Object System.Drawing.Size(10,60)  $objTextBox1.Size = New-Object System.Drawing.Size(280,20)  $objForm.Controls.Add($objTextBox1)   #Find Server mode  $objLabel2 = New-Object System.Windows.Forms.Label $objLabel2.Location = New-Object System.Drawing.Size(10,90)  $objLabel2.Size = New-Object System.Drawing.Size(280,30)  $objLabel2.Text = &quot;1. * - \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c.`n2. \u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u0421\u0435\u0440\u0432\u0435\u0440.&quot; $objForm.Controls.Add($objLabel2)   $objTextBox2 = New-Object System.Windows.Forms.TextBox  $objTextBox2.Location = New-Object System.Drawing.Size(10,120)  $objTextBox2.Size = New-Object System.Drawing.Size(280,30)  $objForm.Controls.Add($objTextBox2)  #Type Events Mode  $objLabel3 = New-Object System.Windows.Forms.Label $objLabel3.Location = New-Object System.Drawing.Size(10,150)  $objLabel3.Size = New-Object System.Drawing.Size(280,45)  $objLabel3.Text = &quot;1. * - \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c.`n2. \u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435.`n3. \u041f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u0442\u0435 \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u044f\u0442\u0443\u044e \u0441\u043e\u0431\u044b\u0442\u0438\u044f&quot; $objForm.Controls.Add($objLabel3)   $objTextBox3 = New-Object System.Windows.Forms.TextBox  $objTextBox3.Location = New-Object System.Drawing.Size(10,195)  $objTextBox3.Size = New-Object System.Drawing.Size(280,30)  $objForm.Controls.Add($objTextBox3)  #Date Events mode  $objLabel4 = New-Object System.Windows.Forms.Label $objLabel4.Location = New-Object System.Drawing.Size(10,225)  $objLabel4.Size = New-Object System.Drawing.Size(280,60)  $objLabel4.Text = &quot;1. * - \u0437\u0430 \u0432\u0435\u0441\u044c \u043f\u0435\u0440\u0438\u043e\u0434.`n2. \u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u0434\u0430\u0442\u0443 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0414\u0414.\u041c\u041c.\u0413\u0413\u0413\u0413.`n3. \u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0414\u0414.\u041c\u041c.\u0413\u0413\u0413\u0413-\u0414\u0414.\u041c\u041c.\u0413\u0413\u0413\u0413&quot; $objForm.Controls.Add($objLabel4)   $objTextBox4 = New-Object System.Windows.Forms.TextBox  $objTextBox4.Location = New-Object System.Drawing.Size(10,285)  $objTextBox4.Size = New-Object System.Drawing.Size(280,30)  $objForm.Controls.Add($objTextBox4)  #Save Result  $objLabel5 = New-Object System.Windows.Forms.Label $objLabel5.Location = New-Object System.Drawing.Size(10,315)  $objLabel5.Size = New-Object System.Drawing.Size(280,30)  $objLabel5.Text = &quot;\u041f\u0443\u0442\u044c \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043f\u043e\u0438\u0441\u043a\u0430&quot; $objForm.Controls.Add($objLabel5)   $objTextBox5 = New-Object System.Windows.Forms.TextBox  $objTextBox5.Location = New-Object System.Drawing.Size(10,345)  $objTextBox5.Size = New-Object System.Drawing.Size(280,30)  $objForm.Controls.Add($objTextBox5)  # \u041a\u043d\u043e\u043f\u043a\u0438 \u041e\u041a \u0438 \u041e\u0442\u043c\u0435\u043d\u0430. \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u041e\u041a.   $OKButton = New-Object System.Windows.Forms.Button $OKButton.Location = New-Object System.Drawing.Size(75,380) $OKButton.Size = New-Object System.Drawing.Size(75,23) $OKButton.Text = &quot;OK&quot; $OKButton.Add_Click({$objForm.Close()}) $objForm.Controls.Add($OKButton) $OKButton.DialogResult=[System.Windows.Forms.DialogResult]::OK  $CancelButton = New-Object System.Windows.Forms.Button $CancelButton.Location = New-Object System.Drawing.Size(150,380) $CancelButton.Size = New-Object System.Drawing.Size(75,23) $CancelButton.Text = &quot;Cancel&quot; $CancelButton.Add_Click({$objForm.Close()}) $objForm.Controls.Add($CancelButton)  $objForm.Topmost = $True  $objForm.Add_Shown({$objForm.Activate()}) $dialogResult =  $objForm.ShowDialog() # \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u043e <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435:<\/p>\n<pre><code class=\"bash\"># \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b if ($dialogResult -eq &quot;OK&quot;){     $Log_Path       = $objTextBox1.Text     $FindServerMode = $objTextBox2.Text     $TypeEventsMode = $objTextBox3.Text     $DateEventsmode = $objTextBox4.Text     $SaveResult     = $objTextBox5.Text } <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432 \u043f\u043e\u043b\u0435 \u0434\u0430\u0442\u0430 \u0435\u0441\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b &quot;-&quot;, \u0437\u043d\u0430\u0447\u0438\u0442 \u0432\u0432\u0435\u0434\u0435\u043d \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e\u0442 \u0441\u0438\u043c\u0432\u043e\u043b \u0432\u0432\u0435\u0434\u0435\u043d \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e \u2014 \u0432\u0430\u0448\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u041f\u0440\u043e\u0432\u043e\u0434\u0438\u043c \u0441\u0435\u043f\u0430\u0440\u0430\u0446\u0438\u044e \u043f\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0443 &quot;-&quot;, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u0434\u0430\u0442\u0443 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430.<\/p>\n<pre><code class=\"bash\">if ($DateEventsmode -match &quot;-&quot;){     $x = $DateEventsmode.split(&quot;-&quot;)     $StartDate = $x[0]     $EndDate = $x[1]     $StartDate = [DateTime]::parse($StartDate)     $StartDate      $EndDate = [DateTime]::parse($EndDate)     $EndDate } <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u043e \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u043f\u043e\u043b\u0435 \u043d\u0435\u0442 \u043d\u0438 &quot;-&quot;, \u043d\u0438 &quot;*&quot;, \u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u0432\u0432\u0435\u0434\u0435\u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u0434\u0430\u0442\u0430.<\/p>\n<pre><code class=\"bash\">if ($DateEventsmode -notmatch &quot;-&quot; -and $DateEventsmode -ne &quot;*&quot;){     $StartDate1 = [DateTime]::parse($DateEventsmode) } <\/code><\/pre>\n<p>  1. \u041f\u043e\u0438\u0441\u043a \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c, \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c, \u0437\u0430 \u0432\u0435\u0441\u044c \u043f\u0435\u0440\u0438\u043e\u0434:<\/p>\n<pre><code class=\"bash\">if ($FindServerMode -eq &quot;*&quot; -and $DateEventsmode -eq &quot;*&quot; -and $TypeEventsMode -eq &quot;*&quot; -and $Log_Path -ne &quot;&quot;){ Write-host &quot;\u0432\u043e\u0448\u043b\u0438 \u0432 1&quot;      $ALL_LOGS = Get-ChildItem -Path $Log_Path -recurse| Where {$_.Extension -eq &quot;.evtx&quot;} | Sort LastWriteTime      $ALL_LOGS      foreach ($Log in $ALL_LOGS){         $LogFile = &quot;Audit EventLog Security&quot; +&quot;`n&quot;         ($Log).FullName         $MyFilter = @{Path=($Log).FullName}         $i=0         Try {$Events = Get-WinEvent -FilterHashTable $MyFilter} Catch {&quot;No events were found in $Log&quot;; Continue}         ForEach ($Raw_Event in $Events){         \t                Try{$EventXML = [xml]$Raw_Event.ToXML()} Catch {Write-Host &quot;Unable to convert an event to XML&quot;}                        $Event = @{}            ForEach ($object in $EventXML.Event.EventData.Data) {               $Event.Add($object.name,$object.'#text')            }            $Event.Add(&quot;ID&quot;,$Raw_Event.ID)            $Event.Add(&quot;TimeCreated&quot;,$Raw_Event.TimeCreated)             $LogFile+= &quot;EventID:            &quot; + $Raw_Event.ID                      +&quot;`n&quot;            $LogFile+= &quot;Target User Name:   &quot; + $Event.TargetUserName                +&quot;`n&quot;            $LogFile+= &quot;Target Domain Name: &quot; + $Event.TargetDomainName              +&quot;`n&quot;            $LogFile+= &quot;Status:             &quot; + $Event.Status                        +&quot;`n&quot;            $LogFile+= &quot;TimeGenerated:      &quot; + $Event.TimeCreated                   +&quot;`n&quot;            $LogFile+= &quot;Workstation Name:   &quot; + $Event.WorkstationName               +&quot;`n&quot;            $LogFile+= &quot;IpAddress:          &quot; + $Event.IpAddress                     +&quot;`n&quot;            $LogFile+= &quot;Computer:           &quot; + [xml]$Raw_Event.ToXML().Event.System.Computer                     +&quot;`n&quot;            $Reason = DefineReason -Id $Raw_Event.ID            $AccessM = DefineReasonByAccessMask -AccessMask $Event.Status              $LogFile+= &quot;Reason(RU):         &quot; + $Reason  + &quot; &quot;+  $AccessM            +&quot;`n&quot;            $LogFile+= &quot;Reason(SYS):        &quot; + $Event.Message                      +&quot;`n&quot;            $LogFile+= &quot;----------------------------------------------------------------`n&quot;            $i++          }         } } <\/code><\/pre>\n<p>  2. \u041f\u043e\u0438\u0441\u043a \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c, \u043f\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0437\u0430 \u0432\u0435\u0441\u044c \u043f\u0435\u0440\u0438\u043e\u0434:<\/p>\n<pre><code class=\"bash\">if ($FindServerMode -eq &quot;*&quot; -and $DateEventsmode -eq &quot;*&quot; -and $TypeEventsMode -ne &quot;*&quot; -and $Log_Path -ne &quot;&quot;){ Write-host &quot;\u0432\u043e\u0448\u043b\u0438 \u0432 2&quot;          $ALL_LOGS = Get-ChildItem -Path $Log_Path | Where {$_.Extension -eq &quot;.evtx&quot;} | Sort LastWriteTime          $ALL_LOGS          foreach ($Log in $ALL_LOGS){             $LogFile = &quot;Audit EventLog Security&quot; +&quot;`n&quot;             ($Log).FullName             $MyFilter = @{Path=($Log).FullName;ID=$TypeEventsMode}             Try {$Events = Get-WinEvent -FilterHashTable $MyFilter} Catch {&quot;No events were found in $Log&quot;; Continue}             ForEach ($Raw_Event in $Events){\t                    Try{$EventXML = [xml]$Raw_Event.ToXML()} Catch {Write-Host &quot;Unable to convert an event to XML&quot;}                $Event = @{}                ForEach ($object in $EventXML.Event.EventData.Data) {                   $Event.Add($object.name,$object.'#text')                }                 $Event.Add(&quot;ID&quot;,$Raw_Event.ID)                $Event.Add(&quot;TimeCreated&quot;,$Raw_Event.TimeCreated)                 $LogFile+= &quot;EventID:            &quot; + $Event.ID                       +&quot;`n&quot;                $LogFile+= &quot;Target User Name:   &quot; + $Event.TargetUserName                +&quot;`n&quot;                $LogFile+= &quot;Target Domain Name: &quot; + $Event.TargetDomainName              +&quot;`n&quot;                $LogFile+= &quot;Status:             &quot; + $Event.Status                        +&quot;`n&quot;                $LogFile+= &quot;TimeGenerated:      &quot; + $Event.TimeCreated                   +&quot;`n&quot;                $LogFile+= &quot;Workstation Name:   &quot; + $Event.WorkstationName               +&quot;`n&quot;                $LogFile+= &quot;IpAddress:          &quot; + $Event.IpAddress                     +&quot;`n&quot;                $LogFile+= &quot;Computer:           &quot; + [xml]$Raw_Event.ToXML().Event.System.Computer                     +&quot;`n&quot;                $Reason = DefineReason -Id $Raw_Event.ID                $AccessM = DefineReasonByAccessMask -AccessMask $Event.Status                  $LogFile+= &quot;Reason(RU):         &quot; + $Reason  + &quot; &quot;+  $AccessM            +&quot;`n&quot;                $LogFile+= &quot;Reason(SYS):        &quot; + $Event.Message                      +&quot;`n&quot;                $LogFile+= &quot;----------------------------------------------------------------`n&quot;              }          }      } <\/code><\/pre>\n<p>  3. \u041f\u043e\u0438\u0441\u043a \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c, \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c, \u0437\u0430 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d:<\/p>\n<pre><code class=\"bash\">if ($FindServerMode -eq &quot;*&quot; -and $DateEventsmode -match &quot;-&quot; -and $TypeEventsMode -eq &quot;*&quot; -and $Log_Path -ne &quot;&quot;){ Write-host &quot;\u0432\u043e\u0448\u043b\u0438 \u0432 3&quot;         $ALL_LOGS = Get-ChildItem -Path $Log_Path -Recurse| Where {$_.Extension -eq &quot;.evtx&quot; } | Sort LastWriteTime         $ALL_LOGS         foreach ($Log in $ALL_LOGS){            $LogFile = &quot;Audit EventLog Security&quot; +&quot;`n&quot;            ($Log).FullName            $StartDate            $EndDate            $MyFilter = @{Path=($Log).FullName}            Try {$Events = Get-WinEvent -FilterHashTable $MyFilter} Catch {&quot;No events were found in $Log&quot;; Continue}            ForEach ($Raw_Event in $Events){\t                   Try{$EventXML = [xml]$Raw_Event.ToXML()} Catch {Write-Host &quot;Unable to convert an event to XML&quot;}               $Event = @{}               ForEach ($object in $EventXML.Event.EventData.Data) {                  $Event.Add($object.name,$object.'#text')               }                $Event.Add(&quot;ID&quot;,$Raw_Event.ID)               $Event.Add(&quot;TimeCreated&quot;,$Raw_Event.TimeCreated)               $Event.TimeCreated               if ($Event.TimeCreated -gt $StartDate -and $Event.TimeCreated -lt $EndDate){                    $LogFile+= &quot;EventID:            &quot; + $Raw_Event.ID                      +&quot;`n&quot;                    $LogFile+= &quot;Target User Name:   &quot; + $Event.TargetUserName                +&quot;`n&quot;                    $LogFile+= &quot;Target Domain Name: &quot; + $Event.TargetDomainName              +&quot;`n&quot;                    $LogFile+= &quot;Status:             &quot; + $Event.Status                        +&quot;`n&quot;                    $LogFile+= &quot;TimeGenerated:      &quot; + $Event.TimeCreated                   +&quot;`n&quot;                    $LogFile+= &quot;Workstation Name:   &quot; + $Event.WorkstationName               +&quot;`n&quot;                    $LogFile+= &quot;IpAddress:          &quot; + $Event.IpAddress                     +&quot;`n&quot;                    $LogFile+= &quot;Computer:           &quot; + [xml]$Raw_Event.ToXML().Event.System.Computer                     +&quot;`n&quot;                    $Reason = DefineReason -Id $Raw_Event.ID                    $AccessM = DefineReasonByAccessMask -AccessMask $Event.Status                      $LogFile+= &quot;Reason(RU):         &quot; + $Reason  + &quot; &quot;+  $AccessM            +&quot;`n&quot;                    $LogFile+= &quot;Reason(SYS):        &quot; + $Event.Message                      +&quot;`n&quot;                    $LogFile+= &quot;----------------------------------------------------------------`n&quot;               }             }          }      } <\/code><\/pre>\n<p>  4. \u041f\u043e\u0438\u0441\u043a \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c, \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c, \u0437\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0434\u0430\u0442\u0443:<\/p>\n<pre><code class=\"bash\">if ($FindServerMode -eq &quot;*&quot; -and $DateEventsmode -notmatch &quot;-&quot;  -and $DateEventsmode -ne &quot;*&quot; -and $TypeEventsMode -eq &quot;*&quot; -and $Log_Path -ne &quot;&quot;){ Write-host &quot;\u0432\u043e\u0448\u043b\u0438 \u0432 5&quot;     $ALL_LOGS = Get-ChildItem -Path $Log_Path -Recurse| Where {$_.Extension -eq &quot;.evtx&quot; -and $StartDate1 -ne &quot;null&quot; } | Sort LastWriteTime     $ALL_LOGS     foreach ($Log in $ALL_LOGS){        $LogFile = &quot;Audit EventLog Security&quot; +&quot;`n&quot;        ($Log).FullName        $Log.LastWriteTime        $StartDate        $EndDate        $MyFilter = @{Path=($Log).FullName}        Try {$Events = Get-WinEvent -FilterHashTable $MyFilter} Catch {&quot;No events were found in $Log&quot;; Continue}        ForEach ($Raw_Event in $Events){\t            Try{$EventXML = [xml]$Raw_Event.ToXML()} Catch {Write-Host &quot;Unable to convert an event to XML&quot;}        $Event = @{}        ForEach ($object in $EventXML.Event.EventData.Data) {           $Event.Add($object.name,$object.'#text')        }         $Event.Add(&quot;ID&quot;,$Raw_Event.ID)        $Event.Add(&quot;TimeCreated&quot;,$Raw_Event.TimeCreated)         if ($Event.TimeCreated.Day -eq $StartDate1.Day -and $Event.TimeCreated.Month -eq $StartDate1.Month -and $Event.TimeCreated.Year -eq $StartDate1.Year){             $LogFile+= &quot;EventID:            &quot; + $Raw_Event.ID                      +&quot;`n&quot;             $LogFile+= &quot;Target User Name:   &quot; + $Event.TargetUserName                +&quot;`n&quot;             $LogFile+= &quot;Target Domain Name: &quot; + $Event.TargetDomainName              +&quot;`n&quot;             $LogFile+= &quot;Status:             &quot; + $Event.Status                        +&quot;`n&quot;             $LogFile+= &quot;TimeGenerated:      &quot; + $Event.TimeCreated                   +&quot;`n&quot;             $LogFile+= &quot;Workstation Name:   &quot; + $Event.WorkstationName               +&quot;`n&quot;             $LogFile+= &quot;IpAddress:          &quot; + $Event.IpAddress                     +&quot;`n&quot;             $LogFile+= &quot;Computer:           &quot; + [xml]$Raw_Event.ToXML().Event.System.Computer                      +&quot;`n&quot;             $Reason = DefineReason -Id $Raw_Event.ID             $AccessM = DefineReasonByAccessMask -AccessMask $Event.Status               $LogFile+= &quot;Reason(RU):         &quot; + $Reason  + &quot; &quot;+  $AccessM            +&quot;`n&quot;             $LogFile+= &quot;Reason(SYS):        &quot; + $Event.Message                      +&quot;`n&quot;             $LogFile+= &quot;----------------------------------------------------------------`n&quot;         }      }    } } <\/code><\/pre>\n<p>  5. \u041f\u043e\u0438\u0441\u043a \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c, \u043f\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0437\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u0435\u0440\u0438\u043e\u0434:<\/p>\n<pre><code class=\"bash\">if ($FindServerMode -eq &quot;*&quot;  -and $DateEventsmode -match &quot;-&quot; -and $DateEventsmode -ne &quot;*&quot; -and $TypeEventsMode -ne &quot;*&quot; -and $Log_Path -ne &quot;&quot;){ Write-host &quot;\u0432\u043e\u0448\u043b\u0438 \u0432 4&quot;      $ALL_LOGS = Get-ChildItem -Path $Log_Path -Recurse| Where {$_.Extension -eq &quot;.evtx&quot; -and $StartDate1 -ne &quot;&quot;} | Sort LastWriteTime      $ALL_LOGS      foreach ($Log in $ALL_LOGS){         $LogFile = &quot;Audit EventLog Security&quot; +&quot;`n&quot;         ($Log).FullName         $Log.LastWriteTime         $StartDate         $EndDate         $MyFilter = @{Path=($Log).FullName;ID=$TypeEventsMode}         Try {$Events = Get-WinEvent -FilterHashTable $MyFilter} Catch {&quot;No events were found in $Log&quot;; Continue}         ForEach ($Raw_Event in $Events){\t             Try{$EventXML = [xml]$Raw_Event.ToXML()} Catch {Write-Host &quot;Unable to convert an event to XML&quot;}         $Event = @{}         ForEach ($object in $EventXML.Event.EventData.Data) {            $Event.Add($object.name,$object.'#text')         }          $Event.Add(&quot;ID&quot;,$Raw_Event.ID)         $Event.Add(&quot;TimeCreated&quot;,$Raw_Event.TimeCreated)          if ($Event.TimeCreated.Day -eq $StartDate1.Day -and $Event.TimeCreated.Month -eq $StartDate1.Month -and $Event.TimeCreated.Year -eq $StartDate1.Year){             $LogFile+= &quot;EventID:            &quot; + $Raw_Event.ID                      +&quot;`n&quot;             $LogFile+= &quot;Target User Name:   &quot; + $Event.TargetUserName                +&quot;`n&quot;             $LogFile+= &quot;Target Domain Name: &quot; + $Event.TargetDomainName              +&quot;`n&quot;             $LogFile+= &quot;Status:             &quot; + $Event.Status                        +&quot;`n&quot;             $LogFile+= &quot;TimeGenerated:      &quot; + $Event.TimeCreated                   +&quot;`n&quot;             $LogFile+= &quot;Workstation Name:   &quot; + $Event.WorkstationName               +&quot;`n&quot;             $LogFile+= &quot;IpAddress:          &quot; + $Event.IpAddress                     +&quot;`n&quot;             $LogFile+= &quot;Computer:           &quot; + [xml]$Raw_Event.ToXML().Event.System.Computer                      +&quot;`n&quot;             $Reason = DefineReason -Id $Raw_Event.ID             $AccessM = DefineReasonByAccessMask -AccessMask $Event.Status               $LogFile+= &quot;Reason(RU):         &quot; + $Reason  + &quot; &quot;+  $AccessM            +&quot;`n&quot;             $LogFile+= &quot;Reason(SYS):        &quot; + $Event.Message                      +&quot;`n&quot;             $LogFile+= &quot;----------------------------------------------------------------`n&quot;          }        }   }               }              <\/code><\/pre>\n<p>  6. \u041f\u043e\u0438\u0441\u043a \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c, \u043f\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0437\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0434\u0430\u0442\u0443:<\/p>\n<pre><code class=\"bash\">if ($FindServerMode -eq &quot;*&quot; -and $TypeEventsMode -ne &quot;*&quot; -and $DateEventsmode -notmatch &quot;-&quot;  -and $DateEventsmode -ne &quot;*&quot; -and $Log_Path -ne &quot;&quot;) { Write-host &quot;\u0432\u043e\u0448\u043b\u0438 \u0432 6&quot;     $ALL_LOGS = Get-ChildItem -Path $Log_Path -Recurse| Where {$_.Extension -eq &quot;.evtx&quot; -and $StartDate1 -ne &quot;&quot; } | Sort LastWriteTime     $ALL_LOGS     foreach ($Log in $ALL_LOGS){        $LogFile = &quot;Audit EventLog Security&quot; +&quot;`n&quot;        ($Log).FullName        $Log.LastWriteTime        $StartDate        $EndDate        $MyFilter = @{Path=($Log).FullName;ID=$TypeEventsMode}        Try {$Events = Get-WinEvent -FilterHashTable $MyFilter} Catch {&quot;No events were found in $Log&quot;; Continue}        ForEach ($Raw_Event in $Events){\t               Try{$EventXML = [xml]$Raw_Event.ToXML()} Catch {Write-Host &quot;Unable to convert an event to XML&quot;}           $Event = @{}           ForEach ($object in $EventXML.Event.EventData.Data) {              $Event.Add($object.name,$object.'#text')           }            $Event.Add(&quot;ID&quot;,$Raw_Event.ID)           $Event.Add(&quot;TimeCreated&quot;,$Raw_Event.TimeCreated)            if ($Event.TimeCreated.Day -eq $StartDate1.Day -and $Event.TimeCreated.Month -eq $StartDate1.Month -and $Event.TimeCreated.Year -eq $StartDate1.Year){               $LogFile+= &quot;EventID:            &quot; + $Raw_Event.ID                      +&quot;`n&quot;               $LogFile+= &quot;Target User Name:   &quot; + $Event.TargetUserName                +&quot;`n&quot;               $LogFile+= &quot;Target Domain Name: &quot; + $Event.TargetDomainName              +&quot;`n&quot;               $LogFile+= &quot;Status:             &quot; + $Event.Status                        +&quot;`n&quot;               $LogFile+= &quot;TimeGenerated:      &quot; + $Event.TimeCreated                   +&quot;`n&quot;               $LogFile+= &quot;Workstation Name:   &quot; + $Event.WorkstationName               +&quot;`n&quot;               $LogFile+= &quot;IpAddress:          &quot; + $Event.IpAddress                     +&quot;`n&quot;               $LogFile+= &quot;Computer:           &quot; + [xml]$Raw_Event.ToXML().Event.System.Computer                      +&quot;`n&quot;               $Reason = DefineReason -Id $Raw_Event.ID               $AccessM = DefineReasonByAccessMask -AccessMask $Event.Status                 $LogFile+= &quot;Reason(RU):         &quot; + $Reason  + &quot; &quot;+  $AccessM            +&quot;`n&quot;               $LogFile+= &quot;Reason(SYS):        &quot; + $Event.Message                      +&quot;`n&quot;               $LogFile+= &quot;----------------------------------------------------------------`n&quot;            }        }       }               } <\/code><\/pre>\n<p>  7. \u041f\u043e\u0438\u0441\u043a \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c, \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c, \u0437\u0430 \u0432\u0435\u0441\u044c \u043f\u0435\u0440\u0438\u043e\u0434:<\/p>\n<pre><code class=\"bash\">if ($FindServerMode -ne &quot;*&quot; -and $DateEventsmode -eq &quot;*&quot; -and $TypeEventsMode -eq &quot;*&quot; -and $Log_Path -ne &quot;&quot;){ Write-host &quot;\u0432\u043e\u0448\u043b\u0438 \u0432 7&quot;     $ALL_LOGS = Get-ChildItem -Path $Log_Path -Recurse| Where {$_.Extension -eq &quot;.evtx&quot; -and $_.FullName -match $FindServerMode} | Sort LastWriteTime     $ALL_LOGS     foreach ($Log in $ALL_LOGS){        $LogFile = &quot;Audit EventLog Security&quot; +&quot;`n&quot;        ($Log).FullName        $MyFilter = @{Path=($Log).FullName}        Try {$Events = Get-WinEvent -FilterHashTable $MyFilter} Catch {&quot;No events were found in $Log&quot;; Continue}        ForEach ($Raw_Event in $Events){\t               Try{$EventXML = [xml]$Raw_Event.ToXML()} Catch {Write-Host &quot;Unable to convert an event to XML&quot;}           $Event = @{}           ForEach ($object in $EventXML.Event.EventData.Data) {              $Event.Add($object.name,$object.'#text')           }            $Event.Add(&quot;ID&quot;,$Raw_Event.ID)           $Event.Add(&quot;TimeCreated&quot;,$Raw_Event.TimeCreated)            $LogFile+= &quot;EventID:            &quot; + $Raw_Event.ID                      +&quot;`n&quot;           $LogFile+= &quot;Target User Name:   &quot; + $Event.TargetUserName                +&quot;`n&quot;           $LogFile+= &quot;Target Domain Name: &quot; + $Event.TargetDomainName              +&quot;`n&quot;           $LogFile+= &quot;Status:             &quot; + $Event.Status                        +&quot;`n&quot;           $LogFile+= &quot;TimeGenerated:      &quot; + $Event.TimeCreated                   +&quot;`n&quot;           $LogFile+= &quot;Workstation Name:   &quot; + $Event.WorkstationName               +&quot;`n&quot;           $LogFile+= &quot;IpAddress:          &quot; + $Event.IpAddress                     +&quot;`n&quot;           $LogFile+= &quot;Computer:           &quot; + [xml]$Raw_Event.ToXML().Event.System.Computer                      +&quot;`n&quot;           $Reason = DefineReason -Id $Raw_Event.ID           $AccessM = DefineReasonByAccessMask -AccessMask $Event.Status             $LogFile+= &quot;Reason(RU):         &quot; + $Reason  + &quot; &quot;+  $AccessM            +&quot;`n&quot;           $LogFile+= &quot;Reason(SYS):        &quot; + $Event.Message                      +&quot;`n&quot;           $LogFile+= &quot;----------------------------------------------------------------`n&quot;         }     }           } <\/code><\/pre>\n<p>  8. \u041f\u043e\u0438\u0441\u043a \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u043f\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0437\u0430 \u0432\u0435\u0441\u044c \u043f\u0435\u0440\u0438\u043e\u0434:<\/p>\n<pre><code class=\"bash\">if ($FindServerMode -ne &quot;*&quot; -and $DateEventsmode -eq &quot;*&quot; -and $TypeEventsMode -ne &quot;*&quot; -and $Log_Path -ne &quot;&quot;){      Write-host &quot;\u0432\u043e\u0448\u043b\u0438 \u0432 8&quot;      $ALL_LOGS = Get-ChildItem -Path $Log_Path -Recurse| Where {$_.Extension -eq &quot;.evtx&quot; -and $_.FullName -match $FindServerMode} | Sort LastWriteTime            $ALL_LOGS      foreach ($Log in $ALL_LOGS){      $LogFile = &quot;Audit EventLog Security&quot; +&quot;`n&quot;      ($Log).FullName      $MyFilter = @{Path=($Log).FullName;ID=$TypeEventsMode}      Try {$Events = Get-WinEvent -FilterHashTable $MyFilter} Catch {&quot;No events were found in $Log&quot;; Continue}      ForEach ($Raw_Event in $Events){\t             Try{$EventXML = [xml]$Raw_Event.ToXML()} Catch {Write-Host &quot;Unable to convert an event to XML&quot;}         $Event = @{}         ForEach ($object in $EventXML.Event.EventData.Data) {            $Event.Add($object.name,$object.'#text')         }          $Event.Add(&quot;ID&quot;,$Raw_Event.ID)         $Event.Add(&quot;TimeCreated&quot;,$Raw_Event.TimeCreated)          $LogFile+= &quot;EventID:            &quot; + $Event.ID                       +&quot;`n&quot;         $LogFile+= &quot;Target User Name:   &quot; + $Event.TargetUserName                +&quot;`n&quot;         $LogFile+= &quot;Target Domain Name: &quot; + $Event.TargetDomainName              +&quot;`n&quot;         $LogFile+= &quot;Status:             &quot; + $Event.Status                        +&quot;`n&quot;         $LogFile+= &quot;TimeGenerated:      &quot; + $Event.TimeCreated                   +&quot;`n&quot;         $LogFile+= &quot;Workstation Name:   &quot; + $Event.WorkstationName               +&quot;`n&quot;         $LogFile+= &quot;IpAddress:          &quot; + $Event.IpAddress                     +&quot;`n&quot;         $LogFile+= &quot;Computer:           &quot; + [xml]$Raw_Event.ToXML().Event.System.Computer                      +&quot;`n&quot;         $Reason = DefineReason -Id $Raw_Event.ID         $AccessM = DefineReasonByAccessMask -AccessMask $Event.Status           $LogFile+= &quot;Reason(RU):         &quot; + $Reason  + &quot; &quot;+  $AccessM            +&quot;`n&quot;         $LogFile+= &quot;Reason(SYS):        &quot; + $Event.Message                      +&quot;`n&quot;         $LogFile+= &quot;----------------------------------------------------------------`n&quot;      }        } } <\/code><\/pre>\n<p>  9. \u041f\u043e\u0438\u0441\u043a \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c, \u0437\u0430 \u043f\u0435\u0440\u0438\u043e\u0434:<\/p>\n<pre><code class=\"bash\">if ($FindServerMode -ne &quot;*&quot;-and $DateEventsmode -match &quot;-&quot; -and $TypeEventsMode -eq &quot;*&quot; -and $Log_Path -ne &quot;&quot;){ Write-host &quot;\u0432\u043e\u0448\u043b\u0438 \u0432 9&quot;     $ALL_LOGS = Get-ChildItem -Path $Log_Path -Recurse| Where {$_.Extension -eq &quot;.evtx&quot; -and $_.FullName -match $FindServerMode -and $StartDate -ne &quot;null&quot; -and $EndDate -ne &quot;null&quot;} | Sort LastWriteTime     $ALL_LOGS     foreach ($Log in $ALL_LOGS){        $LogFile = &quot;Audit EventLog Security&quot; +&quot;`n&quot;        ($Log).FullName        $Log.LastWriteTime        $StartDate        $EndDate        $MyFilter = @{Path=($Log).FullName}        Try {$Events = Get-WinEvent -FilterHashTable $MyFilter} Catch {&quot;No events were found in $Log&quot;; Continue}        ForEach ($Raw_Event in $Events){\t               Try{$EventXML = [xml]$Raw_Event.ToXML()} Catch {Write-Host &quot;Unable to convert an event to XML&quot;}           $Event = @{}           ForEach ($object in $EventXML.Event.EventData.Data) {              $Event.Add($object.name,$object.'#text')           }            $Event.Add(&quot;ID&quot;,$Raw_Event.ID)           $Event.Add(&quot;TimeCreated&quot;,$Raw_Event.TimeCreated)            if ($Event.TimeCreated -gt $StartDate -and $Event.TimeCreated -lt $EndDate){               $LogFile+= &quot;EventID:            &quot; + $Raw_Event.ID                      +&quot;`n&quot;               $LogFile+= &quot;Target User Name:   &quot; + $Event.TargetUserName                +&quot;`n&quot;               $LogFile+= &quot;Target Domain Name: &quot; + $Event.TargetDomainName              +&quot;`n&quot;               $LogFile+= &quot;Status:             &quot; + $Event.Status                        +&quot;`n&quot;               $LogFile+= &quot;TimeGenerated:      &quot; + $Event.TimeCreated                   +&quot;`n&quot;               $LogFile+= &quot;Workstation Name:   &quot; + $Event.WorkstationName               +&quot;`n&quot;               $LogFile+= &quot;IpAddress:          &quot; + $Event.IpAddress                     +&quot;`n&quot;               $LogFile+= &quot;Computer:           &quot; + [xml]$Raw_Event.ToXML().Event.System.Computer                      +&quot;`n&quot;               $Reason = DefineReason -Id $Raw_Event.ID               $AccessM = DefineReasonByAccessMask -AccessMask $Event.Status                 $LogFile+= &quot;Reason(RU):         &quot; + $Reason  + &quot; &quot;+  $AccessM            +&quot;`n&quot;               $LogFile+= &quot;Reason(SYS):        &quot; + $Event.Message                      +&quot;`n&quot;               $LogFile+= &quot;----------------------------------------------------------------`n&quot;            }         }     } } <\/code><\/pre>\n<p>  10. \u041f\u043e\u0438\u0441\u043a \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u043f\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0437\u0430 \u043f\u0435\u0440\u0438\u043e\u0434:<\/p>\n<pre><code class=\"bash\">if ($FindServerMode -ne &quot;*&quot;  -and $DateEventsmode -match &quot;-&quot; -and $DateEventsmode -ne &quot;*&quot; -and $TypeEventsMode -ne &quot;*&quot; -and $Log_Path -ne &quot;&quot;){ Write-host &quot;\u0432\u043e\u0448\u043b\u0438 \u0432 10&quot;     $ALL_LOGS = Get-ChildItem -Path $Log_Path | Where {$_.Extension -eq &quot;.evtx&quot; -and  $_.FullName -match $FindServerMode -and $StartDate -ne &quot;null&quot; -and $EndDate -ne &quot;null&quot;} | Sort LastWriteTime     $ALL_LOGS     foreach ($Log in $ALL_LOGS){        $LogFile = &quot;Audit EventLog Security&quot; +&quot;`n&quot;        ($Log).FullName        $Log.LastWriteTime        $StartDate        $EndDate        $MyFilter = @{Path=($Log).FullName;ID=$TypeEventsMode}        Try {$Events = Get-WinEvent -FilterHashTable $MyFilter} Catch {&quot;No events were found in $Log&quot;; Continue}        ForEach ($Raw_Event in $Events){\t               Try{$EventXML = [xml]$Raw_Event.ToXML()} Catch {Write-Host &quot;Unable to convert an event to XML&quot;}           $Event = @{}           ForEach ($object in $EventXML.Event.EventData.Data) {              $Event.Add($object.name,$object.'#text')           }            $Event.Add(&quot;ID&quot;,$Raw_Event.ID)           $Event.Add(&quot;TimeCreated&quot;,$Raw_Event.TimeCreated)                                    if ($Event.TimeCreated -gt $StartDate -and $Event.TimeCreated -lt $EndDate){                $LogFile+= &quot;EventID:            &quot; + $Raw_Event.ID                      +&quot;`n&quot;                $LogFile+= &quot;Target User Name:   &quot; + $Event.TargetUserName                +&quot;`n&quot;                $LogFile+= &quot;Target Domain Name: &quot; + $Event.TargetDomainName              +&quot;`n&quot;                $LogFile+= &quot;Status:             &quot; + $Event.Status                        +&quot;`n&quot;                $LogFile+= &quot;TimeGenerated:      &quot; + $Event.TimeCreated                   +&quot;`n&quot;                $LogFile+= &quot;Workstation Name:   &quot; + $Event.WorkstationName               +&quot;`n&quot;                $LogFile+= &quot;IpAddress:          &quot; + $Event.IpAddress                     +&quot;`n&quot;                $LogFile+= &quot;Computer:           &quot; + [xml]$Raw_Event.ToXML().Event.System.Computer                      +&quot;`n&quot;                $Reason = DefineReason -Id $Raw_Event.ID                $AccessM = DefineReasonByAccessMask -AccessMask $Event.Status                  $LogFile+= &quot;Reason(RU):         &quot; + $Reason  + &quot; &quot;+  $AccessM            +&quot;`n&quot;                $LogFile+= &quot;Reason(SYS):        &quot; + $Event.Message                      +&quot;`n&quot;                $LogFile+= &quot;----------------------------------------------------------------`n&quot;            }         }      }  } <\/code><\/pre>\n<p>  11. \u041f\u043e\u0438\u0441\u043a \u043f\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c, \u0437\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0434\u0430\u0442\u0443:<\/p>\n<pre><code class=\"bash\">if ($FindServerMode -ne &quot;*&quot; -and $DateEventsmode -notmatch &quot;-&quot;  -and $DateEventsmode -ne &quot;*&quot; -and $TypeEventsMode -eq &quot;*&quot; -and $Log_Path -ne &quot;&quot;){  Write-host &quot;\u0432\u043e\u0448\u043b\u0438 \u0432 11&quot;       $ALL_LOGS = Get-ChildItem -Path $Log_Path -Recurse| Where {$_.Extension -eq &quot;.evtx&quot; -and $StartDate1 -ne &quot;null&quot; } | Sort LastWriteTime       $ALL_LOGS       foreach ($Log in $ALL_LOGS){          $LogFile = &quot;Audit EventLog Security&quot; +&quot;`n&quot;          ($Log).FullName          $Log.LastWriteTime          $StartDate          $EndDate          $MyFilter = @{Path=($Log).FullName}          Try {$Events = Get-WinEvent -FilterHashTable $MyFilter} Catch {&quot;No events were found in $Log&quot;; Continue}          ForEach ($Raw_Event in $Events){\t                 Try{$EventXML = [xml]$Raw_Event.ToXML()} Catch {Write-Host &quot;Unable to convert an event to XML&quot;}             $Event = @{}             ForEach ($object in $EventXML.Event.EventData.Data) {                $Event.Add($object.name,$object.'#text')             }              $Event.Add(&quot;ID&quot;,$Raw_Event.ID)             $Event.Add(&quot;TimeCreated&quot;,$Raw_Event.TimeCreated)              if ($Event.TimeCreated.Day -eq $StartDate1.Day -and $Event.TimeCreated.Month -eq $StartDate1.Month -and $Event.TimeCreated.Year -eq $StartDate1.Year){                  $LogFile+= &quot;EventID:            &quot; + $Raw_Event.ID                      +&quot;`n&quot;                  $LogFile+= &quot;Target User Name:   &quot; + $Event.TargetUserName                +&quot;`n&quot;                  $LogFile+= &quot;Target Domain Name: &quot; + $Event.TargetDomainName              +&quot;`n&quot;                  $LogFile+= &quot;Status:             &quot; + $Event.Status                        +&quot;`n&quot;                  $LogFile+= &quot;TimeGenerated:      &quot; + $Event.TimeCreated                   +&quot;`n&quot;                  $LogFile+= &quot;Workstation Name:   &quot; + $Event.WorkstationName               +&quot;`n&quot;                  $LogFile+= &quot;IpAddress:          &quot; + $Event.IpAddress                     +&quot;`n&quot;                  $LogFile+= &quot;Computer:           &quot; + [xml]$Raw_Event.ToXML().Event.System.Computer                      +&quot;`n&quot;                  $Reason = DefineReason -Id $Raw_Event.ID                  $AccessM = DefineReasonByAccessMask -AccessMask $Event.Status                    $LogFile+= &quot;Reason(RU):         &quot; + $Reason  + &quot; &quot;+  $AccessM            +&quot;`n&quot;                  $LogFile+= &quot;Reason(SYS):        &quot; + $Event.Message                      +&quot;`n&quot;                  $LogFile+= &quot;----------------------------------------------------------------`n&quot;               }             }                   }   } <\/code><\/pre>\n<p>  12. \u041f\u043e\u0438\u0441\u043a \u043f\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u043f\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0437\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0434\u0430\u0442\u0443:<\/p>\n<pre><code class=\"bash\">if ($FindServerMode -ne &quot;*&quot; -and $TypeEventsMode -ne &quot;*&quot; -and $DateEventsmode -notmatch &quot;-&quot;  -and $DateEventsmode -ne &quot;*&quot; -and $Log_Path -ne &quot;&quot;){  Write-host &quot;\u0432\u043e\u0448\u043b\u0438 \u0432 12&quot;      $ALL_LOGS = Get-ChildItem -Path $Log_Path -Recurse| Where {$_.Extension -eq &quot;.evtx&quot; -and $StartDate1 -ne &quot;null&quot; } | Sort LastWriteTime      $ALL_LOGS      foreach ($Log in $ALL_LOGS){         $LogFile = &quot;Audit EventLog Security&quot; +&quot;`n&quot;         ($Log).FullName         $Log.LastWriteTime         $StartDate         $EndDate         $MyFilter = @{Path=($Log).FullName;ID=$TypeEventsMode}         Try {$Events = Get-WinEvent -FilterHashTable $MyFilter} Catch {&quot;No events were found in $Log&quot;; Continue}         ForEach ($Raw_Event in $Events){\t                Try{$EventXML = [xml]$Raw_Event.ToXML()} Catch {Write-Host &quot;Unable to convert an event to XML&quot;}            $Event = @{}            ForEach ($object in $EventXML.Event.Message) {               $Event.Add($object.name,$object.'#text')            }             $Event.Add(&quot;ID&quot;,$Raw_Event.ID)            $Event.Add(&quot;TimeCreated&quot;,$Raw_Event.TimeCreated)            $Event            if ($Event.TimeCreated.Day -eq $StartDate1.Day -and $Event.TimeCreated.Month -eq $StartDate1.Month -and $Event.TimeCreated.Year -eq $StartDate1.Year){                 $LogFile+= &quot;EventID:            &quot; + $Raw_Event.ID                      +&quot;`n&quot;                 $LogFile+= &quot;Target User Name:   &quot; + $Event.TargetUserName                +&quot;`n&quot;                 $LogFile+= &quot;Target Domain Name: &quot; + $Event.TargetDomainName              +&quot;`n&quot;                 $LogFile+= &quot;Status:             &quot; + $Event.Status                        +&quot;`n&quot;                 $LogFile+= &quot;TimeGenerated:      &quot; + $Event.TimeCreated                   +&quot;`n&quot;                 $LogFile+= &quot;Workstation Name:   &quot; + $Event.WorkstationName               +&quot;`n&quot;                 $LogFile+= &quot;IpAddress:          &quot; + $Event.IpAddress                     +&quot;`n&quot;                 $LogFile+= &quot;Computer:           &quot; + [xml]$Raw_Event.ToXML().Event.System.Computer                      +&quot;`n&quot;                 $Reason = DefineReason -Id $Raw_Event.ID                 $AccessM = DefineReasonByAccessMask -AccessMask $Event.Status                   $LogFile+= &quot;Reason(RU):         &quot; + $Reason  + &quot; &quot;+  $AccessM            +&quot;`n&quot;                 $LogFile+= &quot;Reason(SYS):        &quot; + $Event.Message                      +&quot;`n&quot;                 $LogFile+= &quot;----------------------------------------------------------------`n&quot;            }         }       } } <\/code><\/pre>\n<p>  \u0412 \u043a\u043e\u043d\u0446\u0435 \u043c\u0435\u0441\u044f\u0446\u0430 (\u043f\u0435\u0440\u0438\u043e\u0434 \u0438\u043d\u0434\u0438\u0432\u0438\u0434\u0443\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438) \u0436\u0443\u0440\u043d\u0430\u043b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440-\u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0438\u043c\u0435\u043d\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u0434\u0430\u0442\u044b \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438. <\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u044b \u043e\u043f\u0438\u0441\u0430\u043b\u0438 \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043f\u043e\u0438\u0441\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439. \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0444\u0430\u0439\u043b, \u043f\u0443\u0442\u044c \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u043f\u043e\u043b\u0435. \u0415\u0441\u043b\u0438 \u043f\u0443\u0442\u044c \u0437\u0430\u0434\u0430\u043d, \u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b. \u041f\u043e\u0441\u043b\u0435 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0444\u0430\u0439\u043b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f. \u0415\u0441\u043b\u0438 \u043f\u0443\u0442\u044c \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043d\u0435 \u0437\u0430\u0434\u0430\u043d, \u0442\u043e \u043b\u043e\u0433 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d \u0432 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u043f\u043e\u0434 \u0438\u043c\u0435\u043d\u0435\u043c \u00ablog.log\u00bb.<\/p>\n<pre><code class=\"bash\">if ($SaveResult -ne &quot;&quot;){    $LogFile | Out-File $SaveResult -Encoding utf8    Invoke-Item  $SaveResult    $Event2= @{}    $Event = @{}    $Log_Path=&quot;&quot;  } else{    $LogFile | Out-File &quot;.\\log.log&quot; -Encoding utf8    Write-Host $LogFile    $Event2= @{}    $Event = @{}    $Log_Path=&quot;&quot; } <\/code><\/pre>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. <\/p>\n<p>  \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0441\u0442\u0430\u0442\u044c\u044f &quot;<a href=\"http:\/\/habrahabr.ru\/post\/118644\/\">PowerShell \u0438 \u0430\u0443\u0434\u0438\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438<\/a>&quot;, \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0430\u0432\u0442\u043e\u0440\u0443.       <\/p>\n<div class=\"clear\"><\/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=\"http:\/\/habrahabr.ru\/post\/271963\/\"> http:\/\/habrahabr.ru\/post\/271963\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0410\u0443\u0434\u0438\u0442 \u0436\u0443\u0440\u043d\u0430\u043b\u0430 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u043c\u043e\u0433 \u043c\u043e\u0435\u043c\u0443 \u043a\u043e\u043b\u043b\u0435\u0433\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043b\u044e\u0431\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 \u0445\u043e\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c \u0438\u043b\u0438 ActiveDirectory. <\/p>\n<p>  \u0412 \u0442\u043e\u043f\u0438\u043a\u0435 \u0431\u0443\u0434\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0431\u0443\u0434\u0435\u0442 \u0432\u0430\u043c \u043f\u043e\u043b\u0435\u0437\u0435\u043d. <\/p>\n<p>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c. \u0427\u0442\u043e\u0431\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u0435\u043a\u0441\u0442\u0430, \u044f \u0441\u043e\u0437\u0434\u0430\u043b\u0430 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e ID \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432\u044b\u0434\u0430\u0435\u0442 \u0435\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435:  <\/p>\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-269296","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/269296","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=269296"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/269296\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=269296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=269296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=269296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}