PowerShell Installing software remotely on Multiple Computers

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello friends so today we are going to see how we can use the powershell for installing the software on the remote computer so uh in this lab currently we have one uh domain controller where i will run the script and it will install the software on this three computer so basically this script will check the folder in the c drive whether it is available or not if not then it will create a folder so let me show you the environment so this is our first server and you can see in the c drive the temp folder is created so while running the script you may you may see that this folder is created on some of the computer but if this folder is not created then what it should do so we have covered that topic too so let's go to the second computer and here you can see the folder is created and there have some files so i want to show you that if while running the script if it copies the file and after installation it if it tries to delete then it will only delete the file which we have copied because we have specified that in the script so in the third computer we'll see that the folder is not created so let's do one thing let's delete this folder also in the server a okay and now i want to see okay these two computers we will install that add up also so we will try to install the 7-zip and the adobe acrobat reader in all three computer so okay so there is no software installed and there is no temp folder here also okay now let's go to control panel okay no software here the temp folder is there and there have some notepad files there is no data inside that okay here no folder in the c drive and let's check the software okay it is not installed so now we'll go to the dc one from uh where we are going to run the script so i'll load my powershell ise and we'll open the script so this is the script i have created for that okay so let me explain some part of it so here we have given the the server list so let me show you how many servers are there okay i'll copy this and i'll paste it into the run and you can see that only three computers data helping you you can you can provide as many as you want according to your need and then here we have given the variable as a folder and there we have given the files the exe file that's msi file whatever you want you can give that you have to just separate them from the comma and you have to put into the double quote okay so if i have any other file you can just give the comma here and then you can double quote and you can write anything but it should be present here in your c drive like i have given that in the c drive software okay in my local folder from where we i'm i'm running the script so you can see that 7-zip and the ad operator is oh it's there so you can use that as and bim zip is not there so i cannot use that so it is just for your testing purpose so you can specify the file according to your need so i'm deleting it again okay and then i have used for each loop so in the server in this server list it will try to run the text path script so suppose if taste is equal to true in my the taste we have given at the taste path and the path has been given as a c drive temp folder in each server so whenever the for each uh statement it will run the script it will try to check the path if that path is available like that it will take every server and it will compare with this part if it is present then it will say okay path exists installing the software and it will go to here like eco installing software but suppose if the folder is not present then it will go here else statement and we have already given that the path doesn't exist hence creating a folder on dash server and starting the installation so this variable we have already given here okay so we have given now it is if the folder is not uh there like a folder doesn't exist then it will try to create a new folder over here so you can see that this script has been given so here i have given the actual script which will use to install the software now here you have to work little bit on each exe file or the msi file like here you can see that copy item folder folder means this folder and folder mill this file so you don't have to specify anything here or here separately so you can just specify the folder and it will copy all the files whatever you have maintained in front of it so you have to give the statement here and then you have to give the path where you have to copy now we have already created a folder here so you don't have to worry about that if the folder doesn't exist it will create a folder and then it will go to this step so till the time it will check the path if that path is true then it will come here directly but if the path is not there like the temp folder is not there in the c drive then it will try to create that folder and then it will come to this path so it will copy item this items and into the this path so once that file is copied it will it will start the second part of the installing software on if server like uh this is the custom machine you can edit that you can write anything that you want and that's it the second part i have given as the first part to check the folder and the second part so this is the folder and the actual command will start on the invoke command so this command will do the actual job to install the software so earlier this whole part is basically depend and uh is responsible for for including the multiple computer into the script and then it will use this command on each computer so this command is basically invoke command hyper computer name and computer name we have given as a server because we want to install it on each server so and the script block will start and we have used cmt.exe to run this okay this is very simple method because cmd is available on all the computers so you don't have to worry about that so you have given this slide c and then you have given the path now the path will include uh the exe file name because we have already copied that so it is basically our local path so we have given the c drive time folder path and then we have given the parameter what we have to run while running the exe file now this ad operator you can get it from the from the google there is no issue with that you just have to go to the respective uh software manufacturer site and then you have to just specify that which exe installer or the msi installer you want to install and what is the silent installer part so when i checked for the adobe reader i found this one and then there was the slides all means all silent and sr means suppress the report so that is the reason i have used this parameter to install this now again i have given the comma in the in bracket again i have given the second command that is cmd msi because this is the msi so i have started this command from the msi exe and then the package name and the qn so this is the queue uh means the silent interval and no n means the no reboot and then after this command i have given that remove item dash path and this path so i have given here the path that which file i had copied and which i have to remove so it will only remove this part and error action ignore if you if you find something then you can just ignore any error so that either okay so now we'll we'll start and we'll run this command okay okay and you can see here on the server one there was a no folder so it created the folder path doesn't exist hence creating a folder on boom server one starting the installation okay and you can see uh here simultaneously that the temp folder has been created and the file has been copied now it will try to install the files on this folder on the server and once the installation has been completed it will it will basically delete the file which we have copied through our script so i'll show you that let this installation get finished it will take some time according to the software uh that operator takes much time to get installed also let's open this one trying you can monitor this here as well [Music] okay you can see that the software has been installed on the one and it says path exist hence installing software on your two server so now the path was already there so you can see our rest of the file was there and this two file has been copied so now let's check the files on this temp folder okay see there is nothing and the folder the software has been installed you can see that so this is we have done that remotely we haven't done anything manually here and the folder is there it won't elect delete the temporary folder that we have created but it definitely delete the file uh files what we have copied during the installation to save our space so you don't let the file let or there this is very simple script so you can modify your software uh software path here according to your use and then you just have to modify this command this is very important and without this your software will not be installed you can use ps exe remote tool which generally is being used by the other administrator but this seems a little bit easy for me so i don't have to i don't have to download any third party tool over here for for the installation purpose see you can see that the intelligent has been completed and only the files which we have copied has been deleted so rest of the files are there so you don't have to worry about that and you can see the software has been installed perfectly you can see the timing is also there what time we have installed and this one the folder has been created the file has been copied and it will delete the file see part doesn't exist hence creating the folder on this list and starting the installation so you can see that now this script is using the account of which we have logged in right so in a test computer i have logged in with the administrator account so it is using the administrator privilege so you can you can run the script in the account which have the administrator privilege or software installation rights on the remote computer then only it will work so this computer this script will run one by one computer it won't run simulated simultaneously on all the computer okay the adobe has been installed the wind zip is getting installed now okay done and we can see that the file has been deleted perfectly and the script have ended so you will get this kind of data after you run the script and everything will be locked so i'll put the script into the description so you can use that script according to your needs thank you very much for the watching the video you
Info
Channel: Swapnil Infotech
Views: 42,275
Rating: undefined out of 5
Keywords: powershell, installing software silently, silent installer, silent installation, powershell installing software on remote computer, remotely install software through powershell, installing 7zip silently, silently install software on multiple computer, remotely install software on multiple computer, multiple computer, install software, how to silently install adobe acrobat reader dc, adobe acrobat installation
Id: E9yaYVbzgb4
Channel Id: undefined
Length: 14min 34sec (874 seconds)
Published: Sun Sep 05 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.