Monthly Archives: February 2021

Scheduled Task “The task image is corrupt or has been tampered with”

When opening task scheduler I was faced with the error “Task User_Feed_Synchronization-{20EECAD6-F054-4C21-B0F6-EC6DA-99BD2C8}: The task image is corrupt or has been tampered with.”



“Task ServerCeipAssistant: The task image is corrupt or has been tampered with.”


There are a number of locations the corrupt task can be stored:



HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft

Looking at the data stored in these two locations it should be enough information to delete and recreate the task.


List table sizes in SQL

I needed to get a list of table sizes from SQL to find out why a database was excessively large.  I used the following:

CREATE TABLE #RowCountsAndSizes (TableName NVARCHAR(128), rows CHAR(11), reserved VARCHAR(18), data VARCHAR(18), index_size VARCHAR(18), unused VARCHAR(18))

EXEC sp_MSForEachTable ‘INSERT INTO #RowCountsAndSizes EXEC sp_spaceused ”?” ‘

SELECT TableName, CONVERT(bigint, rows) AS NumberOfRows, CONVERT(bigint, left(reserved, len(reserved)-3)) AS SizeinKB

FROM #RowCountsAndSizes

ORDER BY NumberOfRows DESC, SizeinKB DESC, TableName

DROP TABLE #RowCountsAndSizes

Allow non admins to manage RDS connection

I had a server 2016 RDS server using a combination of Terminal Servers and remoteapps, and we had a user that wanted the ability to log users off.  The user in question was not a local admin on the server, so I created an AD group, added her and ran the following command from an elevated prompt on the RDS Server:

wmic /namespace:\\root\CIMV2\TerminalServices PATH Win32_TSPermissionsSetting WHERE (TerminalName=”RDP-Tcp”) CALL AddAccount “anonit\USR-SEC-AllowRDSLogoff”,2

Where anonit\USR-SEC_AllowRDSLogoff is the group that would have permission to logoff users.


This ONLY takes affect once the accounts have logged in.  eg:  User1 is the kicker and User2 is the kickee.  Once I’ve modified the server, User1 doesn’t have permission to log User2 out until User2 has initiated a new logon session.


References: (explains the magic number 2)