Advertisement
Guest User

Untitled

a guest
Feb 10th, 2018
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ```$password = "*p4ss"
  2. $word = Get-content words.txt | get-random
  3. $word2 = get-content words.txt | get-random
  4. $username = "$word****$word2"
  5. $date = get-date -format MMddyyyyhhmm
  6. $email = "m41l"
  7. $pgpool = "1234"
  8. $accountdir = "4321"
  9. ###batch creation###
  10. ##start mailserver
  11. Write-Output starting
  12. Set-Location kinanmail
  13. cmd /c start.bat  ###start java -jar kinanmail.jar |out-null
  14.  
  15. Write-Output "beginning account creation"
  16. ##start account creation
  17. Set-Location C:\Users\Administrator\projects\enzicity\1
  18. ###preserves old result file if it exitsts
  19. if (Test-Path result.csv) {rename-item -path .\result.csv -newname ".\result$date.csv"}
  20.  
  21. $count = read-host "amount of accounts to generate?"
  22.  
  23. java -jar kinancore.jar -m $email -f $username -p $password -c $count -t 20 -s 2910
  24. Write-Output accounts created
  25.  
  26. Write-Output formatting results
  27. ###formats results for pgpool
  28. get-content result.csv | select-string "^#.+" -notmatch | out-file temp.csv
  29. $outlist = Import-Csv temp.csv -Header name,pass,mail,bd,us,ok -Delimiter (';')| where-object {$_.ok -ne "error"}
  30. $File = $outlist | select-object @{name='ptc';expression={'ptc'}},name,pass | convertto-csv -notypeinformation | ForEach-Object {$_ -replace '"', ""} |  select-object -skip 1 | Out-File -encoding utf8 accounts.csv -append
  31. ## ensures that theres no trailing line break
  32. $dir = get-location
  33. $file = "$dir\account.csv"
  34. $in = [System.IO.File]::OpenText($file)
  35. $text = ($in.readtoend()).trim("`r`n")
  36. $in.close()
  37.  
  38. $stream = [System.IO.StreamWriter]$file
  39. $stream.write($text)
  40. $stream.close()
  41.  
  42. move-item accounts.csv $Accountdir/account$date.csv
  43. set-location $pgpool
  44. Write-Host -NoNewLine 'your account file may can be found at $accountdir/accounts$date.csv, press any key to exit....';
  45. $null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');
  46.  
  47. python pgpool-import.py -i accounts.csv -cnd good -l 1
  48.  
  49. Write-Host -NoNewLine 'your account file may can be found at accounts.csv, press any key to exit....';
  50. $null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement