October 22, 2025 at 3:04 pm
The SQLPS.exe file has gone AWOL on 2 of my 4 SQL servers, ie, not in the path
select Agent_exe
from msdb.dbo.syssubsystems
where subsystem = 'PowerShell'
nor anywhere to be found on these machines.
As a result, syspolicy_purge_history fails. And in fact, the job's status is "suspended", and I can't even stop it. I am not able to stop and re-start the SQL Agent service, due to the job being suspended.
Any ideas?
October 23, 2025 at 7:23 am
I would restart the full server ( OS )
I've seen this happening on some of our SQL2008R2 instances on very rare occasions
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data and code to get the best help
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
October 23, 2025 at 3:42 pm
A reboot often fixes things like this. As Johan noted, reboot the OS, not just restart the SQL service.
Any updates added differently, Windows updates or patches?
October 31, 2025 at 1:43 pm
We'll be rebooting the machines this evening weekend, hopefully that helps.
Thanks
October 31, 2025 at 5:32 pm
Almost certainly OS updates - we no longer control that aspect of our servers.
But I find it weird that the files are just...gone without a trace on 2 out of 4 machines.
November 3, 2025 at 5:30 pm
Predictably, the job was terminated. When it next ran, the same situation obtained, for the same reason: missing SQLPS.exe.
November 4, 2025 at 3:35 pm
You might try reinstalling: https://learn.microsoft.com/en-us/powershell/sql-server/download-sql-server-ps-module?view=sqlserver-ps
November 5, 2025 at 12:28 pm
Solved:
script the job out as Drop and Create
replace the SQLPS code with standard Powershell and call it as an OS command.
November 5, 2025 at 12:59 pm
ah, that is indeed how I run most of my Posh scripts with sqlagent.
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data and code to get the best help
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
November 5, 2025 at 11:37 pm
Same. I am very untrusting of the PoSh option as a shell choice. Has always felt a little under-implemented.
Glad it's working for you
November 5, 2025 at 11:37 pm
Same. I am very untrusting of the PoSh option as a shell choice. Has always felt a little under-implemented.
Glad it's working for you
Viewing 11 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply