We help IT Professionals succeed at work.

Powershell

JCJohnson76
JCJohnson76 asked
on
185 Views
Last Modified: 2016-09-09
I will like to run a exe located in a particular directory.  After exe is performed I will like then to a restart a service.  

I will like to run this exe on all Domain Controllers in my environment.  Does anyone know how to performed this in Powershell.

The cmdlets I will like to use for the DC's are "Get-ADDomainControllers"

The user the foreach statement.

Example of directory: Path of the exe;  Filename of exe (watchdog.exe)


Can someone please provide the syntax for this
D:\Program files\Monitor\
Comment
Watch Question

FOXActive Directory/Exchange Engineer
CERTIFIED EXPERT
Top Expert 2015

Commented:
Is the .exe sitting on each domain controller?

Author

Commented:
yes; same path
FOXActive Directory/Exchange Engineer
CERTIFIED EXPERT
Top Expert 2015
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
does not work;

Lets use another example

Lets say Systernal "pskill" is locate under the c:\tools\    This path is located on all DC's

And I have notepad running on all DC"s and I want to use pskill to kill this process.  How would I be able to do it using Get-ADDomaincontrollers
IT Infrastructure Architect
CERTIFIED EXPERT
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
Subsun,

Thanks, it worked a like a charm