GRANT VIEW SERVER STATE TO codeQuery
GRANT EXECUTE ON [sp_GetsAMAccount] TO [ADautmationAccountInMaster]
x