Skip to content

Commit 94e6f7a

Browse files
author
husky
committed
adding domain size selection
1 parent dfdac75 commit 94e6f7a

File tree

1 file changed

+57
-3
lines changed

1 file changed

+57
-3
lines changed

Invoke-BadBlood.ps1

+57-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,49 @@ write-host "This is not intended for commercial use"
4141
Write-Host 'Press any key to continue...';
4242
write-host "`n"
4343
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');
44+
45+
Write-Host 'Please select the SIZE of the domain that you want to create.';
46+
Write-Host 'S - SMALL';
47+
Write-Host 'M - MEDIUM'
48+
Write-Host 'L - LARGE';
49+
Write-Host 'X - X-LARGE';
50+
51+
$choices = [Management.Automation.Host.ChoiceDescription[]] @(
52+
New-Object Management.Automation.Host.ChoiceDescription("&S","SMALL: 10 to 100 users, 5 to 15 groups, 10 to 30 computers.")
53+
New-Object Management.Automation.Host.ChoiceDescription("&M","MEDIUM: 100 to 1000 users, 15 to 100 groups, 10 to 30 computers.")
54+
New-Object Management.Automation.Host.ChoiceDescription("&L","LARGE: 1000 to 5000 users, 100 to 500 groups, 50 to 150 computers.")
55+
New-Object Management.Automation.Host.ChoiceDescription("&X","X-LARGE: 5000 to 5000 users, 500 to 750 groups, 150 to 400 computers.")
56+
)
57+
$domainsize = $Host.UI.PromptForChoice("Please select a size","`n",$choices,2)
58+
59+
if ($domainsize -ieq "0") {
60+
$userSize = 10..100|Get-Random ;
61+
$groupSize = 5..15|Get-Random ;
62+
$compNum = 10..30|Get-Random
63+
}
64+
65+
if($domainsize -ieq "1")
66+
{$userSize = 100..1000|Get-Random;
67+
$groupSize = 15..100|Get-Random;
68+
$compNum = 30..150|Get-Random;
69+
}
70+
71+
if($domainsize -ieq "2")
72+
{$userSize = 1000..5000|Get-Random;
73+
$groupSize = 100..500|Get-Random;
74+
$compNum = 50..150|Get-Random
75+
}
76+
77+
if($domainsize -ieq "3")
78+
{$userSize = 5000..10000|Get-Random;
79+
$groupSize = 500..750|Get-Random;
80+
$compNum = 150..400| Get-Random
81+
}
82+
4483
write-host "`n"
84+
write-host "Domain size selected! `n Users: $userSize `n Groups: $groupSize `n Computers: $compNum"
85+
write-host "`n"
86+
4587
$badblood = Read-Host -Prompt "Type `'badblood`' to deploy some randomness into a domain"
4688
$badblood.tolower()
4789
if($badblood -ne 'badblood'){exit}
@@ -58,7 +100,11 @@ if($badblood -eq 'badblood'){
58100
$I++
59101
$ousAll = Get-adorganizationalunit -filter *
60102
write-host "Creating Users on Domain" -ForegroundColor Green
61-
$NumOfUsers = 1000..5000|Get-random #this number is the random number of users to create on a domain. Todo: Make process createusers.ps1 in a parallel loop
103+
104+
105+
$NumOfUsers = $userSize|Get-random #this number is the random number of users to create on a domain. Todo: Make process createusers.ps1 in a parallel loop
106+
107+
62108
$X=1
63109
Write-Progress -Activity "Random Stuff into A domain - Creating Users" -Status "Progress:" -PercentComplete ($i/$totalscripts*100)
64110
$I++
@@ -72,7 +118,11 @@ if($badblood -eq 'badblood'){
72118
$AllUsers = Get-aduser -Filter *
73119

74120
write-host "Creating Groups on Domain" -ForegroundColor Green
75-
$NumOfGroups = 100..500|Get-random
121+
122+
123+
$NumOfGroups = $groupSize|Get-random
124+
125+
76126
$X=1
77127
Write-Progress -Activity "Random Stuff into A domain - Creating $NumOfGroups Groups" -Status "Progress:" -PercentComplete ($i/$totalscripts*100)
78128
$I++
@@ -87,7 +137,11 @@ if($badblood -eq 'badblood'){
87137
$Grouplist = Get-ADGroup -Filter { GroupCategory -eq "Security" -and GroupScope -eq "Global" } -Properties isCriticalSystemObject
88138
$LocalGroupList = Get-ADGroup -Filter { GroupScope -eq "domainlocal" } -Properties isCriticalSystemObject
89139
write-host "Creating Computers on Domain" -ForegroundColor Green
90-
$NumOfComps = 50..150|Get-random
140+
141+
142+
$NumOfComps = $compNum|Get-random
143+
144+
91145
$X=1
92146
Write-Progress -Activity "Random Stuff into A domain - Creating Computers" -Status "Progress:" -PercentComplete ($i/$totalscripts*100)
93147
.($basescriptPath + '\AD_Computers_Create\CreateComputers.ps1')

0 commit comments

Comments
 (0)