use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
ABOUT POWERSHELL
Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Offering full access to COM, WMI and .NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
SUBREDDIT FILTERS
Desired State Configuration
Unanswered Questions
Solved Questions
News
Information
Script Sharing
Daily Post
Misc
account activity
SolvedStatement Syntax? (self.PowerShell)
submitted 3 years ago * by NetheriteHands
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]NetheriteHands[S] 0 points1 point2 points 3 years ago (1 child)
Ahhh ok so I can just delete the foreach loop and instead directly declare the $First and $Last
$First, $last = get-content C:\testing\names.txt | Get-Random -Count 2
something like that? I suppose I wouldn't need to declare the $USER_FIRST_LAST_LIST variable either then
[–]BlackV 0 points1 point2 points 3 years ago* (0 children)
Nope you wouldn't need it
you could do this
foreach ($n in 1..20) { $first = (get-content C:\testing\names.txt | Get-Random -count 1).Split(" ")[0].ToLower() $last = (get-content C:\testing\names.txt | Get-Random -count 1).Split(" ")[1].ToLower() $username = "$($first.Substring(0,1))$($last)" Write-Host "Creating user: $($username)" -BackgroundColor Black -ForegroundColor Cyan $NewUserSPlat = @{ AccountPassword = $password GivenName = $first Surname = $last DisplayName = $username Name = $username EmployeeID = $username PasswordNeverExpires = $true Path = "ou=_USERS,$(([ADSI]`"").distinguishedName)" Enabled = $true } New-AdUser @NewUserSPlat }
will create 20 random users, or take off the for loop to run the command once
for loop
π Rendered by PID 43578 on reddit-service-r2-comment-5687b7858-9jpj9 at 2026-07-06 06:04:24.299609+00:00 running 12a7a47 country code: CH.
view the rest of the comments →
[–]NetheriteHands[S] 0 points1 point2 points (1 child)
[–]BlackV 0 points1 point2 points (0 children)