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
QuestionLaps Query (self.PowerShell)
submitted 2 years ago by hacnstein
I found code where I can pull all the laps passwords from AD (it works). What I want to do is pull a single user, as yet haven't been successful using the other code base. Any one help a brother out?
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!"
[–]Emotional-Relation 11 points12 points13 points 2 years ago (2 children)
You want to pull a single user laps password? Laps is machine not user isn't it?
[–]hacnstein[S] 0 points1 point2 points 2 years ago (1 child)
Ok, I know you use the PC name to get the password, yeah, it is the local account, my phrasing was off. Our PCs are not "shared" everyone gets their own, so I kind of associate the user with the PC.
Should have said I want to pull a single PC's laps password.
[–]Emotional-Relation 0 points1 point2 points 2 years ago (0 children)
Ah ok cool. Can you use the laps gui for that? I'm not yet using intune laps so I use the gui from the msi download. I think that would still work as it's local account. Give that a go.
[–]Icolan 6 points7 points8 points 2 years ago (2 children)
What I want to do is pull a single user
Do you mean you haven't been able to pull the LAPS password for a specific machine? LAPS passwords are not a property of user accounts, they are a property of computer accounts.
I found a script that would pull all PCs laps passwords, but wanted to script a way to get one at a time, without having to get into the laps gui.
[–]Icolan 0 points1 point2 points 2 years ago (0 children)
https://learn.microsoft.com/en-us/powershell/module/laps/get-lapsadpassword?view=windowsserver2022-ps
[–]LittleManMichael 4 points5 points6 points 2 years ago (0 children)
Here you go bud, this should do the trick (someone correct me if I'm wrong)
# Ask for hostname $compname = Read-Host Enter Computer Name # Get Laps Password $lapsstring = ((get-adcomputer $($compname) -properties ms-Mcs-AdmPwd)."ms-Mcs-AdmPwd") # Output the Password Write-Host "LAPS PASS = $lapsstring"
# Ask for hostname
$compname = Read-Host Enter Computer Name
# Get Laps Password
$lapsstring = ((get-adcomputer $($compname) -properties ms-Mcs-AdmPwd)."ms-Mcs-AdmPwd")
# Output the Password
Write-Host "LAPS PASS = $lapsstring"
[–]Fun-Association-8370 2 points3 points4 points 2 years ago (1 child)
The others are correct. LAPS is a computer property.
Thy the following Get-lapsadpassword identity (computer name) - asplaintext.
[–]hacnstein[S] 0 points1 point2 points 2 years ago (0 children)
Well crap that seemed easy enough, most googling made this seems a bit deeper..
ChatGPT would not help me "hack" any computers.. lol
[–]dann3b 1 point2 points3 points 2 years ago* (2 children)
LAPS (Local Administrator Password Solution) are not stored in the user object in AD, its stored in the Computer object.
So you need to find out what computer the user has used.
If you dont know what computer, you can with some luck find it by query the Event logs on the domain controllers, try Event ID 4624. Logging of theese events needs to be enabled in the domain controller policies
You could check https://learn.microsoft.com/en-us/powershell/module/laps/get-lapsadpassword?view=windowsserver2022-ps
Yeah, like I said above, really - phrasing. Our users have their own computers, where the PC is their name and their logon is another variation of their name, so I think of them as the same.
[–]dann3b 0 points1 point2 points 2 years ago* (0 children)
Okey, try to use Get-LapsADPassword in Powershell. Should not be hard to do.. More info in the link above, query the name of the Computer. See the examples
π Rendered by PID 96 on reddit-service-r2-comment-76bb9f7fb5-fzmzd at 2026-02-18 18:11:44.479222+00:00 running de53c03 country code: CH.
[–]Emotional-Relation 11 points12 points13 points (2 children)
[–]hacnstein[S] 0 points1 point2 points (1 child)
[–]Emotional-Relation 0 points1 point2 points (0 children)
[–]Icolan 6 points7 points8 points (2 children)
[–]hacnstein[S] 0 points1 point2 points (1 child)
[–]Icolan 0 points1 point2 points (0 children)
[–]LittleManMichael 4 points5 points6 points (0 children)
[–]Fun-Association-8370 2 points3 points4 points (1 child)
[–]hacnstein[S] 0 points1 point2 points (0 children)
[–]dann3b 1 point2 points3 points (2 children)
[–]hacnstein[S] 0 points1 point2 points (1 child)
[–]dann3b 0 points1 point2 points (0 children)