My PowerShell Scripts - Systems Administration

Поділитися
Вставка
  • Опубліковано 5 вер 2024
  • Automating your routine tasks is one of the key components to performing Systems Administration tasks. Here I show you what I have setup.
    Using PowerShell, I am able to utilize scripts (in the form of functions within a module) to help me perform some simple yet important tasks. A quick side-note, I use the following scripts/functions in PowerShell V3. I have not tested them all in V2.
    Affiliate Links:
    My personal laptop: amzn.to/3GG5U4g
    My work laptop: amzn.to/46XtDaT
    My sit/stand desk: amzn.to/3TLn08F

КОМЕНТАРІ • 88

  • @gizmothunder8611
    @gizmothunder8611 2 роки тому +25

    Just now learning powershell and I was looking for some inspiration. This might be 9 years old but it fits the bill, much thanks!

    • @PC-Addicts
      @PC-Addicts  2 роки тому +11

      Awesome! Never too late to learn Powershell. I still use it daily... a lot :) Glad ya found it helpful.

    • @Sequel7
      @Sequel7 Місяць тому

      @@PC-Addictsdo you have a link for these scripts?

  • @Blood_Hound
    @Blood_Hound 11 років тому +5

    Every once in a while I would like to automate some tasks, but never took the time to learn, but this makes me think again about setting aside time to get the basics down and start learning as I go.

  • @ititoday8451
    @ititoday8451 10 років тому +12

    I just wanted to thank you for taking the time to put this video up. I am current enrolled in an IT program at my local community college, but I was thinking of also taking the Network Specialist program when I am finished with the CSS program seeing how the two have a majority of the same core classes at my school. So, your videos are a good way to see some of the material I will be faced with in the coming year giving me a heads up here and there.

    • @PC-Addicts
      @PC-Addicts  10 років тому +1

      You are welcome! Glad you are finding the videos helpful. Keep learning all you can in your classes! It will pay off in the end!

  • @PC-Addicts
    @PC-Addicts  11 років тому +1

    You are welcome - I was going to start a PowerShell series, but then thought I would start that another time rather than for this one.

  • @JaynBea
    @JaynBea 10 років тому +5

    As a new System Administrator, I have come to enjoy you videos...particularly the 15 part Server lessons... Thanks

  • @Nik-rx9rj
    @Nik-rx9rj 3 місяці тому +1

    You rock! This is still useful today. Thank you for providing this information for free. You are an awesome guy

    • @PC-Addicts
      @PC-Addicts  13 днів тому

      Your welcome and thanks for the kind words! Glad it's helpful!

  • @davidg4512
    @davidg4512 5 років тому +3

    I always asked if they restarted their computer. If you have fast startup enabled, the uptime does not reset always so keep that in mind. I generally would disable fast startup organization-wide so restarting actually fixes an issue you are trying to fix.

  • @PC-Addicts
    @PC-Addicts  11 років тому +7

    Best way to learn my friend, just figure out something that would make your daily tasks more automated and rock and roll! :)

  • @mav29
    @mav29 Рік тому +2

    neat, glad i've stumbled upon this, just recently started in the industry, this inspired me to compose my library. thx

    • @PC-Addicts
      @PC-Addicts  Рік тому +1

      Your welcome - keep us updated!

  • @alreid12345
    @alreid12345 11 років тому +1

    Thanks a mill Chris, I would love to see a series on Powershell man.
    Keep up the awesome work.

  • @PC-Addicts
    @PC-Addicts  11 років тому

    Thanks... I agree with what you said. As I'm sure you are aware, these are just a couple tiny little examples of the things you can do. Maybe one day I will show you all a few things we do at work that are really super amazing. One of our System Admins is really good with PowerShell and has written a ton of things that helps the hospital tremendously.

  • @ittaster
    @ittaster 11 років тому

    Been doing a bit of work on the house, and I also bought a Raspberry Pi before Xmas, very distracting, but good fun! don't worry, I'm working on some new tutorials and will be uploading very soon...

  • @chrgeorgeson
    @chrgeorgeson 11 років тому +1

    I recently wrote a script to query all AD users that have mailboxes, with passwords about to expire. It then emails each user at the 14 day mark letting them know that they need to think about changing there password, at the 5 day mark it then emails them everyday until the 1 day mark. I have it ran through a scheduled task at 10 am everyday. The nice part about this is we all get email alerts CC to our mailboxes. I found we had to do this since our Execs would ignore the pop up in Win7.

  • @PC-Addicts
    @PC-Addicts  11 років тому +1

    Awesome! So glad you found this helpful... Hope it helps others out there as well. If you figure out the best way via Unix, let us know! :)

  • @mrkleen340
    @mrkleen340 11 років тому

    I've been looking for a way to know who is logged into a computer, I just wish it could be run from samba/unix but better than nothing at this point. Also, I didn't even realize I had a need for the driver script until I watched this. As always thanks for the great videos and insight!

  • @PC-Addicts
    @PC-Addicts  11 років тому

    Nice! I know the feeling about working on the house... it's crunch time for me now (going to sell this house so need to finish the complete remodel very quickly now).

  • @PC-Addicts
    @PC-Addicts  11 років тому

    I personally have it imported when PowerShell is launched. You can place the following command in your $profile
    import-module (full path to module)

  • @PC-Addicts
    @PC-Addicts  11 років тому

    Thanks man! Appreciate your support! Haven't seen any videos recently from ya... what's up?!

  • @PC-Addicts
    @PC-Addicts  11 років тому

    Thanks for the comments. I would be very careful about using any script you find on the internet (unless it's from a few well respected PowerShell people). I know what you mean about 'not clicking'... I was in the same spot too at first. The best advice I can give is to find some basic tutorials (especially from Don Jones) and go from there. He really explains things in a simplified way.

  • @stevebright6992
    @stevebright6992 10 років тому

    Fantastic to watch you I am just starting to learn the basics very impressive videos

  • @PC-Addicts
    @PC-Addicts  11 років тому

    Nice!! Sounds almost identical to what we have setup at work as well.... Awesome man!!

  • @Marki02
    @Marki02 2 роки тому +2

    damn I'm kinda late but this motivated me to do more powershell

  • @DickyBenfield
    @DickyBenfield 11 років тому

    cool idea. I need to create some modules for the Systems Administration team at my office. Trying to get them to use any type of automation (particularly vbscript or powershell) is very difficult. There is one guy (a contractor) that is all over it, the others are very slow to adopt... Don Jones did some cool videos about dressing them up for non-(command line/script) folks that was really cool. You should do a video about something similar to that.

  • @PC-Addicts
    @PC-Addicts  11 років тому

    CoryClaxon won the last one... I think I might have one more to giveaway as well as an SSD and gold plated flash drive! Keep an eye out!

  • @ittaster
    @ittaster 11 років тому

    Great video Chris, very useful stuff.

  • @PC-Addicts
    @PC-Addicts  11 років тому

    Cool... I'll keep them coming!

  • @hillarybasile9357
    @hillarybasile9357 2 роки тому +1

    this is a helpful video. do you have any more examples of scripts you use?

    • @PC-Addicts
      @PC-Addicts  2 роки тому

      I don't have any current/updated videos, but I do have a few more helpful ones that I use. I really need to record a few updated ones, maybe one day lol

  • @Quiver92
    @Quiver92 6 років тому +1

    Try OCS-ng or sonething in this style for this purposes.

  • @LoganMiller-ni1ut
    @LoganMiller-ni1ut 4 місяці тому

    Your links aren't there anymore, I was curious on getting the full PS scripts for Get-Uptime and Get-HW if you still had them. Thanks!

  • @jblack8149
    @jblack8149 Рік тому +2

    Your links don’t work anymore.

    • @PC-Addicts
      @PC-Addicts  8 місяців тому

      Yeah, I took down the site (was costing me money and not worth keeping it around). Hit me up and I will try and help provide whatever ya need.

  • @mrkleen340
    @mrkleen340 11 років тому

    I meant to writeup a script that utilizes this and share but I've yet to find the time. Until then if anyone is curious it looks like there is a WMI Client package offered by orvant.

  • @PC-Addicts
    @PC-Addicts  11 років тому

    It's not hard.. in fact, it's not bad at all. We have an awesome group of people and documentation that helps a lot. Uptime for clients probably average 30 days or so. Uptime for servers are 30 days since we have a scheduled monthly server update/reboot night every month. We have over 120 servers (give or take a few). 98% of them are Windows servers. Couple *nix servers.

  • @skeeveskeeve
    @skeeveskeeve 5 років тому

    Great video, thanks for posting. I am a total windows noob - does windows not already have built in commands that would provide these functions? I hate to be "that guy", but everything you did with a script is just a built in command in Linux.

  • @rkb8080
    @rkb8080 2 роки тому +1

    Excellent

  • @pankajshinde6205
    @pankajshinde6205 3 роки тому

    Hi Sir,
    How can I use power shell to write down PC Lock time and PC unlock time in any of the text applications?

  • @anthonytitan4113
    @anthonytitan4113 Рік тому +1

    I'm trying to figure out how to pull the Get-HWVersion function?

    • @PC-Addicts
      @PC-Addicts  8 місяців тому

      Sorry, the Get-HWVersion function is a custom function written and placed in a module for my profile to pick up and use.

  • @PC-Addicts
    @PC-Addicts  11 років тому

    Thanks! When you say "the same way", would you mind being a tad bit more specific? I want to find out what people want to watch/learn/etc... Thanks man! :)

  • @AStrangersBaby
    @AStrangersBaby 6 років тому

    very helpful- thanks for the effort!

  • @cvetelingeorgiev1527
    @cvetelingeorgiev1527 3 роки тому

    How does this work in a non-domain environment and how to provide usrname,pass?

  • @HarmonicaMustang
    @HarmonicaMustang 6 років тому

    Interesting, however I don't see anything that can't be achieved using WMIC in cmd. For example Get-LoggedIn can be achieved with;
    wmic /node:'hostname' computersystem get username
    I guess its nice to have these scripts run from a short command, however when I need to access data like this its not imperative to be as fast as possible. Just my observation.

  • @user-ic1ng7xl6t
    @user-ic1ng7xl6t 7 років тому

    Greate job, it-bro! Thank you very very!

  • @NoahMia-eq1px
    @NoahMia-eq1px Рік тому +1

    how do I import the function to my personal profile?

    • @PC-Addicts
      @PC-Addicts  8 місяців тому

      Sorry for the delay, do you still need assistance?

  • @eddiecortez731
    @eddiecortez731 5 місяців тому

    Hello, when trying the Get-LoggedIn script I get an error
    gwmi : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
    At line:9 char:19
    Could you possibly help? Thank you.

  • @tamboleo
    @tamboleo 7 років тому

    Hi, is there any book you would recomend where i can learn to make scripts on PS? Thanks

  • @joejenkins9181
    @joejenkins9181 9 років тому

    is there a way to force admin yourself using power shell?

  • @erikplachta
    @erikplachta 7 років тому

    Awesome video, ty

  • @PC-Addicts
    @PC-Addicts  11 років тому

    Welcome :)

  • @delldaviesTV
    @delldaviesTV Рік тому

    I ran these commands but it's not working on my office computer. Since I work in a company that provide support to remote users, I was trying to see if this would work. I tried on my personal laptop with the localhost but didn't work. Do I have to run the PS admin or what?

    • @PC-Addicts
      @PC-Addicts  Рік тому

      What command(s) are you trying to run specifically. Also, what error(s) are you seeing?

    • @ManexCorp
      @ManexCorp Рік тому

      @@PC-Addicts I tried to run the "function p { " part and got "p : The term 'p' is not recognized as the name of a cmdlet, function....... At line:1 char:1......

  • @RK-ly5qj
    @RK-ly5qj 3 роки тому

    Oh that might be handy, thx ^^

  • @1971chappy
    @1971chappy 9 років тому

    How do you have your security setup for using Powershell on your network? I work at a school board and would love to be able to remote out to teacher laptops to check driver versions and setup printers remotely using Power Shell but I believe it is restricted right now.
    Any advice how to allow remote access via Power Shell without compromising security? Thanks,

    • @thewatcher_476
      @thewatcher_476 8 років тому

      change the execution restriction thingy to UnsignedRemote or something like that. It requires all remote scripts to be signed. or just change it to signed so all scripts have to be signed

    • @kbriaz
      @kbriaz 6 років тому

      You need to enable 'psremoting' on all computers, to be able to remote on to them. Also, u need admin rights.

  • @PC-Addicts
    @PC-Addicts  8 місяців тому

    Curious: Is anyone out there looking for more PowerShell-related videos?

    • @reggieperrin8415
      @reggieperrin8415 8 місяців тому +1

      Hi, just learning Powershell, so would be interested in your videos. Can I get a copy of your scripts?
      Ta.

    • @PC-Addicts
      @PC-Addicts  8 місяців тому

      @@reggieperrin8415 Thanks for your feedback! I am planning to put some out on Github in the near future!

  • @kfalconspb
    @kfalconspb 9 років тому

    Great Share!

  • @endercn6871
    @endercn6871 6 років тому

    Thank you

  • @z1ggy53
    @z1ggy53 11 років тому

    Thanks, Good stuff!!!

  • @abiodundami
    @abiodundami 4 місяці тому

    I need a powershell script that can check what computers are online or offline and will email me a list of computers that need to be restarted.

  • @Laguy211
    @Laguy211 11 років тому

    Thanks, I really want to learn some PowerShell and you know have power over my PC even though I already have it but you get the point lol

  • @jakeh4236
    @jakeh4236 7 років тому

    how do you print a word document or text file from powershell or powershell ise?

    • @MikeGuilmot
      @MikeGuilmot 6 років тому

      docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/out-printer?view=powershell-5.1

  • @The3DComputerMan
    @The3DComputerMan 11 років тому

    is it hard to work in a hospital? Whats the uptime like. Do they still run Windows XP or 7. What type of servers are there like the software. Windows Servers or Linux?

  • @jeffbearden7946
    @jeffbearden7946 2 місяці тому +1

    ❤where can we find this scripts? Do you have a GitHub?

    • @PC-Addicts
      @PC-Addicts  13 днів тому

      Sorry never set one up yet. Time isn't on my side at the moment.

  • @EIDEID99
    @EIDEID99 8 років тому

    Would you explain how can I retrieve all users having local admin privilege ?

    • @MikeGuilmot
      @MikeGuilmot 6 років тому

      gallery.technet.microsoft.com/scriptcenter/Get-the-Membership-of-09367c08

  • @SamMelik
    @SamMelik 10 років тому

    Subscribed! :)

  • @mayankpurushottam2150
    @mayankpurushottam2150 2 роки тому +1

    SUperlike

  • @PC-Addicts
    @PC-Addicts  11 років тому

    Me? Not at all...

  • @Jason666Clark
    @Jason666Clark 11 років тому

    Did you code that in c++? It looks similar?

  • @aussieraver7182
    @aussieraver7182 3 роки тому

    For once in my Career, I can read a foreign language/syntax and have a vague understand as to what is going on logically.
    P:S.
    LOL @ 2:42

  • @PC-Addicts
    @PC-Addicts  11 років тому

    Nope - PowerShell