Pstools issues - urgent
Can some please shed some light on why I cannot stop a particular service running on a physical Windows Server 2003 R2 SP1 box?
Here's the situation.
I have Data Protector as my backup software (dont use it, run far, far away from it, BTW) and I have pre-exec and post-exec scripts to shutdown some services before I kick off backups for an OpenText document management system called Livelink. I had Pstools from 2004 which had no problems with shutting down services on physical Windows Server 2003 R2 SP1 boxes. That version of Pstools could not stop services on Windows Server 2008 R2 datacenter servers, so I thought let's upgrade Pstools to the latest version and lo and behold I could stop services on my Windows Server 2008 R2 servers. But this version cannot stop Livelink services on the physical Windows Server 2003 R2 SP1 boxes! It can stop any other service, say the spooler service, but not Livelink services. The logs just say
psservice unable to connect to \\<FQDN of server>
Here's the relevant portion of the script:
I have tried the server's unqualified domain name with the same result. The account I am using to stop the services is a local admin on the server and the Data Protector account is a member of the Domain Admin group. I can telnet on port 135 and 445 with no issues, Windows firewall is off. The physical server in question has been rebooted just yesterday (as part of a different change).
Someone please help!
Here's the situation.
I have Data Protector as my backup software (dont use it, run far, far away from it, BTW) and I have pre-exec and post-exec scripts to shutdown some services before I kick off backups for an OpenText document management system called Livelink. I had Pstools from 2004 which had no problems with shutting down services on physical Windows Server 2003 R2 SP1 boxes. That version of Pstools could not stop services on Windows Server 2008 R2 datacenter servers, so I thought let's upgrade Pstools to the latest version and lo and behold I could stop services on my Windows Server 2008 R2 servers. But this version cannot stop Livelink services on the physical Windows Server 2003 R2 SP1 boxes! It can stop any other service, say the spooler service, but not Livelink services. The logs just say
psservice unable to connect to \\<FQDN of server>
Here's the relevant portion of the script:
cd c:\pstools\ date /t >> c:\pstools\livelink97.logs time /t >> c:\pstools\livelink97.logs net use \\<server name>\ipc$ /u:-service-hpdp_ll <password> psservice \\<server name> stop "Livelink Server Livelink1" >> c:\pstools\livelink97.logs
I have tried the server's unqualified domain name with the same result. The account I am using to stop the services is a local admin on the server and the Data Protector account is a member of the Domain Admin group. I can telnet on port 135 and 445 with no issues, Windows firewall is off. The physical server in question has been rebooted just yesterday (as part of a different change).
Someone please help!
Comments
-
blargoe Member Posts: 4,174 ■■■■■■■■■□Can you do something like psexec into the server remotely, and pass a net stop <servicename> command?IT guy since 12/00
Recent: 11/2019 - RHCSA (RHEL 7); 2/2019 - Updated VCP to 6.5 (just a few days before VMware discontinued the re-cert policy...)
Working on: RHCE/Ansible
Future: Probably continued Red Hat Immersion, Possibly VCAP Design, or maybe a completely different path. Depends on job demands... -
ptilsen Member Posts: 2,835 ■■■■■■■■■■That was my immediate reaction as well, Blargoe.
Verify that it is or is not just psservice. Use psexec to issue a net stop. If that doesn't work, issue a taskkill /f. -
paul78 Member Posts: 3,016 ■■■■■■■■■■Try explicitly setting the credentials when calling psservice with the -u and -p parameteres. If you use -u option, try both a local and domain account to see if it's an authentication issue.
Can you authenticate against the $admin share on the remote server? Try doing that first with a "net use [URL="file://\\host\admin$ /user:"]\\host\admin$ /user:[/URL][username] to see if you can connect instead of the ipc$ share. -
Essendon Member Posts: 4,546 ■■■■■■■■■■Thanks for replying guys. Since I cannot shutdown prod services during business hours, I have modified my script (psexec instead of psservice) and will give it a shot when my backup window rolls around this weekend. Will let you know.
-
AlexNguyen Member Posts: 358 ■■■■□□□□□□Best practices say you should have at least a pre-production environment and/or a test environment. You should not test directly in a production environment. Hey, you have an ITIL cert !Knowledge has no value if it is not shared.
Knowledge can cure ignorance, but intelligence cannot cure stupidity. -
ptilsen Member Posts: 2,835 ■■■■■■■■■■The problem or need might not be reproducible in the test environment. The reality is that it's all but impossible to truly replicate real-world conditions in a test environment. Don't take that as an argument against test environments -- I'm just saying there might be a good reason he can't do this in a test environment.
-
Essendon Member Posts: 4,546 ■■■■■■■■■■Ah a test/pre-prod environment!! Well there's one, but it doesnt have the full shabang that exists in the prod environment. This really is half the problem with this system.
****
Awright, an update guys.
Now I have replaced psservice with psexec but the problem still remains. But I have been able to narrow down the problem to an issue within Data Protector. When I ran my script last night from outside DP, it worked a treat and the services gracefully shutdown. When run within DP, it cannot execute. It can map the ipc$ share but the moment it comes to the first psexec command, it doesnt go any further.
So within DP, it doesnt work. Outside of DP, the script works. Like I said before the DP service account is a Domain Admin account, so no problems there. I'll let you know how I go.
***
Also I cannot use a taskkill /f because that isnt graceful and the client doesnt want services to be terminated. -
ptilsen Member Posts: 2,835 ■■■■■■■■■■Does data protector use a VSS writer? If so (it almost certainly is so), certain applications might not be able to shut down gracefully while it is operating. Your best bet would be to time things so that DP is not running when you need your script to run. Alternatively, you could stop DP, run your script, then restart DP (or alter the script to include starting/stopping DP). We have the same issue with ShadowProtect (also uses VSS writers, as most backups will). We have to time Exchange maintenance around the backups or it will never complete online defragmentations.
-
Essendon Member Posts: 4,546 ■■■■■■■■■■Yep DP uses a VSS writer but I have backups and copy jobs running from 7pm-7am (that's the window) just about non-stop. I can see your idea about stopping DP services and then running the script but I need to bring the services back up too. I could set up a batch file in a scheduled task to bring the application's services back up but what if one night the backup took longer to run and the scheduled task did its thing to bring the services online - all hell would break loose when I get back in the next morning!! The app reportedly runs the risk of data corruption if services are online during backups. I'll get back to you shortly mate, thank you (and others too) for the valuable troubleshooting. I have learnt a thing or two from this thread.
-
AlexNguyen Member Posts: 358 ■■■■□□□□□□When I ran my script last night from outside DP, it worked a treat and the services gracefully shutdown. When run within DP, it cannot execute. It can map the ipc$ share but the moment it comes to the first psexec command, it doesnt go any further.
Also try this:
1) On the Livelink server, create a batch file, for example c:\StopLL.cmd
2) In the batch file, add the following lines:
NET STOP "Livelink Server Livelink1"
EXIT
3) On your script, replace "psservice" with the following line:
PSEXEC \\<server name> CMD /C C:\StopLL.cmd >>c:\pstools\livelink97.logs 2>&1Knowledge has no value if it is not shared.
Knowledge can cure ignorance, but intelligence cannot cure stupidity. -
Essendon Member Posts: 4,546 ■■■■■■■■■■Alex, yes I ran the script using that account.
I have made a change to the script and if it doesnt work out I'll try your thing too. -
AlexNguyen Member Posts: 358 ■■■■□□□□□□What's the error message in the log file ? (since you add "2>&1" in the script)Knowledge has no value if it is not shared.
Knowledge can cure ignorance, but intelligence cannot cure stupidity. -
Essendon Member Posts: 4,546 ■■■■■■■■■■Quick update guys. Since I couldnt muck around with the production system for too long, I decided to cut out the process for bringing down the services remotely. I have resorted to using a scheduled task locally to bring the services down. Know what the weird thing is? The services can be brought up remotely, but there seems to be a problem with bringing them down.
I worked on this for a week, and the local scheduled task is the only thing that works, so be it. Thanks a ton though everyone, I learned a fair bit in the process. -
AlexNguyen Member Posts: 358 ■■■■□□□□□□Instead of using scheduled task, you can try this:
1) On the Livelink server, use "eventtriggers /create" to monitor for an eventid 9999 for example. When that eventid occurred, execute a batch file to stop the service.
2) In the Data Protector script, use "eventcreate" to create an eventid 9999 on the Livelink server.Knowledge has no value if it is not shared.
Knowledge can cure ignorance, but intelligence cannot cure stupidity.