Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / General / Security / July 2007

Tip: Looking for answers? Try searching our database.

SQL Server Agent Job running a C# Command Line Program

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Carl Nestingen - 30 Jul 2007 22:18 GMT
I am having a technical problem.  I wrote a C# Command line program Visual
Studio 2005 that will read Active Directory information and will write the
results to a SQL Server 2005 database.  The program runs fine when I run it
from the Command Prompt but if I run this program from the SQL Server 2005
Agent Job the program fails but does not give any error.  I have a
Credentials setup on the SQL Server that runs the job and also the Proxies
are setup on the SQL Server Agent to use the credentials for "Operating
System (CmdExec)".  Can anyone help me figure out how run this program as  
SQL 2005 Agent Job?
Uri Dimant - 31 Jul 2007 07:26 GMT
Carl
The account SQL Server Agent run under should have permission to query AD. I
suggest you also specify an output file within a JOB to see the error.

>I am having a technical problem.  I wrote a C# Command line program Visual
> Studio 2005 that will read Active Directory information and will write the
[quoted text clipped - 6 lines]
> System (CmdExec)".  Can anyone help me figure out how run this program as
> SQL 2005 Agent Job?
Carl Nestingen - 31 Jul 2007 14:26 GMT
Thanks for the reply.  I am running the SQL Agent job as CMDSQLAdmin (using
Credentials and Job Proxy) CDMSQLAdmin has rights to read AD and write to the
SQL Server in fact when I log in to CDMSQLPRD2 (SQL Server machine which is
where the Agent Job runs) as CDMSQLAdmin and I can run the C# program just
fine from a Command Prompt.  I set up the SQL Agent job to have both of the
following.

In the Command:
C:\DbaDeploy\bin\DBA.ETLSecurity.Cmd.ActivityDirectory\DBA.ETLSecurity.Cmd.ActiveDirectory.exe
> C:\DbaDeploy\SSIS\Log\DBA.ETLSecurity.Cmd.ActiveDirectory.log 2>&1

In the Advanced tab (Output file field):
C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\LOG\DBA.ETLSecurity.Cmd.ActiveDirectory.log

But nothing shows up in either of these output files.  

Also the history of the job just states that the job fails.  The job
histored does show that the job was run as CDMSQLAdmin which is correct.

> Carl
> The account SQL Server Agent run under should have permission to query AD. I
[quoted text clipped - 10 lines]
> > System (CmdExec)".  Can anyone help me figure out how run this program as
> > SQL 2005 Agent Job?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.