Wednesday, December 8, 2010

How to check weather a username exists on a domain comtroller?.

The below code will help you to check wether a specified user exists on the domain controlller or not.


bool AdsVlaid = false;

string username = "it";

string domain="server";

string path = String.Format("WinNT://{0}/{1},user", domain, username);

try

{

DirectoryEntry.Exists(path);

AdsVlaid= true;

}

catch (Exception ex)

{

AdsVlaid = false;

MessageBox.Show(ex.Message);

// For WinNT provider DirectoryEntry.Exists throws an exception

// instead of returning false so we need to trap it.

}

For more infomation please visit the below links

http://www.codeproject.com/KB/system/everythingInAD.aspx

http://stackoverflow.com/questions/1329833/how-to-check-if-windows-user-account-name-exists-in-domain

How to check the User credential of a user with a domain controller?

The below code will help you to check the username and password of a user on a domain controller


System.DirectoryServices.AccountManagement.PrincipalContext PrincipalContext = new System.DirectoryServices.AccountManagement.PrincipalContext(System.DirectoryServices.AccountManagement.ContextType.Domain, "server");

bool AdsVlaid = PrincipalContext.ValidateCredentials("it", "13@mf3-25");

Tuesday, December 7, 2010

How to Configure ReportViewer for Remote Processing in Windows and Asp .net?

To configure a ReportViewer control for remote processing, specify a server report to use with the control. Follow these steps to select a server report:


1. Add the ReportViewer control from the Data section of the Toolbox to the form or Web page in your project.

2. In the ReportViewer Tasks smart tags panel, in Choose Report, select Server Report.

3. In the Report Server text box, type the report server URL. The default URL syntax is http://localhost/reportserver. The actual URL that is used in your installation might be different depending on how the report server virtual directory settings are configured.

4. In the Report Path text box, type the fully qualified path of a published report. The report path must start with a forward slash ( / ). The path must not include report URL parameters. The path consists of folders in the report server folder namespace and the name of the report. For example, if you installed the SQL Server 2005 sample report Company Sales on your report server, the report path might be /AdventureWorks Sample Reports/Company Sales.

5. Build or deploy the application to verify that the report appears correctly in your application. If you receive HTTP proxy errors, verify that the report server URL is correct. If you receive a compatibility error, confirm that the report server is a SQL Server 2005 instance.

6. Select the ReportViewer control and open the Properties window.

7. Set properties on the ReportViewer control to configure the report toolbar and run-time functionality. Use the reference documentation to learn about each property. For more information, see ReportViewer Properties.

For More Details


http://msdn.microsoft.com/en-us/library/ms252075(v=VS.80).aspx