Sync-DbaAvailabilityGroup Not working from a SQL Server agent job - sql

I'm using Sync-DbaAvailabilityGroup to sync jobs and user logins across my avaiablility groups. When I run the Powershell script from powershell it works as expected, however; when I run it from a SQL Server Agent job it succeeds but don't copy any jobs or users over.

Related

Azure SQL Managed Instance - Agent Jobs wont run

What's the 'trick' to run jobs on a Sql Managed Instance with Sql Server and Windows Auth enabled and login authentication set to Azure Active Dir - universal with MFA?
SQL Server Agent jobs created by our dba's are failing with
'Executed as user: DBC40\AasdfppEWawer. Login Failed. The login is from an untrusted domain and cannot be used with integrated authentication. [sqlstate 28000](Error 18452).'
Tried specifying the user to run the job under - same outcome
Tried specifying the user to run the step under - same outcome
We installed the OLA tools with no issues, those jobs run just fine.
rm

SQL Server Agent Not Scheduling

I am running SQL Server Standard (linux) in a docker container and the Agent is not working to any schedule (recurring, one time).
The agent itself works, I have programmed a couple jobs which are completing successfully. However, the jobs do not even start when I activate the schedule meaning there isn't even an error message to review or record in the job activity monitor. Below is my configuration:
sql server job properties
I corrected the timezone issue by passing the proper environment variable, America/Toronto did not not pass properly, so I used America/New_York.

Running batch file in ssis SQl Agent job

Scheduled a SSIS package on my Sql Server Agent, when i go to the Job History it says the Job succeded for the time it was scheduled to run, but im noticing the Job does nothing, i mean the Package is running but it's not doing what it is supossed to do.
I know the Package works because when i go to the BI Studio and rightclick>Execute Package it works.
Could be a security issue. Agent jobs run as the Agent Service Account, so you want to make sure that account has correct permissions in the database or else you will need to create an SSIS proxy to run the job.

SQL Server Agent start and stop script which can be run by normal user not system admin

I have created couple of jobs in SQL Server Agent. Now I need to deploy these jobs on client machines. Client SQL Servers don't have system admin login.
What I want to do is to let normal SQL login (not system admin) users run the start and stop SQL Agent Service script.
You could create a stored procedure with execute as owner. That procedure will run as system admin and can start and stop jobs with sp_start_job.
You can then give normal users execute rights on the stored procedure. That will allow them to start/stop jobs.

How to start SQL Server agent jobs automatically

I am writing PowerShell scripts to control SQL Server agent start/stop to ensure all the contained jobs runs according to defined schedule. I want to make sure that the only thing I need to do is to start the SQL Server Agent Windows Service, and then all the contained SQL Server Jobs will run automatically according to defined schedule? No need to control each job's start/stop specifically?
I am using SQL Server 2008 on Windows Server 2003.
thanks in advance,
George
When you start SQL Server Agent all jobs (if they are not disabled) will run automatically and it's no need to control each job. Just make sure that jobs are enabled.