Link to home
Start Free TrialLog in
Avatar of JCJohnson76
JCJohnson76

asked on

Powershell

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\
Avatar of FOX
FOX
Flag of United States of America image

Is the .exe sitting on each domain controller?
Avatar of JCJohnson76
JCJohnson76

ASKER

yes; same path
SOLUTION
Avatar of FOX
FOX
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Subsun,

Thanks, it worked a like a charm