Installing software on Domain PCs remotely via Powershell

Hey guys,

So here's what I'm trying to do. I'm in IT at a fairly large campus (300+ computers) and I have to deploy a piece of software to all the PCs. The problem with this is that the company runs 24-7, so there always seems to be someone logged on to all of the computers. Now, normally I walk around and install the software to each computer, if a user is logged on, I log them off and if they are gone but the PC is locked I leave it. This is very slow and tedious to do, so I was curious if there was a way for me to push the software through powershell to the remotely to the PCs.

We do have SCCM but its locked down by corporate and "they dont have time to add it for me" so thats out, I have seen where you can remote into a PC using powershell but PSRemoting isn't enabled on the PCs. I could go around and enable it but if I'm going to do that I might as well just install the software. Also the installer they gave me to use is a batch file (to set up the config too). Its not a very big piece of software and it is stored on a network drive.

Really all I need is a way to install software remotely without logging the user out. If you guys know of a way I can do this with powershell or can point me to some windows feature that can do this that would be awesome.

Oh and btw most of the PCs are Win7 enterprise, only a couple are XP and I'm probably going to have to do those by hand anyway.

Thanks in advance,

Trenton

Edit: I could possibly set up a virtual server if that would help any
  • Edited by Teppers Thursday, December 27, 2012 7:29 PM more info
December 27th, 2012 7:24pm

I would recommend you spend a bit of time getting the windows remoting set up on your PCs.

It will save you a lot of time going forward.... and make this task much easier.

You can use group policy to set it up. I used PSExec to enable it on each of my machines.

First, you need a list of your computers... .txt file would be best

Create a loop to read each hostname from the .txt file

Copy the executable to each PC.

Use WMI to run the executable remotely.

Hopefully, the program you're installing allows a silent, non-interactive install.

$computers=Get-Content 'c:\temp\computers.txt'

ForEach($computer in $computers){

if(!(test-path \\$computer\c$\Temp)){md \\$computer\c$\Temp} copy <path to software installer> \\$computer\c$\temp $newProc=([WMICLASS]"\\$computer\root\cimv2:win32_Process").Create("c:\temp\<software installer> <arguments>") If ($newProc.ReturnValue -eq 0) { Write-Host $newProc.ProcessId } else { write-host Process create failed with $newProc.ReturnValue }

}

You'll have to experiment with the actual command and arguments to enable a silent install.

Free Windows Admin Tool Kit Click here and download it now
December 27th, 2012 9:21pm

why we getting followng when run ( file copied to temp)


PS C:\Scripts\software> C:\Scripts\software\rinstall02.ps1


    Directory: \\WIN7TEST-PC\c$


Mode                LastWriteTime     Length Name                                                                                        
----                -------------     ------ ----                                                                                        
d----        24/04/2015   3:07 PM            Temp                                                                                        
Process create failed with 8


April 24th, 2015 1:11am

why we getting followng when run ( file copied to temp)


PS C:\Scripts\software> C:\Scripts\software\rinstall02.ps1


    Directory: \\WIN7TEST-PC\c$


Mode                LastWriteTime     Length Name                                                                                        
----                -------------     ------ ----                                                                                        
d----        24/04/2015   3:07 PM            Temp                                                                                        
Process create failed with 8


Free Windows Admin Tool Kit Click here and download it now
April 24th, 2015 1:13am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics