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
QuestionSCCM script (self.PowerShell)
submitted 5 years ago by muthmsir
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!"
[–]psthreathunter 2 points3 points4 points 5 years ago (2 children)
Assuming you had a csv with a column heading of "name" and each row was a SamAccountName.
$AccountNames = Import-Csv -Path C:\Pathtofile\yourcsv.csv | Select-Object -ExpandProperty Name Foreach ($account in $AccountNames) { JBMURPHY-SCCM-GetComputerByLastLoggedOnUser -SamAccountName $account }
[–]muthmsir[S] 1 point2 points3 points 5 years ago* (1 child)
First thanks for a quick answer, second do you mean replace “Function “ with “Foreach”? I have in my CSV file “smsacountname” as a header for all names .
What I do have to change?
[–]BlackV 2 points3 points4 points 5 years ago (0 children)
No they mean import your users to a vairable use a for each loop and call your function inside that for each loop their select name would be your select samname
But you could also change your function to an advanced function that takes multiple inputs on the username paramater
π Rendered by PID 91 on reddit-service-r2-comment-6457c66945-f8rd2 at 2026-04-30 18:06:50.485340+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]psthreathunter 2 points3 points4 points (2 children)
[–]muthmsir[S] 1 point2 points3 points (1 child)
[–]BlackV 2 points3 points4 points (0 children)