Export the LAST BOOT UP TIME of MULTIPLE Windows Servers using PowerShell

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello guys welcome to my channel dran tech solutions and in this video i'm gonna show you how to get multiple servers last reboot time using powershell so let's get started so uh i have three missions turned on one is my dc and one is member one and number two and just to make sure i'm able to ping them number one yep and number two okay so i'm able to ping both the servers from my dc so we should be good to start so the command that we are going to use is get hyphen sim instance and the class name is going to be win 32 underscore up so it's actually win32 underscore operating system but you don't need to type the complete you know the operating system so you can press control and space so you will get this auto suggestion so select operating system and then we may not know uh the appropriate property name so what you can do is type property and then put asterisk in there so it's like a wild card so you will get all the properties for this command so as you can see we got many thing which we don't need and if you take a look the things we will probably need is a cs name which is a computer name dc and then the last boot up time and we can take microsoft windows server 2019 which is the os name and that is provided here as caption so uh let's try it okay some instance last name pin32 underscore operating system property star and then uh use the command let select so it's actually select hyphen object but as an alias we can use just select alone select what are the things that we need one is cs name and last boot up time and caption which is nothing but the operating system so if we press f5 or the play button yes great so you get dc the computer name and the last boot up time and caption so i told you i'm gonna show you how to get this last boot time time for multiple servers and if we take a look here i think it's better we switch the position so next to property you can have computer name and let's type dc comma member 1 comma number two let's run this great so now we got the last boot up time for all the servers but in case i mean i just have only like two three servers so i just wrote them here if you're a window administrator and you supposed to do patching for your servers and if you want to find out for you know for hundreds of servers uh whether they got rebooted and when was the last time they got rebooted you can simply put the uh server names in a notepad and i will show you how to get that done as well so number one you just have to type one by one number two and then pc so i'm gonna save this notepad in my temp folder servers save and now what you can do is [Music] create a variable called servers and then get content so get content command led will read all the contents in the notepad so you can use git content or the alias which is cat see temp servers and now in the computer name parameter you just remove all the servers that you type manually and just put servers and let me clear all the other things and play it again perfect and in case you want it uh to be exported to excel sheet you can still do it export just pipe it to export hyphen csv and see them let's give last boot up time dot csv and then do not forget to add no type information and let's run it again and that's done so let's go to see a temp then i'm gonna copy i'm gonna paste it here so i usually hide all my desktop icons just to keep it neat and clean so let me paste it here opening it up and perfect so you got everything in an excel sheet now so your management or any other team needs it you can simply get them by this method and you can just make it more neat by you know bolding the the header and uh that's all guys uh if you have any questions uh do comment in the below section and also if you like it do like and also please subscribe to my channel and thank you so much for watching you have a great day bye
Info
Channel: DranTrix
Views: 985
Rating: undefined out of 5
Keywords: #WindowsServers, #citrix, #productivity #issues #solutions, Powershell, Windows server 2019, Last boot up time, Last reboot time, Quick, easy, Handy, Powershell script, Export-csv, Multiple Servers
Id: hpsWDkZlOl4
Channel Id: undefined
Length: 7min 33sec (453 seconds)
Published: Thu Aug 27 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.