Earlier today I received the following error in SCOM 2012 SP1 when trying to open a Run As Account in order to add a new server for distribution
“Specified cast is not valid”
Clicking ok on the error brings up the run as properties but the distribution list is empty.
This error seems to be caused when an agent is deleted from the console and doesn’t get removed properly from the run as distribution. If you are able to, re-approving the agent does fix the error allowing you to remove that device from distribution before deleting it again.
However if the server is no longer availible (due to being decomissioned or just plain crashing) the following steps, courtesy of Blake Wilson will help:
- Create a list of your servers which use the affected Run As Account.
- Rename the current Run As Account to “Run as Account – Old” or similar.
- Created a new Run As Account with the name and credentials of the orgional, then distribute to all of the servers from step 1.
- Assign the new Run As Account to all of the Run as Profiles associated with the origional one. The easiest way is to edit the existing entry and select the new Run As Account.
- Once you’ve confirmed everything is working you can safely remove the old Run As Account.