Pstools issues - urgent

EssendonEssendon Member Posts: 4,548 ■■■■■■■■■■
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:
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!
NSX, NSX, more NSX..

Blog >> http://virtual10.com

Comments

  • blargoeblargoe Self-Described Huguenot NC, USAMember Posts: 4,172 ■■■■■■■■■□
    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...
  • ptilsenptilsen 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.
    Working B.S., Computer Science
    Complete: 55/120 credits SPAN 201, LIT 100, ETHS 200, AP Lang, MATH 120, WRIT 231, ICS 140, MATH 215, ECON 202, ECON 201, ICS 141, MATH 210, LING 111, ICS 240
    In progress: CLEP US GOV,
    Next up: MATH 211, ECON 352, ICS 340
  • paul78paul78 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.
  • EssendonEssendon Member Posts: 4,548 ■■■■■■■■■■
    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.
    NSX, NSX, more NSX..

    Blog >> http://virtual10.com
  • AlexNguyenAlexNguyen Member Posts: 359
    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.
  • ptilsenptilsen 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.
    Working B.S., Computer Science
    Complete: 55/120 credits SPAN 201, LIT 100, ETHS 200, AP Lang, MATH 120, WRIT 231, ICS 140, MATH 215, ECON 202, ECON 201, ICS 141, MATH 210, LING 111, ICS 240
    In progress: CLEP US GOV,
    Next up: MATH 211, ECON 352, ICS 340
  • EssendonEssendon Member Posts: 4,548 ■■■■■■■■■■
    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.
    NSX, NSX, more NSX..

    Blog >> http://virtual10.com
  • ptilsenptilsen 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.
    Working B.S., Computer Science
    Complete: 55/120 credits SPAN 201, LIT 100, ETHS 200, AP Lang, MATH 120, WRIT 231, ICS 140, MATH 215, ECON 202, ECON 201, ICS 141, MATH 210, LING 111, ICS 240
    In progress: CLEP US GOV,
    Next up: MATH 211, ECON 352, ICS 340
  • EssendonEssendon Member Posts: 4,548 ■■■■■■■■■■
    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.
    NSX, NSX, more NSX..

    Blog >> http://virtual10.com
  • AlexNguyenAlexNguyen Member Posts: 359
    Essendon wrote: »
    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.
    Did you use the same user account (service-hpdp_ll) when you run your script outside DP ? Login with that user account and try to run your script.

    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>&1
    Knowledge has no value if it is not shared.
    Knowledge can cure ignorance, but intelligence cannot cure stupidity.
  • EssendonEssendon Member Posts: 4,548 ■■■■■■■■■■
    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.
    NSX, NSX, more NSX..

    Blog >> http://virtual10.com
  • AlexNguyenAlexNguyen Member Posts: 359
    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.
  • EssendonEssendon Member Posts: 4,548 ■■■■■■■■■■
    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.
    NSX, NSX, more NSX..

    Blog >> http://virtual10.com
  • AlexNguyenAlexNguyen Member Posts: 359
    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.
Sign In or Register to comment.