![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Running External Application I am trying to get powershell to read an OU in AD and install a program on each computer in that OU...i have it where it will show all the computers in the OU and "connect" to them but the application gets executed on all of them at once and doesnt work...i need to figure out how to stager it i guess. Maybe get it to where it runs on one and completes and then the next and completes and then the next and completes....etc |
My System Specs![]() |
| | #2 (permalink) |
| | RE: Running External Application You could create a loop that would check to see if the process you started is still running. Something like this: do { Start-Sleep 20 } while ((Get-WMIObject -Query "SELECT * FROM Win32_Process WHERE Name = 'setup.exe'" -Computer $strComputer | Measure-Object).Count -gt 0) You would have to replace "setup.exe" with what ever your install process executable is and $strComputer with whatever variable you are using for the computer name. -= IJuan =- "Jonathan P" wrote: > I am trying to get powershell to read an OU in AD and install a > program on each computer in that OU...i have it where it will show all the > computers in the OU and "connect" to them but the application gets executed > on all of them at once and doesnt work...i need to figure out how to stager > it i guess. > > Maybe get it to where it runs on one and completes and then the next and > completes and then the next and completes....etc |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Running External Application What are you using to install remotely? Are you using start-process? If you use psexec.exe it will just work as you requested. I do it all the time. "Jonathan P" <JonathanP@discussions.microsoft.com> wrote in message news:6C34236D-19C3-4D07-A677-5CEE2FFECA0A@microsoft.com... >I am trying to get powershell to read an OU in AD and install a > program on each computer in that OU...i have it where it will show all the > computers in the OU and "connect" to them but the application gets > executed > on all of them at once and doesnt work...i need to figure out how to > stager > it i guess. > > Maybe get it to where it runs on one and completes and then the next and > completes and then the next and completes....etc |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Running External Application psexec is what i would like to use but i couldnt get it to work...how do you usually do it? "Brandon Shell" wrote: > What are you using to install remotely? Are you using start-process? If you > use psexec.exe it will just work as you requested. I do it all the time. > > "Jonathan P" <JonathanP@discussions.microsoft.com> wrote in message > news:6C34236D-19C3-4D07-A677-5CEE2FFECA0A@microsoft.com... > >I am trying to get powershell to read an OU in AD and install a > > program on each computer in that OU...i have it where it will show all the > > computers in the OU and "connect" to them but the application gets > > executed > > on all of them at once and doesnt work...i need to figure out how to > > stager > > it i guess. > > > > Maybe get it to where it runs on one and completes and then the next and > > completes and then the next and completes....etc > > |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Running External Application I use something like. You can add any switches to the $cmd function Install-Application { Param([string]$srv,[string]$installer) $PSExecPath = "c:\tools\psexec.exe" $InstallCommandPath = "c:\tools" $RemoteInstallPath = "c:\install" $cmd = "$cmdPath \\$srv $LocalInstallPath\$installer" Write-Host "Running $cmd on $srv" if(test-Path \\$server\c$\install){ copy-Item "$InstallCommandPath\$installer" -destination "\\$srv\$RemoteInstallPath\$installer" invoke-Expression $cmd | out-Null } else{ New-Item -path \\$srv\c$ -name install -type directory | out-Null copy-Item "$InstallCommandPath\$installer" -destination "\\$srv\$RemoteInstallPath\$installer" invoke-Expression $cmd | out-Null } } "Jonathan P" <JonathanP@discussions.microsoft.com> wrote in message news:00BA11E9-B812-4CAC-9892-3A2C8234B042@microsoft.com... > psexec is what i would like to use but i couldnt get it to work...how do > you > usually do it? > > > > "Brandon Shell" wrote: > >> What are you using to install remotely? Are you using start-process? If >> you >> use psexec.exe it will just work as you requested. I do it all the time. >> >> "Jonathan P" <JonathanP@discussions.microsoft.com> wrote in message >> news:6C34236D-19C3-4D07-A677-5CEE2FFECA0A@microsoft.com... >> >I am trying to get powershell to read an OU in AD and install a >> > program on each computer in that OU...i have it where it will show all >> > the >> > computers in the OU and "connect" to them but the application gets >> > executed >> > on all of them at once and doesnt work...i need to figure out how to >> > stager >> > it i guess. >> > >> > Maybe get it to where it runs on one and completes and then the next >> > and >> > completes and then the next and completes....etc >> >> |
My System Specs![]() |
| | #6 (permalink) |
| | Re: Running External Application btw... I miss typed $RemoteInstallPath = "c:\install" should be $RemoteInstallPath = "c$\install" "Brandon Shell" <tshell.mask@gmail.com> wrote in message news:Ose8Qi3hHHA.4732@TK2MSFTNGP03.phx.gbl... >I use something like. You can add any switches to the $cmd > > function Install-Application { > Param([string]$srv,[string]$installer) > $PSExecPath = "c:\tools\psexec.exe" > $InstallCommandPath = "c:\tools" > $RemoteInstallPath = "c:\install" > $cmd = "$cmdPath \\$srv $LocalInstallPath\$installer" > Write-Host "Running $cmd on $srv" > if(test-Path \\$server\c$\install){ > copy-Item "$InstallCommandPath\$installer" -destination > "\\$srv\$RemoteInstallPath\$installer" > invoke-Expression $cmd | out-Null > } > else{ > New-Item -path \\$srv\c$ -name install -type directory | out-Null > copy-Item "$InstallCommandPath\$installer" -destination > "\\$srv\$RemoteInstallPath\$installer" > invoke-Expression $cmd | out-Null > } > } > > "Jonathan P" <JonathanP@discussions.microsoft.com> wrote in message > news:00BA11E9-B812-4CAC-9892-3A2C8234B042@microsoft.com... >> psexec is what i would like to use but i couldnt get it to work...how do >> you >> usually do it? >> >> >> >> "Brandon Shell" wrote: >> >>> What are you using to install remotely? Are you using start-process? If >>> you >>> use psexec.exe it will just work as you requested. I do it all the time. >>> >>> "Jonathan P" <JonathanP@discussions.microsoft.com> wrote in message >>> news:6C34236D-19C3-4D07-A677-5CEE2FFECA0A@microsoft.com... >>> >I am trying to get powershell to read an OU in AD and install a >>> > program on each computer in that OU...i have it where it will show all >>> > the >>> > computers in the OU and "connect" to them but the application gets >>> > executed >>> > on all of them at once and doesnt work...i need to figure out how to >>> > stager >>> > it i guess. >>> > >>> > Maybe get it to where it runs on one and completes and then the next >>> > and >>> > completes and then the next and completes....etc >>> >>> > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Problem running studio.net application in 64 | Software | |||
| Can you run all 32 bit application in a 64 bit system running vista? | General Discussion | |||
| Running Application in Login Script | Vista security | |||
| Running older Application on Vista | Vista General | |||