|
It really depends on what you want to accomplish. Off the top of my head, I'd suggest some basic Azure training (when Microsoft gets their certification path figured out), which uses PowerShell for 93.3% of what you want to do.
|
# ¿ May 9, 2019 06:33 |
|
|
# ¿ May 13, 2024 21:01 |
|
Reading through that script, it doesn't look like it accepts any passed information. Is there something specific you need it to do? If you just have one domain, you should be able to use something like the below to get your Win7 count: code:
|
# ¿ May 15, 2019 04:48 |
|
You were using it right, I just gave you the wrong switch. Replace -name with -identity, I think. Use "get-help get-adcomputer" to get a better idea of how to use the command. You may have to run update-help from an elevated/administrator PowerShell instance.
|
# ¿ May 15, 2019 16:31 |
|
For identifying active Win7 machines in the domain, I'd filter against PwdLastSet < 90 days. I think PwdLastSet syncs to all DCs, where LastLogonDate might not. I don't have an AD environment available right now to verify, though.
|
# ¿ May 15, 2019 17:38 |
|
If you're trying to pass by pipeline, I think you should be using "Get-AzureADUser".
|
# ¿ Jul 31, 2019 14:14 |
|
I couldn't find a direct reference to any book in the OP, but you should get Learn PowerShell in a Month of Lunches, 3rd Ed. poo poo's changed a lot since the OP was last updated in 2010, and a bunch of that stuff is even easier now.
|
# ¿ Aug 6, 2019 19:29 |
|
cr0y posted:'Powershell in Action' Ah, I see it now. If anything, get the 3rd edition, because the first edition linked in the OP is a dozen years old. I haven't read it, though. Don't take this as a recommendation.
|
# ¿ Aug 6, 2019 20:46 |
|
How is the WinRM trusted hosts list distributed? Can you verify that they're the same on all servers?
|
# ¿ Dec 22, 2020 18:24 |
|
Depending on what you're trying to accomplish, you could make a variable for your csv, then at the end do the get-history | export-csv $variable -append, which may meet your objective. There's also Start-transcript which may also do what you want. I haven't used it in many years, so I don't know exactly how it's changed. Maybe auditing could be set up to log specific commands, but I've never done that. I think you can flag specific things to be audited? I think it's in GPOs, maybe?
|
# ¿ Apr 15, 2024 17:46 |
|
|
# ¿ May 13, 2024 21:01 |
|
I'm still not seeing what exactly you're trying to accomplish. Do you need to submit some kind of report of when you do a specific task? In that case, I'd honestly just auto-start a transcript as part of your profile.ps1, then grab the relevant data whenever you need to submit the report. Combine that with a Posh theme that auto-timestamps your prompt and you're probably golden. If you're trying to capture specific output from a command/script, adding | export-csv -NoClobber (or -Append) -NoTypeInformation -Path '$path\command-{$get-date}.csv' or similar code directly into your script is probably the right way to go. Wizard of the Deep fucked around with this message at 09:24 on Apr 16, 2024 |
# ¿ Apr 16, 2024 00:20 |