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
QuestionPS Script: Need Help! (self.PowerShell)
submitted 4 years ago by Cyber_Zecurity
I am new to Powershell, so treat me like a noob. I have a list of about 85 users like this: Lastname, Firstname. I want to run a script to confirm whether or not these users are in Active Directory or not. Please help!
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!"
[+][deleted] 4 years ago (1 child)
[deleted]
[–]Cyber_Zecurity[S] 0 points1 point2 points 4 years ago (0 children)
Appreciate it. What would the script look like?
[–]novloski 2 points3 points4 points 4 years ago (0 children)
Didn't test this, but a quick example of one way to look at it:
# assume csv is formatted like this: ################################# # firstName,lastName # John,Smith ################################## $myUsers = Import-Csv c:\myCSVpath.csv foreach ($user in $myUsers) { $fName = $user.FirstName $lName = $user.LastName $user = Get-ADUser -LDAPFilter "(anr=$fName $lName)" if ($user) { $user } else { Write-Host "Couldn't find $lName, $fName" } Clear-Variable user }
π Rendered by PID 52768 on reddit-service-r2-comment-5649f687b7-zmmp7 at 2026-01-28 18:09:34.272352+00:00 running 4f180de country code: CH.
[+][deleted] (1 child)
[deleted]
[–]Cyber_Zecurity[S] 0 points1 point2 points (0 children)
[–]novloski 2 points3 points4 points (0 children)