Пользователь пока ничего не рассказал о себе

Наибольший вклад в теги

Все теги (15)

Лучшие ответы пользователя

Все ответы (47)
  • Как запустить BAT файл с помощью Powershell на удалённом компьютере?

    invoke-command -computername comp1 {cmd /c C:\temp.bat}
    Ответ написан
    Комментировать
  • Как сделать домен только для авторизации пользователей?

    A read-only domain controller (RODC) is a new type of domain controller in the Windows Server® 2008 operating system. With an RODC, organizations can easily deploy a domain controller in locations where physical security cannot be guaranteed. An RODC hosts read-only partitions of the Active Directory® Domain Services (AD DS) database.
    Ответ написан
    Комментировать
  • Телеметрия Windows Server 2016. Как сменить тип запуска или выключить?

    Имена меняются в зависимости от пользователя.
    Я решил с помощью Powershell DSC, сохранить как Hardening.ps1 и запустить:

    Configuration Hardening{
    	Node localhost {
    		Script CDPUserSvc {
    			GetScript  = {
    				$Service = Get-Service -Name "CDPUserSvc*"
    				return @{ result = "$( $Service.Name) $( $Service.Status )" }
    			}
    			TestScript = {
    				$Service = Get-Service -Name "CDPUserSvc*"
    				if ( $Service -and ( $Service.StartType -ne 'Disabled' )) {
    					Write-Verbose "Service $( $Service.Name ) is NOT in disable state."
    					return $false
    				} else {
    					Write-Verbose "Service $( $Service.Name ) is in disable state."
    					return $true
    				}
    			}
    			SetScript  = {
    				$Service = Get-Service -Name "CDPUserSvc*"
    				Write-Verbose "Applying settings to service $( $Service.Name )."
    				Stop-Service -Name $Service.Name
    				Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\CDPUserSvc -Name Start -Value 4 -Type DWord
    			}
    		}
    		Script OneSyncSvc {
    			GetScript  = {
    				$Service = Get-Service -Name "OneSyncSvc*"
    				return @{ result = "$( $Service.Name) $( $Service.Status )" }
    			}
    			TestScript = {
    				$Service = Get-Service -Name "OneSyncSvc*"
    				if ( $Service -and ( $Service.StartType -ne 'Disabled' )) {
    					Write-Verbose "Service $( $Service.Name ) is NOT in disable state."
    					return $false
    				} else {
    					Write-Verbose "Service $( $Service.Name ) is in disable state."
    					return $true
    				}
    			}
    			SetScript  = {
    				$Service = Get-Service -Name "OneSyncSvc*"
    				Write-Verbose "Applying settings to service $( $Service.Name )."
    				Stop-Service -Name $Service.Name
    				Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\OneSyncSvc -Name Start -Value 4 -Type DWord
    			}
    		}
    		Script PimIndexMaintenanceSvc {
    			GetScript  = {
    				$Service = Get-Service -Name "PimIndexMaintenanceSvc*"
    				return @{ result = "$( $Service.Name) $( $Service.Status )" }
    			}
    			TestScript = {
    				$Service = Get-Service -Name "PimIndexMaintenanceSvc*"
    				if ( $Service -and ( $Service.StartType -ne 'Disabled' )) {
    					Write-Verbose "Service $( $Service.Name ) is NOT in disable state."
    					return $false
    				} else {
    					Write-Verbose "Service $( $Service.Name ) is in disable state."
    					return $true
    				}
    			}
    			SetScript  = {
    				$Service = Get-Service -Name "PimIndexMaintenanceSvc*"
    				Write-Verbose "Applying settings to service $( $Service.Name )."
    				Stop-Service -Name $Service.Name
    				Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\PimIndexMaintenanceSvc -Name Start -Value 4 -Type DWord
    			}
    		}
    		Script UserDataSvc {
    			GetScript  = {
    				$Service = Get-Service -Name "UserDataSvc*"
    				return @{ result = "$( $Service.Name) $( $Service.Status )" }
    			}
    			TestScript = {
    				$Service = Get-Service -Name "UserDataSvc*"
    				if ( $Service -and ( $Service.StartType -ne 'Disabled' )) {
    					Write-Verbose "Service $( $Service.Name ) is NOT in disable state."
    					return $false
    				} else {
    					Write-Verbose "Service $( $Service.Name ) is in disable state."
    					return $true
    				}
    			}
    			SetScript  = {
    				$Service = Get-Service -Name "UserDataSvc*"
    				Write-Verbose "Applying settings to service $( $Service.Name )."
    				Stop-Service -Name $Service.Name
    				Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\UserDataSvc -Name Start -Value 4 -Type DWord
    			}
    		}
    		Script UnistoreSvc {
    			GetScript  = {
    				$Service = Get-Service -Name "UnistoreSvc*"
    				return @{ result = "$( $Service.Name) $( $Service.Status )" }
    			}
    			TestScript = {
    				$Service = Get-Service -Name "UnistoreSvc*"
    				if ( $Service -and ( $Service.StartType -ne 'Disabled' )) {
    					Write-Verbose "Service $( $Service.Name ) is NOT in disable state."
    					return $false
    				} else {
    					Write-Verbose "Service $( $Service.Name ) is in disable state."
    					return $true
    				}
    			}
    			SetScript  = {
    				$Service = Get-Service -Name "UnistoreSvc*"
    				Write-Verbose "Applying settings to service $( $Service.Name )."
    				Stop-Service -Name $Service.Name
    				Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\UnistoreSvc -Name Start -Value 4 -Type DWord
    			}
    		}
    		Script WpnUserService {
    			GetScript  = {
    				$Service = Get-Service -Name "WpnUserService*"
    				return @{ result = "$( $Service.Name) $( $Service.Status )" }
    			}
    			TestScript = {
    				$Service = Get-Service -Name "WpnUserService*"
    				if ( $Service -and ( $Service.StartType -ne 'Disabled' )) {
    					Write-Verbose "Service $( $Service.Name ) is NOT in disable state."
    					return $false
    				} else {
    					Write-Verbose "Service $( $Service.Name ) is in disable state."
    					return $true
    				}
    			}
    			SetScript  = {
    				$Service = Get-Service -Name "WpnUserService*"
    				Write-Verbose "Applying settings to service $( $Service.Name )."
    				Stop-Service -Name $Service.Name
    				Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\WpnUserService -Name Start -Value 4 -Type DWord
    			}
    		}
    	}
    }
    Push-Location $PSScriptRoot
    Enable-PSRemoting -Force -Confirm:$false
    . $PSScriptRoot\Hardening.ps1
    Hardening
    Start-DscConfiguration -Path $PSScriptRoot\Hardening -Verbose -Wait -Force
    Ответ написан
    3 комментария
  • Как добавить в массив строку два и более столбца?

    $result = @{}
    $result.first = 'ololo'
    $result.second = 'nlo'
    $result.first += ' ololo'
    Ответ написан
    3 комментария
  • Как убрать лишние превью вкладок firefox в меню пуск windows?

    Настройки - Основные - Отображать эскизы вкладок на панели задач Windows
    Ответ написан
    2 комментария

Лучшие вопросы пользователя

Все вопросы (1)