Wednesday 10 October 2012

PSEXEC to Run an EXE Remotely


Problem I had at work was to remotely execute a exe file, in this case it was an software auditing executable called auditscanner.exe on machines on our network. Some machines do not get turned off, so it wont run during login on my login scripts.

Using psexec.exe

technet.microsoft.com/en-us/sysinternals/bb842062

 

psexec.exe @10.10.2hosts.txt -u Domain\Admin_account -p PASSWORD "\\fileserver\shared\audit\scanner\AuditScanner.exe" >audit10.2SRV.txt

 

the 10.10.2host.txt is just a text file with



10.10.2.2

10.10.2.3

10.10.2.4

.


.

10.10.2.255


The audit10.2SRV.txt is just a output text result.



 

Contents of 10.10.2.host.txt file ( copy past into notepad, save as txt file - you can use find replace to get any range you need )

10.10.2.2

10.10.2.3

10.10.2.4

10.10.2.5

10.10.2.6

10.10.2.7

10.10.2.8

10.10.2.9

10.10.2.10

10.10.2.11

10.10.2.12

10.10.2.13

10.10.2.14

10.10.2.15

10.10.2.16

10.10.2.17

10.10.2.18

10.10.2.19

10.10.2.20

10.10.2.21

10.10.2.22

10.10.2.23

10.10.2.24

10.10.2.25

10.10.2.26

10.10.2.27

10.10.2.28

10.10.2.29

10.10.2.30

10.10.2.31

10.10.2.32

10.10.2.33

10.10.2.34

10.10.2.35

10.10.2.36

10.10.2.37

10.10.2.38

10.10.2.39

10.10.2.40

10.10.2.41

10.10.2.42

10.10.2.43

10.10.2.44

10.10.2.45

10.10.2.46

10.10.2.47

10.10.2.48

10.10.2.49

10.10.2.50

10.10.2.51

10.10.2.52

10.10.2.53

10.10.2.54

10.10.2.55

10.10.2.56

10.10.2.57

10.10.2.58

10.10.2.59

10.10.2.70

10.10.2.61

10.10.2.62

10.10.2.63

10.10.2.64

10.10.2.65

10.10.2.66

10.10.2.67

10.10.2.68

10.10.2.69

10.10.2.70

10.10.2.71

10.10.2.72

10.10.2.73

10.10.2.74

10.10.2.75

10.10.2.76

10.10.2.77

10.10.2.78

10.10.2.79

10.10.2.80

10.10.2.81

10.10.2.82

10.10.2.83

10.10.2.84

10.10.2.85

10.10.2.86

10.10.2.87

10.10.2.88

10.10.2.89

10.10.2.90

10.10.2.91

10.10.2.92

10.10.2.93

10.10.2.94

10.10.2.95

10.10.2.96

10.10.2.97

10.10.2.98

10.10.2.99

10.10.2.100

10.10.2.101

10.10.2.102

10.10.2.103

10.10.2.104

10.10.2.105

10.10.2.106

10.10.2.107

10.10.2.108

10.10.2.109

10.10.2.110

10.10.2.111

10.10.2.112

10.10.2.113

10.10.2.114

10.10.2.115

10.10.2.116

10.10.2.117

10.10.2.118

10.10.2.119

10.10.2.120

10.10.2.121

10.10.2.122

10.10.2.123

10.10.2.124

10.10.2.125

10.10.2.126

10.10.2.127

10.10.2.128

10.10.2.129

10.10.2.130

10.10.2.131

10.10.2.132

10.10.2.133

10.10.2.134

10.10.2.135

10.10.2.136

10.10.2.137

10.10.2.138

10.10.2.139

10.10.2.140

10.10.2.141

10.10.2.142

10.10.2.143

10.10.2.144

10.10.2.145

10.10.2.146

10.10.2.147

10.10.2.148

10.10.2.149

10.10.2.150

10.10.2.151

10.10.2.152

10.10.2.153

10.10.2.154

10.10.2.155

10.10.2.156

10.10.2.157

10.10.2.158

10.10.2.159

10.10.2.160

10.10.2.161

10.10.2.162

10.10.2.163

10.10.2.164

10.10.2.165

10.10.2.166

10.10.2.167

10.10.2.168

10.10.2.169

10.10.2.170

10.10.2.171

10.10.2.172

10.10.2.173

10.10.2.174

10.10.2.175

10.10.2.176

10.10.2.177

10.10.2.178

10.10.2.179

10.10.2.180

10.10.2.181

10.10.2.182

10.10.2.183

10.10.2.184

10.10.2.185

10.10.2.186

10.10.2.187

10.10.2.188

10.10.2.189

10.10.2.190

10.10.2.191

10.10.2.192

10.10.2.193

10.10.2.194

10.10.2.195

10.10.2.196

10.10.2.197

10.10.2.198

10.10.2.199

10.10.2.200

10.10.2.201

10.10.2.202

10.10.2.203

10.10.2.204

10.10.2.205

10.10.2.206

10.10.2.207

10.10.2.208

10.10.2.209

10.10.2.210

10.10.2.211

10.10.2.212

10.10.2.213

10.10.2.214

10.10.2.215

10.10.2.216

10.10.2.217

10.10.2.218

10.10.2.219

10.10.2.220

10.10.2.221

10.10.2.222

10.10.2.223

10.10.2.224

10.10.2.225

10.10.2.226

10.10.2.227

10.10.2.228

10.10.2.229

10.10.2.230

10.10.2.231

10.10.2.232

10.10.2.233

10.10.2.234

10.10.2.235

10.10.2.236

10.10.2.237

10.10.2.238

10.10.2.239

10.10.2.240

10.10.2.241

10.10.2.242

10.10.2.243

10.10.2.244

10.10.2.245

10.10.2.246

10.10.2.247

10.10.2.248

10.10.2.249

10.10.2.250

10.10.2.251

10.10.2.252

10.10.2.253

10.10.2.254

No comments:

Post a Comment