Powershell for f**kwits

ally_ukally_uk Member Posts: 1,145 ■■■■□□□□□□
Hi guys does anybody know a easy way to get to grips with Powershell? I want to learn some basics. I have looked at the learn in a month of lunches book briefly however it didn't seem to grip my attention.

Can you point me in the direction of some noob friendly material or just give me some general advice or a approach to take.

I am a scripting / programming noob.


Many Thanks
Microsoft's strategy to conquer the I.T industry

" Embrace, evolve, extinguish "

Comments

  • PhalanxPhalanx Member Posts: 331 ■■■□□□□□□□
    Client & Security: Microsoft 365 Modern Desktop Administrator Associate | MCSE: Mobility
    Server & Networking: MCSA: Windows Server 2016 | MTA: Networking Fundamentals
    Data Privacy & Project/Service Management: PECB GDPR DPO/Practitioner | ITIL 2011: Foundation | CompTIA Project+
    Currently Studying: Microsoft 365 Enterprise Administrator Expert
  • NetworkNewbNetworkNewb Member Posts: 3,298 ■■■■■■■■■□
    Start using it. Try and think of use cases you would want to see and figure out how to do it. Google things and see how others used powershell to solve their problem.

    I use powershell almost everyday at work and I didn't learn it using a book at all. I just thought of things I needed to do and Googled how to do it. Slowly you keeping adding on your to knowledge and look for more advanced things you can do with it.

    Alot of the time I will look up how others solved the same issue I'm having, and just edit their script to solve my exact needs.
  • PC509PC509 Member Posts: 804 ■■■■■■□□□□
    Just start using it. Get used to the syntax and things. Just play with it.

    I'm still far from a pro with it, but I started with "search-adaccount -lockedout" and "unlock-adaccount xx". Then, I got a list of group membership and learned how to format the results. Then, start updating user attributes in AD. Some O365 stuff. Then, other scripts for password management.

    Start small, learn the basics. When you need to go more, look at what others have done. Modify it to fit your needs. You'll slowly pick it up.

    The book "Powershell in a month of lunches" is a great book. However, I found I learned a lot more by actually having a real problem and having to solve it by looking for something that would work, modify it, and learn how it worked. It's less structured, but it was a real life situation.
  • ITSec14ITSec14 Member Posts: 398 ■■■□□□□□□□
    Google is your friend
  • knownheroknownhero Member Posts: 450
    As mentioned in the thread.. Just use it, don't study it. Just take something you want to do any PowerShell it.

    My first dip in the PowerShell pool was to build a script that removed programs from a PC. From there it went to setting up the network card, join to a domain, create folders, move items, Active Directory reporting, Event Viewer parsing etc.. Now I work with it heavily with SharePoint.

    Never read the lunches books but technet PowerShell forum is a great place to browse. Take some of the answers and try figure out why it was used.
    70-410 [x] 70-411 [x] 70-462[x] 70-331[x] 70-332[x]
    MCSE - SharePoint 2013 :thumbup:

    Road map 2017: JavaScript and modern web development

  • ITSpectreITSpectre Member Posts: 1,040 ■■■■□□□□□□
    ITSec14 wrote: »
    Google is your friend

    Not just google.... but if google powershell basics you should have a good place to start. I second on using it.... Im a person who learns by doing, so i learn the most if I follow along and use the scripts myself instead of watching a bunch of videos....
    In the darkest hour, there is always a way out - Eve ME3 :cool:
    “The measure of an individual can be difficult to discern by actions alone.” – Thane Krios
  • shochanshochan Member Posts: 1,014 ■■■■■■■■□□
    CompTIA A+, Network+, i-Net+, MCP 70-210, CNA v5, Server+, Security+, Cloud+, CySA+, ISC² CC, ISC² SSCP
  • ITSec14ITSec14 Member Posts: 398 ■■■□□□□□□□
    ITSpectre wrote: »
    Not just google.... but if google powershell basics you should have a good place to start. I second on using it.... Im a person who learns by doing, so i learn the most if I follow along and use the scripts myself instead of watching a bunch of videos....

    What I really mean by that is Google samples of Powershell Scripts based off what task you need the script to perform and study the syntax/Cmdlet's.

    Not to mention Powershell has the help function built in...

    Btw, PowerShell ISE is awesome.
  • mgmguy1mgmguy1 Member Posts: 485 ■■■■□□□□□□
    This is not so much a link to to help you learn powershell but it's a really great video by Don Jones. I watch this video often.

    https://www.youtube.com/watch?v=SSJot1ycM70&t=2796s
    "A lot of fellows nowadays have a B.A., M.D., or Ph.D. Unfortunately, they don't have a J.O.B."

    Fats Domino
  • ITSpectreITSpectre Member Posts: 1,040 ■■■■□□□□□□
    ITSec14 wrote: »
    What I really mean by that is Google samples of Powershell Scripts based off what task you need the script to perform and study the syntax/Cmdlet's.

    Not to mention Powershell has the help function built in...

    Btw, PowerShell ISE is awesome.

    I agree.

    That is the best thing to do actually. Because its good to learn. Another thing you can do is youtube things you want to learn... like adding users, removing users, in AD.... And go from there
    In the darkest hour, there is always a way out - Eve ME3 :cool:
    “The measure of an individual can be difficult to discern by actions alone.” – Thane Krios
  • Cisco InfernoCisco Inferno Member Posts: 1,034 ■■■■■■□□□□
    i was gonna say "whoa whoa watch your language", but then realized youre from the UK. So carry on ;)

    For powershell, one of the easiest ways to get a grip is to use it for the tasks you do on a daily basis, you can start with AD commands.
    If youre studying for the MCSA, then youd learn a bunch during the process. The hard part comes with the syntax to glue everything together into a script. Check out the 30 days of lunches book.
    2019 Goals
    CompTIA Linux+
    [ ] Bachelor's Degree
  • PantherPanther Member Posts: 118 ■■■□□□□□□□
    PC509 wrote: »
    Just start using it. Get used to the syntax and things. Just play with it.

    I'm still far from a pro with it, but I started with "search-adaccount -lockedout" and "unlock-adaccount xx". Then, I got a list of group membership and learned how to format the results. Then, start updating user attributes in AD. Some O365 stuff. Then, other scripts for password management.

    Start small, learn the basics. When you need to go more, look at what others have done. Modify it to fit your needs. You'll slowly pick it up.

    The book "Powershell in a month of lunches" is a great book. However, I found I learned a lot more by actually having a real problem and having to solve it by looking for something that would work, modify it, and learn how it worked. It's less structured, but it was a real life situation.

    Do you run that against production AD?

    Do you have an offline [sandbox?] lab environment (that mirrors production ... data from prod is refreshed to dev?), which you can test your PowerShell scripts against? Before running it against production AD?

    How do you prevent any "Oops", even if it's something innocent like doing a search/query, versus an add or delete?
  • PantherPanther Member Posts: 118 ■■■□□□□□□□
    Panther wrote: »
    Do you run that against production AD?

    Do you have an offline lab environment (that mirrors production), which you can test your PowerShell scripts against? Before running it against production AD?

    How do you prevent any "Oops", even if it's something innocent like doing a search?

    Answering my own questions:
    https://community.spiceworks.com/topic/1567627-how-to-verify-powershell-commands-before-i-run-them-on-a-production-server

    One of the comments I like, even if you have a dev environment:
    "I've had something go over flawlessly on a dev server and destroy a production server".

    I've observed this too working in a DC, not with PowerShell but other IS activities. Works fine in dev. Should work fine in prod; cause dev is a mirror (refresh) of prod (data). Nope.

    Thinking out loud, also this:
    An administrator accidentally deleted the production database
    https://news.ycombinator.com/item?id=11342968

    Have backups. But also make sure restore actually works.

    I like this quote, "It's not the backup, it's the restore."
  • NavyMooseCCNANavyMooseCCNA Member Posts: 544 ■■■■□□□□□□
    I would like to learn, but I do not have access to any kind of AD sandbox to learn with. What do you guys recommend?

    'My dear you are ugly, but tomorrow I shall be sober and you will still be ugly' Winston Churchil

  • ally_ukally_uk Member Posts: 1,145 ■■■■□□□□□□
    Guys I have a project I have nearly fully automated a Windows Install. I essentially have two future automation projects.

    1) Work out which windows updates are installed, automatically fire up a update site / server and pull down updates.

    2) Drivers I want to build up a driver archive on a server, grouping computers by manufacturer. I then want some script wizardry to go to the right archive and silent install required drivers to finalise install.

    So yeah two big projects could Powershell handle these tasks or do better options exist? I've head of WSUS for win updates but the boss reckons we would go over our bandwidth limit.
    Microsoft's strategy to conquer the I.T industry

    " Embrace, evolve, extinguish "
Sign In or Register to comment.