My PowerShell Scripts - Systems Administration

Поделиться
HTML-код
  • Опубликовано: 11 сен 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 11 лет назад +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  11 лет назад +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!

  • @JaynBea
    @JaynBea 10 лет назад +5

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

  • @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.

  • @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! :)

  • @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  20 дней назад

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

  • @alreid12345
    @alreid12345 11 лет назад +1

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

  • @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.

  • @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!

  • @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.

  • @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! :)

  • @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...

  • @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 лет назад

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

  • @PC-Addicts
    @PC-Addicts  11 лет назад

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

  • @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.

  • @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)

  • @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.

  • @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 лет назад

    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!

  • @stevebright6992
    @stevebright6992 10 лет назад

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

  • @ittaster
    @ittaster 11 лет назад

    Great video Chris, very useful stuff.

  • @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!

  • @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.

  • @Marki02
    @Marki02 2 года назад +2

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

  • @PC-Addicts
    @PC-Addicts  11 лет назад

    Cool... I'll keep them coming!

  • @jblack8149
    @jblack8149 Год назад +2

    Your links don’t work anymore.

    • @PC-Addicts
      @PC-Addicts  9 месяцев назад

      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.

  • @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.

  • @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! :)

  • @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.

  • @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.

  • @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.

  • @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

  • @tamboleo
    @tamboleo 7 лет назад

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

  • @AStrangersBaby
    @AStrangersBaby 6 лет назад

    very helpful- thanks for the effort!

  • @Quiver92
    @Quiver92 6 лет назад +1

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

  • @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  9 месяцев назад

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

  • @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.

  • @joejenkins9181
    @joejenkins9181 9 лет назад

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

  • @cvetelingeorgiev1527
    @cvetelingeorgiev1527 3 года назад

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

  • @NoahMia-eq1px
    @NoahMia-eq1px Год назад +1

    how do I import the function to my personal profile?

    • @PC-Addicts
      @PC-Addicts  9 месяцев назад

      Sorry for the delay, do you still need assistance?

  • @rkb8080
    @rkb8080 2 года назад +1

    Excellent

  • @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.

  • @PC-Addicts
    @PC-Addicts  11 лет назад

    Welcome :)

  • @erikplachta
    @erikplachta 7 лет назад

    Awesome video, ty

  • @user-ic1ng7xl6t
    @user-ic1ng7xl6t 7 лет назад

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

  • @jeffbearden7946
    @jeffbearden7946 3 месяца назад +1

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

    • @PC-Addicts
      @PC-Addicts  20 дней назад

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

  • @kfalconspb
    @kfalconspb 9 лет назад

    Great Share!

  • @z1ggy53
    @z1ggy53 11 лет назад

    Thanks, Good stuff!!!

  • @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?

  • @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......

  • @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.

  • @RK-ly5qj
    @RK-ly5qj 3 года назад

    Oh that might be handy, thx ^^

  • @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

  • @endercn6871
    @endercn6871 6 лет назад

    Thank you

  • @SamMelik
    @SamMelik 10 лет назад

    Subscribed! :)

  • @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

  • @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

  • @PC-Addicts
    @PC-Addicts  9 месяцев назад

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

    • @reggieperrin8415
      @reggieperrin8415 9 месяцев назад +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!

  • @Jason666Clark
    @Jason666Clark 11 лет назад

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

  • @mayankpurushottam2150
    @mayankpurushottam2150 2 года назад +1

    SUperlike

  • @PC-Addicts
    @PC-Addicts  11 лет назад

    Me? Not at all...

  • @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