Advertisement
mesmariusz

hideuser

Dec 9th, 2020
956
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $LogPath = "c:\log.txt"
  2. if (!(Test-Path $LogPath -PathType Container)) {
  3.     New-Item -ItemType Directory -Force -Path $LogPath
  4. }
  5.  
  6. $test = test-path -path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts"
  7. if(-not($test)){
  8.     New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name SpecialAccounts
  9. }
  10.  
  11. $test = test-path -path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList"
  12. if(-not($test)){
  13.     New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts" -Name UserList
  14. }
  15.  
  16. $test = test-path -path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList"
  17. if(-not($test)){
  18.     New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" -Name "jakisuser" -Value "0" -PropertyType DWORD -Force
  19. }
  20.  
  21. Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" -Name "jakisuser" -Type "Dword" -Value "0"
  22.  
  23. echo "$(Get-Date -Format {yyyy-MM-dd_HH:mm:ss}) Ukryto uzytkownika jakisuser..."
  24. echo "$(Get-Date -Format {yyyy-MM-dd_HH:mm:ss}) Ukryto uzytkownika jakisuser..." >> "$LogPath$(Get-Date -Format {yyyy-MM-dd})_log.txt"
  25.  
  26. #Write-Host -NoNewLine 'Press any key to continue...';
  27. #$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement