Showing posts with label service. Show all posts
Showing posts with label service. Show all posts

Monday, March 19, 2012

Active Directory Service And IIS Problem

I have a ASP.Net Project to read active directory usernames.

Its working fine when running thru asp development server.

But while running thru IIS Server. It displays the following error

"An exception of type 'System.DirectoryServices.DirectoryServicesCOMException' occurred in System.DirectoryServices.dll but was not handled in user code
Additional information: Logon failure: unknown user name or bad password."

This is my Code :

Public Function readADSusers()
Dim enTry As DirectoryEntry = New DirectoryEntry("LDAP://spiretek.local")
Dim mySearcher As DirectorySearcher = New DirectorySearcher(enTry)
mySearcher.Filter = ("(objectClass=user)")
Dim resEnt As SearchResult
For Each resEnt In mySearcher.FindAll()
Select Case myKey
Case "samaccountname"
TextBox1.Text += myResultPropColl(myKey)(0)
End Select
Next
End Function

Please Help Me......This is not the right forum for this, but you will have to provide network credentials (either the current the process is running with or custom ones) to access the active directory.

Jens K. Suessmeyer.

http://www.sqlserver2005.de

Active Directory Helper service aborting upon startup

On a fairly new install of SQL 2005 64-bit, upon bootup the Active Directory Helper Serivice is aborting with the error 3221225572 (0XC0000064). When an attempt is made to start the service manually the following error appears: "Windows could not start teh SQL Server Active Directory Helper on Local Computer. For more infromation, review the System Event Log. If this is a non-Microsoft service, contact the service vendor, and refer to the service-specific error code - 1073741724."

The service is strating up under the network services account, which I am suspicous may be a problem. Currently the SQL server is running under SQL 2005 SP2 with no post service pack hotfixes. Do you have any advice on how to get the service to launch without errors?

I would guess the service may be set to automatic. The MSSQLServerADHelper service should be set to manual. SQL Server will start and stop the service itself when needed. It's not something you need to start yourself - just let SQL Server manage it.

-Sue

Sunday, March 11, 2012

Activation/Security/Dynamic SQL Question

