This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#requires -version 4 | |
cls | |
ipmo VirtualMachineManager | |
get-scvirtualmachine | % { | |
[String] $vm = $_.Name | |
($_.VirtualNetworkAdapters).Where({$_.MACAddressType -eq 'Dynamic'},'First') | % { | |
Write-Host $vm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cls | |
import-module dism | |
(Get-WindowsOptionalFeature -Online).where{'$_.State -eq Disabled'} | % { | |
$fn = $_.FeatureName | |
Write-Host $fn | |
Disable-WindowsOptionalFeature -Online -FeatureName $fn -Remove | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cls | |
ipmo ActiveDirectory | |
Get-ADUser -Filter { Title -like "*Руководитель*" } | % { | |
$_.Name | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#requires -version 4 | |
cls | |
[System.Reflection.Assembly]::LoadWithPartialName('MySql.Data') | Out-Null | |
$Connection = New-Object MySql.Data.MySqlClient.MySqlConnection | |
$Connection.ConnectionString = 'server=nnn;port=3306;uid=nnn;pwd=nnn;database=nnn' | |
$Connection.Open() | |
$Command = New-Object MySql.Data.MySqlClient.MySqlCommand | |
$Command.Connection = $Connection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cls | |
import-module ActiveDirectory | |
$users = ('n.bokova', 'musenkonn', 'nitfa', 'kalashnikovav', 'chalov', 'install', 'avpetrov', 'pifagorsoft', 'nit2', 'giacint', 'fpike0', 'trio', 'safonovr', 'dmitry1', 'alexa79', 'vasilev', 'silkhab', 'vika07', 'lvs-kontur', 'intercom', 'integ', 'chureev', 'zaichenko', 'stepan', 'serg_73', 'pvk', 'p_denis', 'ilin', 'sorokona','smart5','mikhach','barnaul1', 'stolyarov', 'n.o.abramova','nigmatullin','natalia85','kuzmini','hakimova','baturina','avks309' ) | |
$users | % { | |
[String] $user = $_ | |
(Get-ADPrincipalGroupMembership $user) | % { | |
if($_.name -eq 'allm1'){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#requires -Version 4.0 | |
#requires -Modules ActiveDirectory | |
ipmo ActiveDirectory | |
cls | |
$queue = [System.Collections.Queue]::Synchronized( (New-Object System.Collections.Queue) ) | |
[array]$Report = @() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#requires -version 4.0 | |
cls | |
[System.Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem') | Out-Null | |
$SourcePattern = '\\ul-fs\logs\*cas*.zip' | |
$CurrentDir = [System.IO.Path]::GetDirectoryName($myInvocation.MyCommand.Definition) | |
$ProgDir = (${env:ProgramFiles(x86)}, ${env:ProgramFiles} -ne $null)[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST https://auth.kontur.ru/Handlers/CsApiProxy.ashx?r=certificates/status/ HTTP/1.1 | |
Accept: application/json, text/javascript, */*; q=0.01 | |
Content-Type: application/x-www-form-urlencoded; charset=UTF-8 | |
X-Requested-With: XMLHttpRequest | |
Referer: https://auth.kontur.ru/?authmode=certlogin&back=https%3a%2f%2fsetter.kontur.ru%2fpolitesetexternsession.aspx%3ffrom_keweb%3dextern.kontur.ru%252f | |
Accept-Language: en-us | |
Accept-Encoding: gzip, deflate | |
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko | |
Host: auth.kontur.ru | |
Content-Length: 103 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#requires -Modules ActiveDirectory | |
ipmo ActiveDirectory | |
cls | |
$d = (Get-date).AddDays(-30) | |
$c = Get-ADComputer -Filter { (Enabled -eq $true) -and (PasswordLastSet -ge $d) -and (OperatingSystem -notlike "*Server*")} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#requires -Modules ActiveDirectory | |
ipmo ActiveDirectory | |
cls | |
$CurrentDir = [System.IO.Path]::GetDirectoryName($myInvocation.MyCommand.Definition) | |
$processedFile = (Join-Path $CurrentDir 'processed.txt') | |
$processedCSV = (Join-Path $CurrentDir 'processed.csv') |
OlderNewer