I will have a variety of different types of work that will come into my Service Broker queue and I'll likely have a stored procedure or two for each of the different types of work (ie. move order header, move items, move payment, etc.) What is required to be done in each of these steps may vary by the subsidiary and type of order coming in. My plan is to use exclusively stored procedures but to execute them dynamically using sp_executesql. I think I should use sp_executesql because that way I can have a config file (in xml) that I can store what stored procedures need to be called for which unit of work/order type/subsidiary. If I do this I should be able to easily configure each type of work to be done in a config file and let Service Broker handle the execution dynamically. As long as I keep the parameters the same for each of the stored procedures (I'm thinking maybe 4 or 5 parameters) and passing them to each of the stored procedures, this approach will allow me to dynamically configure Service Broker to do what it is supposed to do. I can pull what needs to be done out of the message that comes in with an XQuery expression on the config file. I know that I will have to configure my user (activation user) to be able to run sp_executesql and the security may be complex (especially since I'm using certificates). I can not use trusted databases. Are there any other considerations I should think about?

Gary

You should be able to execute dynamic SQL as well as impersonate database principals (using the 'EXECUTE AS' statement or clause) to call message type handlers from the activation stored procedure. If you stay within the database, your database does not have to be trustworthy.

Hope that helps,
Rushi

Activation procedure design

I've been experimenting with Service Broker and was surprised at one aspect of the design: the interface to Activation stored procedures.

I would have expected the queue to be a parameted passed to the procedure rather than having to hard code the queue query into the SP.

In a system with lots of queues it seems plausible that the same activation procedure might want to be used with several queues.

Any comments?

David.

Stored procedures are compiled into execution plans that bind strictly the rowsets being involved. That means that a stored procedure cannot be compiled to issue a RECEIVE (or SELECT for the matter) against a generic 'queue', but only agains a very specific <queue_name>. This is the same reason why one cannot write a SELECT where the table name is a @.variable. The only workaround, both in SELECT and in activation case, is to use dynamic SQL, with the likely cost of having to compile the dynamic SQL when the procedure executes.

Given this it would not make sense to have the queue name passed as a parameter, it is not a performant pattern. However, if you must, there is the trick to get the queue you were activated for from sys.dm_broker_activated_tasks and build dynamic SQL to RECEIVE the messages.

HTH,

~ Remus

Activation

I was testing around with a sample service broker app using activation, and came across an interesting question. The little app sends a series of four messages to a queue, either on the same conversation or on seperate ones. Each message invokes one stored procedure in my activation procedure. All the procedure does is enter a record into a test table and then wait for an allotted amount of time. In my example, the first message called a proc that waited 20 sec, the 2nd one that waited 10 seconds, the third 5 seconds, and the 4th 1 second. I am using internal activation on the queue. It seemed that in both scenarios (sending on 4 separate conversations and on one conversation) the procedures executed "almost" sequentially. "Almost" meaning that the first procedure was done before the last one started executing. It makes sense to me that this would happen where I sent them on the same conversation, but not really when I sent them on 4 seperate ones. Is it because when I call a procedure from my activation procedure it locks the queue so that another message cannot be processed (I'm processing a message at a time)? How could I make it so that the 4th procedure (the one that only waits 1 second) returns before the 1st procedure (the one that waits 20 seconds)?MAX_QUEUE_READERS = ?|||

Sorry, my max_queue_readers where 5 in both situations.

Tim

|||

With one message per conversation then new instances of the stored procedure may be launched, so a message that arrived later may be processed sooner by a new instance activated procedure.

Also, even locally, the message order is only guaranteed within a conversation, so 5 messages sent on 5 conversation may arrive on the target queue in any order (unlikely to arive in different order, but one should not assume order between conversations)

|||You reference that new instances of a sproc may be launched for one message per convo, but what determines if it will or not? Will it only happen if some threshold is exceeded on the queue? The reason I was doing the little test was because I haven't seen any articles out there really detailing good ways to run large processing queries asynchronously for one application, so I was wanting to write one. My main curiosity was if there was any way to modify any of the settings for the procedure activation (which I don't think that there is).|||I just read your blog entry on Parallel Activation...neat stuff. Although, I doubt that it is something I would ever need to implement. I changed my procedures a bit so that they delay for a longer time period, and it appears that a new activation occurs ~ 5 seconds.

Thursday, March 8, 2012

activate or execute a ssis package from sharepoint document library

hello all

i need to execute a ssis(sql 2005 integration service) on a document document library . can you people help me out how i can do it

i want to make a work flow which initiate when new document upload in a moss document library and this work flow pass the document to a ssis package and initiate that ssis package

note: the database and moss servers are on different machine

please reply ASAP if there any way to do it.

thnaks

muhammad naeem wrote:

hello all

i need to execute a ssis(sql 2005 integration service) on a document document library . can you people help me out how i can do it

i want to make a work flow which initiate when new document upload in a moss document library and this work flow pass the document to a ssis package and initiate that ssis package

note: the database and moss servers are on different machine

please reply ASAP if there any way to do it.

thnaks

Michael Entin has a blog post that will help you here: http://blogs.msdn.com/michen/archive/2007/03/22/running-ssis-package-programmatically.aspx

There are a number of ways of executing SSIS packages, you jest need to see which works best for your scenario.

-Jamie

|||

Hi Muhammad,

I have a similar requirement where on document upload in Sharepoint 2003 , I have to execute a SSIS package which will validate and store data in Database. Can you also tell me how you did it and whether it is working.

Regards,

Swati

|||

Hi swati

ya i can give you a idea that how am i done it

my issue is related with MOSS 2007 not on 2003.i start my work on SharePoint after the 2007 release so don’t know about that how can you do it on 2003 but here is the procedure which i use in moss 2007

I first create a work flow which have InfoPath form for configuration. in which i take the sp name the take two parameters one the url of the uploaded document and the other is the SSIS package name.

In this work flow I execute that sp by giving the ssis pacage name and the current document. In that sp a execute the dtsexe.exe(detail in linked below) to activate ssis package.

Then I attach this work flow with document library.

I got help from these two posts. You can too find more detail from them.

Michael Entin blog post

http://blogs.msdn.com/michen/archive/2007/03/22/running-ssis-package-programmatically.aspx

and Jeff Modzel belogs

http://www.codeproject.com/useritems/CallSSISFromCSharp.asp

if you need then I can give you code too.

|||

Hi Muhammad,

Thanks for your quick response. What is sp, if it is stored procedure, then how to take stored proc name in Infopath forms. Can you please send me the code, including the infopath form at pashmina_15@.yahoo.com

I need to learn how to create workflow and how to attach workflow with document library.

Also does this solution helps to solve the purpose, i.e. Whenever a new document is uploaded / updated to document library it will trigger SSIS package?

Thanks once again for your quick help.

Regards,

Swati

activate or execute a ssis package from sharepoint document library

hello all

i need to execute a ssis(sql 2005 integration service) on a document document library . can you people help me out how i can do it

i want to make a work flow which initiate when new document upload in a moss document library and this work flow pass the document to a ssis package and initiate that ssis package

note: the database and moss servers are on different machine

please reply ASAP if there any way to do it.

thnaks

muhammad naeem wrote:

hello all

i need to execute a ssis(sql 2005 integration service) on a document document library . can you people help me out how i can do it

i want to make a work flow which initiate when new document upload in a moss document library and this work flow pass the document to a ssis package and initiate that ssis package

note: the database and moss servers are on different machine

please reply ASAP if there any way to do it.

thnaks

Michael Entin has a blog post that will help you here: http://blogs.msdn.com/michen/archive/2007/03/22/running-ssis-package-programmatically.aspx

There are a number of ways of executing SSIS packages, you jest need to see which works best for your scenario.

-Jamie

|||

Hi Muhammad,

I have a similar requirement where on document upload in Sharepoint 2003 , I have to execute a SSIS package which will validate and store data in Database. Can you also tell me how you did it and whether it is working.

Regards,

Swati

|||

Hi swati

ya i can give you a idea that how am i done it

my issue is related with MOSS 2007 not on 2003.i start my work on SharePoint after the 2007 release so don’t know about that how can you do it on 2003 but here is the procedure which i use in moss 2007

I first create a work flow which have InfoPath form for configuration. in which i take the sp name the take two parameters one the url of the uploaded document and the other is the SSIS package name.

In this work flow I execute that sp by giving the ssis pacage name and the current document. In that sp a execute the dtsexe.exe(detail in linked below) to activate ssis package.

Then I attach this work flow with document library.

I got help from these two posts. You can too find more detail from them.

Michael Entin blog post

http://blogs.msdn.com/michen/archive/2007/03/22/running-ssis-package-programmatically.aspx

and Jeff Modzel belogs

http://www.codeproject.com/useritems/CallSSISFromCSharp.asp

if you need then I can give you code too.

|||

Hi Muhammad,

Thanks for your quick response. What is sp, if it is stored procedure, then how to take stored proc name in Infopath forms. Can you please send me the code, including the infopath form at pashmina_15@.yahoo.com

I need to learn how to create workflow and how to attach workflow with document library.

Also does this solution helps to solve the purpose, i.e. Whenever a new document is uploaded / updated to document library it will trigger SSIS package?

Thanks once again for your quick help.

Regards,

Swati

Tuesday, March 6, 2012

Accounts for SQLServer service vs SQLServerAgent service

I've just changed the account under which SQL Server starts on my
development server. The new account has admin rights, and a corresponding
Exchange email account - so I can now receive alerts at various points.
I've restarted the server, and the SQL Server service seems to be running
OK.
However, I cant get the SQLServerAgent service running. It comes up with the
following error:
Service Control Failure:
An error 1069 - (The service did not start due to a logon failure) occured
while performing this service operation on th SQLServerAgent service.
To be honest, I'm not sure if the Agent service was running previously, so
the change in account details might be a red herring.
To get it working, I changed the account from a Windows account, to the
System Account - under this setup, the Agent started fine, but then I found
the SQL Mail test failed.
Now the SQLServer service uses the Windows Account, but the SQLServerAgent
service uses the System Account, and... touch wood... they both appear to be
working...
I'm just curious if my setup is correct, ie. is this a common scenario or
should both services be under the same (Windows?) account? It seems a little
odd to use differing accounts.
Thanks
ChrisIdeally, from a security perspective, you should use 2 different domain
accounts. Then you can audit what each one is doing.
The SQLServerAgent account, did it have log on locally rights, and if the
server is a domain controller, it needs more than just a Domain User rights.
Regards
--
Mike Epprecht
Epprecht Consulting (PTY) LTD
Johannesburg, South Africa
Mobile: +27-82-552-0268
Specialist SQL Server Solutions and Consulting
"CJM" <cjmwork@.yahoo.co.uk> wrote in message
news:%23BvtlNJcDHA.2632@.TK2MSFTNGP12.phx.gbl...
> I've just changed the account under which SQL Server starts on my
> development server. The new account has admin rights, and a corresponding
> Exchange email account - so I can now receive alerts at various points.
> I've restarted the server, and the SQL Server service seems to be running
> OK.
> However, I cant get the SQLServerAgent service running. It comes up with
the
> following error:
> Service Control Failure:
> An error 1069 - (The service did not start due to a logon failure) occured
> while performing this service operation on th SQLServerAgent service.
> To be honest, I'm not sure if the Agent service was running previously, so
> the change in account details might be a red herring.
> To get it working, I changed the account from a Windows account, to the
> System Account - under this setup, the Agent started fine, but then I
found
> the SQL Mail test failed.
> Now the SQLServer service uses the Windows Account, but the SQLServerAgent
> service uses the System Account, and... touch wood... they both appear to
be
> working...
> I'm just curious if my setup is correct, ie. is this a common scenario or
> should both services be under the same (Windows?) account? It seems a
little
> odd to use differing accounts.
> Thanks
> Chris
>
>|||"Mike Epprecht" <mike@.epprecht.net> wrote in message
news:uTBJHTJcDHA.1128@.tk2msftngp13.phx.gbl...
> Ideally, from a security perspective, you should use 2 different domain
> accounts. Then you can audit what each one is doing.
How do you mean?
> The SQLServerAgent account, did it have log on locally rights, and if the
> server is a domain controller, it needs more than just a Domain User
rights.
SQL Server has its own domain account, with admin rights.
The SQL Server Agent uses the 'System Account'
CJM|||Hi Chris,
Form your description, I understand that SQL Server has its own domain
account, with admin rights and the SQL Server Agent uses the 'System
Account' on your computer. Currently, the SQL Mail test failed in the SQL
Server Agent Properties. If I have misunderstood, please feel free to let
me know.
Based on my knowledge, when the SQLServer service uses the Windows Account
and the SQLServerAgent service uses the System Account, the two services
could start as normal. But if you want to use SQL Mail successfully with
SQL Server Agent, you need to have a domain account for SQL Server Agent
service. SQL Mail could not work fine using System Account with SQL Server
Agent.
Also, I found some related information below:
Troubleshooting MSSQLServer or SQLServerAgent Services User Accounts
http://doc.ddart.net/mssql/sql2000/html/trblsql/tr_servdatabse_3c37.htm
Hope it helps
Regards,
Michael Shao
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Sunday, February 12, 2012

Accessing Report Parameters Class through Web Service

I am using ASP .NET along to render my reports. I've extended the web
service class such that I specify the report folder, and I get all
reports and their respective parameters. I then dyncamically create
the controls (such as datepicker, textbox, etc...) based on the
Parameter Name, and Type. The drop down list is the one giving me the
hardest time though.
My problem is this: I have a Report with 3 parameters. The first 2
are dates. I can retrive all info on them just fine. The name,
prompt, and type (datetime). The third parameter (AppUserKey) however
is a dropdown list of all the users. I wrote a stored procedure that
does this called spGetAppUsers. Here is the structure of this
parameter as per the RDL file:
</ReportParameters>
...
...
<ReportParameter Name="AppUserKey">
<DataType>Integer</DataType>
<DefaultValue>
<DataSetReference>
<DataSetName>spGetAppUsers</DataSetName>
<ValueField>AppUserKey</ValueField>
</DataSetReference>
</DefaultValue>
<Prompt>AppUserKey</Prompt>
<ValidValues>
<DataSetReference>
<DataSetName>spGetAppUsers</DataSetName>
<ValueField>AppUserKey</ValueField>
<LabelField>AppUserName</LabelField>
</DataSetReference>
</ValidValues>
</ReportParameter>
</ReportParameters>
I can get the Name, and even from the ValidValues, the ValueField and
LabelField, however, I want the <DataSetName> entry.
This is so that after I dynamically create the drop down list, I'm
able to populate it via the stored procedure. Recall that the
ReportParameter class is defined here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_ref_soapapi_ir_5zec.asp
ReportParameter::QueryParameter is a boolean property. Doesn't
actually return the name. Just whether or not you are using a query.
ReportParameter::DefaultValues is a string but is empty, since the
report hasn't executed the stored procedure (makes sense).
I want this to be a generic solution. Hence all this trouble to get
all the "givens" from the Report, and to reconstruct it in ASP .NET.
I need that DataSetName!!! :-S
Any help is appreciated.
Thanks for your time,
RoyThere are 2 ways to do what I want:
1. Instead of trying to get the stored procedure of my query based
parameter, I should've set forRendering = True in my
GetReportParameters function. That will actually return the query
based parameter set. Then I can populate the drop down list with that.
2. Load the .RDL (report definition in XML) in memory and use XPATH to
get the name of the parameter:
Dim reportDefinition As Byte() = Nothing
Dim doc As New System.Xml.XmlDocument
Try
reportDefinition = rs.GetReportDefinition(ReportsFolder &
strReportName)
Dim stream As New MemoryStream(reportDefinition)
doc.Load(stream)
In this scenario, assuming you have forRedering=True or False, you
still need to know the name of the parameter. So you'ld probably get
then name of the parameter and then check the value of QueryParameter
to see if it's true.
Then base your XPATH query on the following XML:
"/ReportParameter/ValidValues/DataSetReference/DataSetName[@.text]"
Or something similar. I forget. The above is proabably wrong and
could be written in a million different ways.
<ReportParameter Name="AppUserKey">
<DataType>Integer</DataType>
<DefaultValue>
<DataSetReference>
<DataSetName>spGetAppUsers</DataSetName>
<ValueField>AppUserKey</ValueField>
</DataSetReference>
</DefaultValue>
<Prompt>AppUserKey</Prompt>
<ValidValues>
<DataSetReference>
<DataSetName>spGetAppUsers</DataSetName>
<ValueField>AppUserKey</ValueField>
<LabelField>AppUserName</LabelField>
</DataSetReference>
</ValidValues>
</ReportParameter>
</ReportParameters>
Roy Assaly wrote:
> I am using ASP .NET along to render my reports. I've extended the
web
> service class such that I specify the report folder, and I get all
> reports and their respective parameters. I then dyncamically create
> the controls (such as datepicker, textbox, etc...) based on the
> Parameter Name, and Type. The drop down list is the one giving me
the
> hardest time though.
> My problem is this: I have a Report with 3 parameters. The first 2
> are dates. I can retrive all info on them just fine. The name,
> prompt, and type (datetime). The third parameter (AppUserKey)
however
> is a dropdown list of all the users. I wrote a stored procedure that
> does this called spGetAppUsers. Here is the structure of this
> parameter as per the RDL file:
> </ReportParameters>
> ...
> ...
> <ReportParameter Name="AppUserKey">
> <DataType>Integer</DataType>
> <DefaultValue>
> <DataSetReference>
> <DataSetName>spGetAppUsers</DataSetName>
> <ValueField>AppUserKey</ValueField>
> </DataSetReference>
> </DefaultValue>
> <Prompt>AppUserKey</Prompt>
> <ValidValues>
> <DataSetReference>
> <DataSetName>spGetAppUsers</DataSetName>
> <ValueField>AppUserKey</ValueField>
> <LabelField>AppUserName</LabelField>
> </DataSetReference>
> </ValidValues>
> </ReportParameter>
> </ReportParameters>
> I can get the Name, and even from the ValidValues, the ValueField and
> LabelField, however, I want the <DataSetName> entry.
> This is so that after I dynamically create the drop down list, I'm
> able to populate it via the stored procedure. Recall that the
> ReportParameter class is defined here:
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_ref_soapapi_ir_5zec.asp
> ReportParameter::QueryParameter is a boolean property. Doesn't
> actually return the name. Just whether or not you are using a query.
> ReportParameter::DefaultValues is a string but is empty, since the
> report hasn't executed the stored procedure (makes sense).
> I want this to be a generic solution. Hence all this trouble to get
> all the "givens" from the Report, and to reconstruct it in ASP .NET.
> I need that DataSetName!!! :-S
> Any help is appreciated.
> Thanks for your time,
> Roy