Pages

Friday, December 31, 2010

Server Error ( IIS 7.0)

Question : -Server Error ( IIS 7.0 ) 
Operating System : Windows Server 2008
I get the error shown in the screenshot when I try to create a user account on ASP.NET website.
If possible, please give me the step by step procedure as to what needs to be done.





Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.


Solution: - Please check your connection string, if user setting and DB details are fine. Also check if DB service is running fine. You can see the various types of connection strings here : http://www.connectionstrings.com/
to check the SQL connection string you can see the details in your web.config. And can try to telnet on port 1433 (default SQL port , can be different in your environment ) or you can make a test ODBC connection from Administrative tools. 


****AS IS**** ; Apply at your own risk.

Thursday, December 30, 2010

Idea

Idea :-)

An IDEA can change your Life ... But, a Girl Can change your IDEA

~~~~~~~~^_^~~~~~~~~

Not able to connect the Team Foundation Server 2010

Question : - We are not able to connect the TFS 2010.
System Configuration: IIS 7.0 (Web Server Name:XXXXXX)
Windows Server 2008

---------------------------
Microsoft Visual Studio
---------------------------
TF205020: A connection could not be made to the following server:
XXXXXX\CMMS. This server was used during your most recent session, but it might be offline, or network problems might be preventing the connection. Contact the administrator for Team Foundation Server to confirm that the server is available on the network. To attempt to connect to this server or a different server, open the Team menu, and click Connect to Team Foundation Server.



The server returned the following error: Team Foundation services are not available from server
Please reset the IIS on this box and then try it. XXXXXX\CMMS.

Technical information (for administrator):

  Unable to connect to the remote server


Solution : -
Please reset the IIS on this box and then try it.

Wednesday, December 29, 2010

IIS 7 And FTP sites

Question : - I want to create 200+ FTP sites for different organizations within my company.  I don’t want to create an FTP folder and then create the 200+ folders within this default FTP folder.
I want the users to connect to the different FTP sites with a friendly name: ftp://sales, ftp://finance, etc.  Rather than ftp://sales:2009, ftp://finance:3413, etc.
Possible?  If so, how with as little ‘scripting’ as possible.


Answer : - 
You can create multiple FTp sites using multiple virtual host names: -
http://learn.iis.net/page.aspx/320/using-ftp-virtual-host-names/

# You created a new FTP site named "www.example.com", with the site's content root at "%SystemDrive%\inetpub\www.example.com".
# You bound the FTP site to the local loopback address for your computer on port 21 using "www.example.com" as the virtual host name

Similarly : -
# Create another site with different hostname : "Finance" , different content root
# Create another site with different hostname : "Admin" , different content root

Tuesday, December 21, 2010

IIS LOG Replicator/Sync


IIS LOG replicator/sync

I need to copy my new log files and updated log files from my IIS server to another server every 5 minutes or so. is there built in windows tools that can do this, or free 3rd third party tolls, or a script of some sort that can handle this.  

My Solution : - You need to create a script file script.bat using xcopy command
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/xcopy.mspx?mfr=true
then you can schedule a task to run that script every 5 minutes.

Eg, XCOPY C:\utils\MyFile D:\Backup\CopyFile

The user you will use to execute the schedule task should have "Write" access on destination folder as well.

 ****AS IS**** ; Please apply at your own risk.

301 redirects in Apache

301 redirects in Apache
Question : - I have just recreated our old .aspx website in wordpess to improve functionality.  we now are going to change hosts, and are worried about loosing our page / search rankings ect in google.
We were told that 301 redirects would do the trick.   Now i have read a little about this, but don't feel confident enough in dealing with apache and server stuff as i am a novice in those types of things.

so our old website address homepage would be www.example.org/Default.aspx  and other pages like  www.example.org/Content/Programs_Services.aspx  would be changed to www.newsite.org  (home page) and www.newsite.org/programs-services  how would i set-up 301 redirects  with different urls


Answer :- Use Apache module (mod_rewrite) ,     You need to edit File: httpd.conf and the code like
Code :
RewriteEngine On
RewriteRule /.* http://www.new-domain.com/ [R]


****AS IS**** ; Please apply at your own risk.

Wednesday, December 15, 2010

Adding Pictures to Survey in Sharepoint

Question : - I am trying to add some pictures to a survery to be rated. I have looked at a couple of solutions on the google but nothing has come up useful. Does any have a solution that will work for Sharepoint 2007?

My solution : - You could add the insert the image  code before the question text, the question should looks like: Ques1:xxxx

Then add JavaScript code  to the newForm.aspx and editForm.aspx
document.getElementById('onetIDListForm').rows[0].cells[0].innerHTML
    =
    document.getElementById('onetIDListForm').rows[0].cells[0].innerHTML.replace(/<').replace(/>/g,'>');


It will work on DispForm, NewForm and EditForm pages. While for 'Summary page" , please use below code
document.getElementById('MSOZoneCell_WebPartWPQ2').innerHTML
    =
    document.getElementById('MSOZoneCell_WebPartWPQ2').innerHTML.replace(/<').replace(/>/g,'>');

Friday, December 10, 2010

IIS is not showing Static files like Images and CSS

To more efficiently use available bandwidth, enable IIS HTTP compression. HTTP compression provides faster transmission time between compression-enabled browsers and IIS, regardless of whether your content is served from local storage or a UNC resource. You can compress static files and application response files. Compressing application response files is usually called dynamic compression.

Operating System : Windows 2003

Procedures

To enable global HTTP compression by using IIS Manager

1.In IIS Manager, double-click the local computer, right-click the Web Sites folder, and then click Properties.
2.Click theService tab, and in the HTTP compression section, select the Compress application files check box to enable compression for dynamic files.
3.Select the Compress static files check box to enable compression for static files.
4.In the Temporary directory box, type the path to a local directory or click Browse to locate a directory. Once a static file is compressed, it is cached in this temporary directory until it expires, or the content changes. The directory must be on the local drive of an NTFS–formatted partition. The directory cannot be compressed or shared, and the access control lists (ACLs) for the directory must include Full Control access to the identity of the application pool or to the IIS_WPG group.
5.Under Maximum temporary directory size, click a folder size option. If you specify a maximum size under Limited to (in megabytes) (the default setting is 95 MB), then when the limit is reached, IIS automatically cleans up the temporary directory by applying the "least recently used" rule.
6.Click Apply, and then click OK.


To enable global HTTP compression by using Adsutil.vbs

1.Open a command prompt.
2.To enable dynamic compression, type the following at the command prompt and then press ENTER:
cscript adsutil.vbs set w3svc/filters/compression/parameters/HcDoDynamicCompression true
3.To enable static compression, type the following at the command prompt and then press ENTER:
cscript adsutil.vbs set w3svc/filters/compression/parameters/HcDoStaticCompression true


****AS IS**** ;  Please apply at your own risk.

Thursday, December 9, 2010

Configure RSS and Sitemap Handler Extensions in IIS

 Configure RSS and Sitemap Handler Extensions in IIS

Operating System : - Windows 2003 

You may face problem while making a RSS server on IIS, its very easy infact. If you are running IIS 6 or lesser then Steps are : - 
  • Launch IIS
  • Go to website , Properties 
  • Home Directory Tab , Configuration
  • On the Mappings tab, click Add. 
  • Map to "Aspnet_isapi.dll" file corresponding your framework
  • Provide Extension name ".rss' , All Verbs and 'Script Engine' option selected
  • Apply , Ok , Ok
  • Also add a MIME TYPE for .RSS , application/rss+xml  

***AS IS**** ; please apply at your own Risk.


Wednesday, December 8, 2010

IIS 7 Permissions issue

We are using w2k8 for our internal Intranet server.  We want to restrict some of the subfolders to specific a domain group.

We have Windows authentication enabled (anonymous is disabled).  The NTFS permissions on the folder are set as follows:
 - WebAdmins = Full Control
 - RegistrationStaff = Read & executie, List folder contents, Read

WebAdmin users and RegistrationStaff users are given a "500 error". If I add "Domain Users" or IIS_IUSRS to the folder, then EVERYONE can access it!

So - how do I limit to just one domain group??

Solution : -
Please see if this helps you : http://technet.microsoft.com/en-us/library/cc753695%28WS.10%29.aspx

How to Register HTTP handler with ASP.NET

To register your HTTP handler with ASP.NET. To do so add an entry in your Web.config at /configuration/system.web/httphandlers.


Please remove all "..." from the below code

...
<.... httpHandlers ....>
    <... clear /   ...>
    <.... add verb="*" path="*" type="namespace.classname, assemblyname" / .....>
<.... /httpHandlers ....>
...


In IIS  , Website  ->> properties -> Configuration -> mapping -> Add -> The Add/Edit Application Extension Mapping dialog box is displayed ->  in Executable box -> type 'Aspnet_isapi.dll'
In Extension box -> type file-name extension like '.sample'
Select the Verify that file exists check box
-> Ok -> apply -> Ok

**Default location of 'Aspnet_isapi.dll'  is %windows%\Microsoft.NET\Framework\version\"


****AS IS**** ; Please apply at your own risk.

Tuesday, December 7, 2010

Lync 2010 Installation Problem

Question:

I'm having a strange problem when installing Lync 2010 on a new server build. I get through all the prerequisite steps and topology publishing just fine. I then move to the "Install or Update Lync Server System" section. From here Step 1, 2, and 3 all complete successfully with no errors.

I run Step 4 and the Lync services sort of start -
Lync Server Audio Test Service: Started
Lync Server File Transfer Agent: Started
Lync Server Front-End: Not Started
Lync Server IM Conferencing: Started
Lync Sever Master Replicator Agent: Started
Lync Server Replicator Agent: Started

When I try to start the Front End service: Windows could not start the Lync Server Front-End on Local Computer. For more information, review the System Event Log. If this is a non-Microsoft service, please contact the service vendor, and refer to service-specific error code -1008124830.

The event viewer shows this: Log Name:      Lync Server
Source:        LS Server
Date:          12/7/2010 9:08:03 AM
Event ID:      12303
Task Category: (1000)
Level:         Error
Keywords:      Classic
User:          N/A
Computer:     subdomain.gotovelocity.com
Description:
The protocol stack reported a critical error: code C3E93C62 (Configuration failure prevented the server from starting up). The service has to stop.
Event Xml:
http://schemas.microsoft.com/win/2004/08/events/event">
 
   
    12303EventID>
    2
    1000
    0x80000000000000>
   
    149ecordID>
    Lync Server
    subdomain.gotovelocity.com>
   
 

 
    C3E93C62
    Configuration failure prevented the server from starting up
 


Error #2
A component could not be started.  The service has to stop.

Component: Live Communications Applications Module  Error code: C3F2765F!_HRX! (APIEM_E_ESBASE_MISSING!_HRM!)
 
My Solution : -  Try to restart Front End Service, If it works then your problem will be resolved. Otherwise it may lead to rebuild of server.

Detect remote sql user

 Issue : - I have a couple of remaining very legacy database servers who flash their sql ports to the outside world. They contain about 100 databases between them and are all legacy customers so it's a tough sell to contact these customers.

Many, e.g. 10-15 or so have datafeeds or otherwise use this direct database access. I want to identify who these users are so I can contact them, get their ip details, then lock SQL access to the servers correctly.

How can I capture the unique external IPs and their database destinations in MS SQL 2000 to this end, e.g. over a period of a month?


My Solution : - To set up a SQL Profiler trace that tracks users who have logged in or out of the server, do the following:

   1. Create a trace, selecting Audit Login Event.

   2. To return the appropriate information, specify the following data columns:

      EventClass (selected by default)

      EventSubClass

      LoginSID

      LoginName

    * Monitor Transact-SQL activity per user.

      You can create a trace that captures events relating to the Sessions event class, ExistingConnection, and TSQL event classes. Include all data columns in the trace, do not specify any event criteria, and group the captured events by DBUserName.



****AS IS**** ; Please apply at your own risk. 

Setting up PHP to work on Windows Server 2003

Operating System : - Windows Server 2003
Automatic PHP installation using php-5.2.13-win32-installer.msi to C:\PHP\ and system has default set of permissions

Automatic Installation of 'php-5.2.13-win32" using IIS ISAPI Module option 
This automatic installation will not configure any Web Service extension and Application extension.
So we need to create a Application extension
Extn : - .php , Path : - C:\PHP\php5isapi.dll  , Verbs ; - All Verbs ,  Script Engine checked.
And also create  a Web Service Extension
Extension Name : PHP , File Path : - C:\PHP\php5isapi.dll

Automatic Installation of "php-5.2.13-win32" using IIS CGI Module option 
This automatic installation won't configure any application extension and web service extension
Create a Application extension
Extn name : - .php, File Path: -  C:\PHP\php-cgi.exe , Verbs : - All Verbs , Script Engine checked.
And also create  a Web Service Extension
Extn name : - PHP , File Path: -  C:\PHP\php-cgi.exe


****AS IS**** ; Please apply at your own risk.

Setting up PHP to work on Windows Server 2003

Setting up PHP to work on Windows Server 2003

Operating System : - Windows Server 2003
PHP version used in this test : php-5.2.8-Win32 Manual Installation
 
You have unzipped PHP (http://www.php.net) to C:\PHP and also You are using default (unmodified) ACLs/Permissions
Administrative tools in the Control Panel by clicking Start -> Administrative Tools -> IIS Manager
"Web Service Extensions" -> "Add a new Web service extension" - > Provide extension name "PHP" in and for the required files put "C:\PHP\php.exe" 
set it to allowed
Now on the corresponding website  add the .php extension to the file "C:\PHP\php5isapi.dll" and allow it.

PHP sample Test page: In the website create a php test page Test.php and write a code in it:

phpinfo();
?>

Save the file and browse it to confirm php is working fine. 

 PHP version used in this test : php-5.2.8-Win32 Automatic Installation using FastCGI Module option
 You have installed PHP (http://www.php.net) to C:\PHP and also You are using default (unmodified) ACLs/Permissions.
It will automatically create a Website Application Extension : -
.php - "C:\php\php-cgi.exe" , Verbs (All) , Script engine Checked

Also it will automatically create a WEb Service Extension : - 
PHP  - C:\PHP\php-cgi.exe with status Allowed




PHP version used in this test : php-5.2.8-Win32 Automatic Installation using IIS ISAPI Module
You have installed PHP (http://www.php.net) to C:\PHP and also You are using default (unmodified) ACLs/Permissions
This installation will automatically create Web Service extension : - 
PHP (C:\PHP\php5isapi.dll) with status Allowed. 
And a Website Application extension  : -
.php - C:\PHP\php5isapi.dll , Verbs (All) , Script engine Checked

****AS IS**** ; Please apply at your own risk. 

Friday, December 3, 2010

Create website using iisweb script

A small script crafted for the creation of multiple websites on IIS 6.0, This Syntax describes the switches: 





Applied to Operating System : - Windows 2003 Server

iisweb /createPathSiteName [/bPort] [/iIPAddress] [/dHostHeader] [/dontstart] [/sComputer [/u [Domain\]User/pPassword]]
 
/sComputer switch  can be used incase you want to create the website on a remote IIS webserver.

Running Example : -
iisweb /create c:\Expert\website Expert /b 80 /d "Expert.com" /dontstart
iisweb /create c:\Expert\ASP ExpertASP /b 80 /d "ExpertASP" /dontstart
iisweb /create c:\Expert\html Experthtml /b 80 /i 120.12.14.167  /d "ExpertASP" /dontstart

****AS IS**** ; Apply at your own risk.

Thursday, December 2, 2010

Check what are the set of Permissions required for the Application pool identity


NTFS permissions
Directory
Users\Groups
Permissions
%windir%\help\iishelp\common
IIS_WPG
Read, execute
%windir%\IIS Temporary Compressed Files
IIS_WPG
Full control
%windir%\system32\inetsrv\ASP compiled templates
IIS_WPG
Full control
Inetpub\wwwroot (or content directories)
IIS_WPG
Read, execute

Registry permissions
Location
Users\Groups
Permissions
HKLM\System\CurrentControlSet\Services\ASP
IIS_WPG
Read
HKLM\System\CurrentControlSet\Services\HTTP
IIS_WPG
Read
HKLM\System\CurrentControlSet\Services\IISAdmin
IIS_WPG
Read
HKLM\System\CurrentControlSet\Services\w3svc
IIS_WPG
Read

Windows user rights
Policy
Users
Access this computer from the network
ASPNET
Access this computer from the network
IWAM_MachineName
Adjust memory quotas for a process
IWAM_MachineName
Adjust memory quotas for a process
Network service
Bypass traverse checking
IIS_WPG
Deny logon locally
ASPNET
Impersonate a client after authentication
ASPNET
Impersonate a client after authentication
IIS_WPG
Log on as a batch job
ASPNET
Log on as a batch job
IIS_WPG
Log on as a batch job
IWAM_MachineName
Logon as a service
ASPNET
Logon as a service
Network service
Replace a process level token
IWAM_MachineName
Replace a process level token
Network service

Webpage redirect without change of hostname URL Address

Please create a /Test folder under your website and create two pages there , Default.asp and redirect.asp

Please add  <  >  before all of the tags like html,head, title , body and iframe.
html head  title Home Page /title
/head body iframe
src="redirect.asp" width="100%" height="100%">
/iframe /body /html

And content of redirect.asp is :
Redirect Page
html head "Redirect Page" /head
body  <% response.redirect( http: // www.google.com) %>
/body
/html

 ****AS IS**** ; Please apply at your own risk.

Asp.Net Permissions

We are using System.IO.FileSystemInfo to read the contents of a share on a server in an ASP.Net page.

When the page opens it gives this error:
Access not possible, error: System.UnauthorizedAccessException: Access to the path '//server/f/intranet/' is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileSystemInfo.get_CreationTimeUtc() at System.IO.FileSystemInfo.get_CreationTime() at ASP.listdir_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer)


The ASP.net "user" needs to be given access to the network share.  If you are running Windows 2003 this is the "NETWORK SERVICE", if you are running Windows 2000 it is "ASPNET". You may need to create a new user specifically for this and set up asp.net identity impersonation.

****AS IS**** ; Please apply at your own risk. 

How to backup Active Directory for recovery on Windows Server 2008

How to backup Active Directory for recovery on Windows Server 2008

Operating system : - Windows Server 2008 

You need need to maintain a good backup for system state of your active directory, First make a System State backup on a Domain Controller and maintain those backups by removing the old ones from the backup catalog.

Requirement:

1.       A secondary hard disk on domain controller attached locally to it. A network drive won't work.
2.       Install the Windows server backup (Backup tool is not installed by default)

To  Install it:

1.       Open Window Server manager snap-in
2.        Access features section and click on Add a New feature
3.       Select Windows Server backup  including the “Command Line tools”, This will also require PowerShell
4.       Click on Install button.

Scheduling the System State Backup

If you check the GUI of the Windows SerVer Backup, You will find there is no method available to backup the System state. The only possible way to backup the System state using this tool is using the command line.  Now to run  the backup as schedule task we need to make a script file (.bat) will schedule it.

Here we go

1.       In Notepad or any other  text editor
@echo off
### “off” will not display processing on the screen
WBADMIN START SYSTEMSTATEBACKUP –backuptarget:d: -quiet
###”d: ” is your  drive where backup of catalog will be saved
###”-quiet”: is the parameter used to not to ask for any confirmation

2.       Save it as a batch file naming “PCS-SysStateBKP.bat” and save it to D: drive

3.       Run -> Tasks -> New Task -> On General tab
a.       Run whether the user is logged or not
b.       Run with the highest privileges

4.       Triggers Tab , click ‘New’ define schedule you want
5.       On Actions click on the “New” and select a Start a program, map it to d:\ “PCS-SysStateBKP.bat”
6.       Ok, Run


This schedule task will take 1 hr approximately.  Till the time Task will show “This process is running”. Please make sure your D:\ drive have enough free space as equal to your ‘System’ drive which is commonly C drive. This automatic backup will save the file as .bkf which you can’t view.

We can write a new schedule task that will keep every week only the newer backups:
WBADMIN DELETE SYSTEMSTATEBACKUP – BACKUPTARGET:e: -deleteOldest –quiet

Save this command in notepad as D:\“pcs-OldStateDel.bat”
Now schedule it as a task to run weekly. You may like to run this schedule task before the backup task.

Restore AD:
http://technet.microsoft.com/en-us/library/cc732714(WS.10).aspx


****AS IS**** ; Please apply at your own risk.

Active Directory is the only Global Catalog ?

How do I check whether the Primary AD is the only Global Catalog?

Run below command on any of dc with support tool installed or manually download dsquery.exe tool to check which dc's are acting as GC

dsquery server -isgc

Friday, November 26, 2010

Issue with /Bin Dlls in IIS7

Problem:  I have created  one .NET 4.0 c# webApp using VS2010. The application  runs on  the internal VS web server for test but I face issues while trying to get WebApp running on IIS7.

I have 3 DLLs within my /Bin directory and I am not sure how to "register" them.



Error: Server Error in '/XXX' Application. Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information. 
Exception Details: System.NullReferenceException: Object reference not set to ab instance of an object.
Stack Trace: [NullReferenceException: Object reference not set to an instance of an object.]

Solution: Instead of that Build the project, and then Publish it to a directory somewhere and copy the contents of that publish folder. It sounds like you may have just copied the contents of the development project instead, rather than the build output. 

**** AS IS **** ; Please apply at your own risk.

IIS 7 Permissions issue

We are using windows 2008 for our internal Intranet server.  We want to restrict some of the sub folders to specific a domain group.  We have Windows authentication enabled (anonymous is disabled).  The NTFS permissions on the folder are set as follows:
 - WebAdmins = Full Control
 - RegistrationStaff = Read & executie, List folder contents, Read
WebAdmin users and Technical Staff users are given a "500 error". If I add "Domain Users" or IIS_IUSRS to the folder, then EVERYONE can access it! 

My Accepted Solution:
 http://technet.microsoft.com/en-us/library/cc753695%28WS.10%29.aspx

****AS IS****; Please apply at your own risk.

SQL Database Load Balancing

I have 2 databases(Sql Server) on different servers. How could I implement. Please don't give me the theoritical part as I need more practical stuff.
Helpful Article: - http://www.codeproject.com/KB/architecture/dbloadbalancerservice.aspx?
This may help you: http://msdn.microsoft.com/en-us/library/ms151314%28v=SQL.90%29.aspx
You should check its "Installing SQL Server Replication  " section. 


****AS IS **** ; Please apply at your own risk.

Monday, November 22, 2010

Import Microsoft Access (v2003) tables into SQL Server Express Edition (v2005)

Import Microsoft Access (v2003) tables into SQL Server Express Edition (v2005)
Steps are here:
  • Open Microsoft SQL Server Management Studio Express
  • Create a database for the import, if necessary
  • Open the Microsoft Access database that will be imported into SQL
  • Switch to “Tables” in Microsoft Access
  • Right click on the Table to be exported
  • Select “Export”
  • In the ‘Save Type As…’ field select “ODB Databases()”
  • Name the Table and Press “OK”
  • Press the “New…” button
  • Select “SQL Server” and Press “Next>”
  • Enter a name for the Data Source then Press “Next>”
  • Press “Finish”
  • Enter a Description if necessary
  • Select the SQL Server to connect to and Press “Next>”
  • Select the correct Authentication settings and Press “Next>”
  • Check “Change the default database to:” and Select the correct Database then Press “Next>”
  • Press “Finish”
  • Press “Test Data Source…” to very the information entered was correct
  • If test completed successfully then Press “OK”
  • Press “OK”
  • In “SQL Server Login” dialog box, enter correct authentication information and Press “OK”
  • Export should occur without any further dialog boxes or prompts
  • Switch back to the Microsoft SQL Server Management Studio Express
  • Navigate to the database, refresh the console and verify the table was created/imported
****AS IS****; Apply at your own risk.

Sunday, November 21, 2010

Cannot Login to External Website


Question: I am using IIS 6.0. I used to be able to login to my external website called externaldomain.com.
Now it does not recognize the password. Where do I find it and reset? 
 
Solution was:
Is this problem with you only? You can reset password for your account on DC and then try to login into the website. It should work.
****AS IS**** ; Please apply solution at your own risk.

Thursday, November 18, 2010

Web deploy IIS6 to IIS7 migration problem


Web deploy IIS6 to IIS7 migration problem

I'm trying to move a site with the Web Deployment tool, but the site on the source server is on drive "E", whereas on the destination server it's on drive "C" - how can I configure Web Deploy for this difference?  (I get an drive "E" not found error now when I try the move)

use the replace rule to create the DEPLOYMENT package.

eg: To package

msdeploy -verb:sync  -source:metakey=lm/w3svc/119998765 -dest:package=c:\myWebSite.zip
-replace:objectName=metaProperty,scopeAttributeName=name,scopeAttributeValue=path,targetAttributeName=value,match="e:",replace="c:"
-whatif
> WebDeployPackage.log

*  Make sure you add the  -whatif argument to display what would have happened without actually performing any operations.

See MSDeploy Blog
http://blogs.iis.net/msdeploy/archive/2008/05/23/how-to-write-skip-and-replace-rules-for-msdeploy.aspx

http://technet.microsoft.com/tr-tr/library/dd568992(WS.10).aspx
 

****AS IS**** ; Please apply at your own risk.

Odex enterprise and SSL certificate

http://www.dip.co.uk/kb/1159.aspx
When importing certificates in Windows, the certificate will be placed in your own trusted root store.
If ODEX is running as an application, it is running as your user and so selecting certificates from your root store should show the new certificate.
If ODEX is running as a system service, you will need to ensure that the certificate is copied to the local machine's trusted root store. Certificates can be copied using the Microsoft Management Console (MMC).
Select add/remove snap-ins and add the certificate snap in twice, once selecting your user account and once selecting the local machine.
If you expand your current user trusted root store, you should be able to see the new certificate. This needs to be copied to the corresponding folder underneath the local computer.
If you are unfamiliar with MMC, you can select the import option from ODEX when browsing for certificates. This will cause ODEX to import the certificate into the appropriate store depending on whether ODEX is running as a service.

Theme Managment with httpHandlers


Theme Managment with httpHandlers , How to do that? 


You can do this in a module:
  public class ThemeModule : IHttpModule
  {
    public void Init(HttpApplication context)
    {
      context.PreRequestHandlerExecute += new EventHandler(this.app_PreRequestHandlerExecute);
    }

    private void app_PreRequestHandlerExecute(object Sender, EventArgs E)
    {
      Page p = HttpContext.Current.Handler as Page;
      if (p != null)
      {
          string strTheme = "Theme1";
            if (Convert.ToString(HttpContext.Current.Session["THEME"]) != string.Empty)
                strTheme = Convert.ToString(HttpContext.Current.Session["THEME"]);
            return strTheme;
          p.StylsheetTheme;
      }
    }

    public void Dispose()
    {
    }
  }
   Then add the module in config:
   
     
   
 

An alternative however, is to use an even in global.asax:
private void app_PreRequestHandlerExecute(object Sender, EventArgs E)
    {
        Page p = HttpContext.Current.Handler as Page;
      
        if (p != null)
        {
            string strTheme = "Theme1";
            if (Convert.ToString(HttpContext.Current.Session["THEME"]) != string.Empty)
                strTheme = Convert.ToString(HttpContext.Current.Session["THEME"]);
            p.StyleSheetTheme = strTheme;
        }
    } This saves having to configure the module. The event runs early enough int he page lifecycle to allow the theme to be set.

Wednesday, November 17, 2010

Exception: System.NullReferenceException

"An unhandled exception occurred and the process was terminated. Application ID: /LM/W3SVC/1303255675/ROOT  Process ID: 5112 Exception: System.NullReferenceException"

 error - 2010/11/17 00:12:20 - ASP.NET 2.0.50727.0 (1334) - n/a  "An unhandled exception occurred and the process was terminated. Application ID: /LM/W3SVC/1302395675/ROOT  Process ID: 5112 Exception: System.NullReferenceException
 Message: Object reference not set to an instance of an object. StackTrace:
 at System.Web.SessionState.SessionStateModule.PollLockedSessionCallback(Object
 state) at System.Threading._TimerCallback.TimerCallback_Context(Object state) at  System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
 code,
 CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext
 executionContext, ContextCallback callback, Object
 state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext,  ContextCallback callback, Object state) at System.Threading._TimerCallback.PerformTimerCallback(Object
 state)"

Possible Solution:
This might be an InProc Session State issue.  This Microsoft Support Fix might help.  Check it out.
http://support.microsoft.com/kb/942086

Check this link as well.  Here is a discussion on similar problem and may provide some clue: http://forums.asp.net/t/1132396.aspx

Also, its a possibility when a heavy load on the web server and you are using InProc, can cause this problem. You can try editing your Session State using State Server
http://msdn.microsoft.com/en-us/library/ms178586.aspx


****AS IS**** ; Please apply at your own risk.

Russell Peter on Cheapness : You want a bear

We are cheap .. every body is cheap .. Never  called White people cheap. White people will get really upset. when You call a white person cheap, he will get very angry. because White people probably are a part of people who are not cheap.
If you call White people cheap, Fuck you are cheap, I am not a cheap. I buy a bear, You want a bear, I said a white guy cheap, He said you want a bear you want a bear you want a bear you want a bear Fuck I am not a cheap I will buy a bear. Everybody is cheap , its all about levels you know.

Russell Peter on Bargaining in China : Be A Man

 An Indian and a Chinese can be together but can't work together.. you know what I mean?
Well there's this day I went to this chinese mall and I see this bag. I ask this guy: You know i want to buy this bag, how much?
and he says: thirty-five dollars. And then I said: oh c'mon thirty dollars. Asian guy says:NOOOOOOOOOOOOOOOOO , the Biggest NO I ever heard in my life , i said its just five dollars. Then he said: wait I talk to my wife.*chimla choo chi mai choyee*OK you seem like nice guy, I will give you best price thirty-four fifty. i said cmon man that 50 cents... he replied you save 50 cents here you go somewhere else you save another 50 cents.. you have one dollar and you go to the dollar store you go buy something else. Then i start to leave , the guy yells: Hey Be a man, do the right thing. Buy the bag.
HAHA an Indian cant live without a bargain and a Chinese guy cant give you a bargain.

Russell Peters on the N-word

As a guy who grew up with Black people, I know the N-word is not specific to people. It’s a fucking noun. It is used for everything else but people. It’s not specific to black people.
I see my friends. They’ll be like, “Yo Russell, I seen you with some Chinese niggers last night.”...
My homeboy called me, was like, “Yo, you gotta put on Discovery Channel, son They got this shit on killer whales. Yo, those niggers are crazy!”

Russell Peters on Shopping in China

I have to go to this mall in Beijing to buy some clothes. I didn’t know this until I got there, but apparently in China I’m Shaquille O’Neal. I go to mall. I walk into the store. I’m like, “Hey, you got a 10.5/11 in those shoes?”
“Ah no! How about an 8?”
“How about I can’t negotiate my foot size with you?”

Russell Peters on Racism

Every group is racist. White folks will see a group of Indian people and they’re like, “Look at all those brown people, they’re probably all very happy together.” Then you get in that group and like, “Hey, you from India? I’m from India. What part? No, not that part. Go to hell you dirty bastard.”

Tuesday, November 16, 2010

IIS6 and IIRF rewrite not honoring .NET tilde (~) to denote application root.

IIS6 and IIRF rewrite not honoring .NET tilde (~) to denote application root.
At IIS6,  I'm using the IIRF ASAPI filter to provide extension-less "friendly" url rewrites.
The end result I want is an IIS6 + IIRF installation of my web application to behave exactly the same as it does when installed on IIS7+ with Microsoft's urlrewrite enabled.

Problem description is:

"~/services/servicename" is rendered in html as "/services/servicename" when i'm actually on a root page which is at "/".
Pages from sub directories like  "/contact/email-us" that same url "~/services/servicename
" will render in html as "/contact/services/this-is-a-service"
Solution:

Need a web application to create users via webpage on browser

I like to have a webpage on my website which could provide me option to add username , select Group membership and have a web application to create the users and their home folders. Is it possible to do so?


Yes it is possible and easy, A small coding is required though: 
Add user
http://channel9.msdn.com/Blogs/RobertShelton/Adding-users-to-Active-Directory-with-NET

Add user to Group
http://channel9.msdn.com/Blogs/RobertShelton/Adding-Groups-and-users-to-groups-to-Active-Directory-with-NET

MSDN Example
http://msdn.microsoft.com/en-us/library/bb384369.aspx

Can i know how to add the following Handler Mapping in IIS6.0


Case - Conversion of PublicKeyToken into a valid handler using sn.exe

Request path: Reserved.ReportViewerWebControl.axd
Type: Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Name: Reserved.ReportViewerWebControl.axd

 
You could not add this Handler directly, First you have to convert it using the StrongName
As strong names are generated using PublicKey cryptography.  So, it is necessary to have a PublicKey as part of the assemblies manifest so implementation of  applications can then encrypt using the PrivateKey generated with a strong name key, which is essentially a very large random number, Hence, make the assembly useful.  The PublicKeyToken value is that public key.  A StrongName assembly's PublicKey token can be found with the "sn.exe" utility which comes with the .NET Framework SDK with the "-T" switch.  The "sn.exe" utility is primarily used to generate and manage strong name keys, and sign assemblies.

In this case PublicKeyToken=b03f5f7f11d50a3a

****AS IS**** ; Please try at your own risk.

Friday, November 12, 2010

Festival of Employees - Sunday
Happy Weekend :-)

Thursday, November 11, 2010

Bug on Sharepoint 2010

Bug on Sharepoint 2010

You try to import users from Active directory who have Manager field and the time you create filter, Central point Admin crash.
This is a bug in Sharepoint 2010, and it'll be fixed in coming service packs

How to Add Pictures to Survey in Sharepoint

You could add the insert the image  code before the question text, the question should looks like: Ques1:xxxx

Then add JavaScript code  to the newForm.aspx and editForm.aspx
document.getElementById('onetIDListForm').rows[0].cells[0].innerHTML
    =
    document.getElementById('onetIDListForm').rows[0].cells[0].innerHTML.replace(/</g,'<').replace(/>/g,'>');


It will work on DispForm, NewForm and EditForm pages. While for 'Summary page" , please use below code
document.getElementById('MSOZoneCell_WebPartWPQ2').innerHTML
    =
    document.getElementById('MSOZoneCell_WebPartWPQ2').innerHTML.replace(/</g,'<').replace(/>/g,'>');

Sharepoint List permissions

Default Sharepoint List permissions are given below:

Manage List, Override Check out, Add items, Edit Items, Delete items, View items, Approve items,
open items, view versions, Delete versions, create Alerts, View application pages

While for a user, list Permissions, the following are required...
Add Items, Edit Items, View items, Open Items, View Versions, Create Alerts, View Application Pages

For Site Permissions, the following are only required
Browse Directories, View Pages, Enumerate Permissions, Browse user Information, Use Remote Interfaces, Use Client Integration Features, Open, Edit Personal Information.

****AS IS**** ; Please use provided information at your own risk

Microsoft Single Sign On service missing

Case :Microsoft Single Sign On service missing

To enable SSO functionality for Office SharePoint Server 2007, you need to start the Microsoft Single Sign-On service and then manage SSO settings in the SharePoint Central Administration Web application.

Start the Single Sign-On service on all front-end Web servers and all application servers in your farm that run Excel Calculation Services.
Steps to start it: 
Start -> Run -> Services.msc -> Locate Microsoft Single Sign-On Service -> On the Log On tab of the Single Sign-On Service Properties page, click This account, and then type the domain, user name, and password that you have used to install and manage your server. -> Click Apply. -> change the start up type to Automatic, click Start, and then click OK.

****AS IS**** ; Please use the provided information at your own risk. 

Unable to upload files with specific extension via explorer view in SharePoint 2010

Case : Unable to upload files with particular extension via explorer view in SharePoint 2010

You may face problem in upload or delete the below file types when accessing a SharePoint 2010 library via explorer view while able to upload or delete all file types file when accessing the library via a web browser
File Extension could be :
.vb
.resx
.vbproj
.dll
.exe
.mdb


Error : Item not found
This is no longer located in \\path. Verify the item's location and try again.

 
Steps to solution:
All file extensions have been allowed via Central Administration --> Security --> Define blocked file types


IIS manager -> select the web site -> properties -> Select Handler Mappings -> Edit Feature Permissions -> Uncheck the Execute check-box -> Restart the site

To enable the upload of .other file types via explorer view : IIS manager -> Add a new MIME type for the required extention

Now Modify IIS configuration file applicationHost.config under path %SystemRoot%\system32\inetsrv\config
locate the  < requestFiltering >  section
change the allowed property to true to allow above file extension to be served.
e.g
     
                 
                         



****AS IS**** ; Please use at your own risk.

Saturday, October 16, 2010

How to calculate the version of ASP.NET Service Pack

How to calculate the version of Service Pack for ASP.NET Framework Setup

HKEY_LOCAL_MACHINE\Software\Microsoft\NET Framework Setup\NDP\vx.xxxx.xx
Check Value of Name: Install Or Name: SP
http://support.microsoft.com/kb/318785/

Thursday, October 7, 2010

Active And Passive FTP

PassivePortRange, this property key only exist in IIS 6.0, for IIS 5.0 in Windows 2000, system administrator need to install Service Pack 4 and add in PassivePortRange key in system registry.

For Windows 2003 Server

a) To Enable Direct Metabase Edit
1. Open the IIS Microsoft Management Console (MMC).
2. Right-click on the Local Computer node.
3. Select Properties.
4. Make sure the Enable Direct Metabase Edit checkbox is checked.


b) Configure PassivePortRange via ADSUTIL script
1. Click Start, click Run, type cmd, and then click OK.
2. Type cd Inetpub\AdminScripts and then press ENTER.
3. Type the following command from a command prompt.
    adsutil.vbs set /MSFTPSVC/PassivePortRange "5500-5700"
4. Restart the FTP service.

PassivePortRange                : (STRING) "5500-5700"



For Windows 2000 Server
 
IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs.

In order for this PassivePortRange to work in Windows 2000, system administrator must install Service Pack 4 (SP4) or later. 
Configure PassivePortRange via Registry Editor
1. Start Registry Editor (Regedt32.exe).
2. Locate the following registry key:
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Msftpsvc\Parameters\
3. Add a value named "PassivePortRange" (without the quotation marks) of type REG_SZ.
4. Close Registry Editor.
5. Restart the FTP service.

Note: The range that FTP will validate is from 5001 to 65535.


*****AS IS***** Apply on your risk.

Wednesday, October 6, 2010

Coveo 3.7 Migration

Just now completed the migration of Coveo 3.70 BUILD 689.1069

Coveo is a very complex search software, and have so many components to manage. I will discuss about the steps for migration later.
Its time to party !

Friday, September 24, 2010

Microsoft Content Management Server (MCMS)

You may identified the version of Microsoft Content Management Server using following list , You can see these details under SCA


v 2001 RTM 4.1.942.0
v 2001 SP1 4.1.942.100
v 2001 SRP1* 4.1.942.308
v 2001 SRP2* 4.1.1106.0
v 2002 RTM 5.0.1581.0
v 2002 SP1 5.0.2284.0
v 2002 SP1a 5.0.4484.0
v 2002 SP2 5.0.5054.0 
***AS IS*** , Please use at your own risk.

Thursday, September 23, 2010

Add and Remove programs comes up blank OR takes a long time to populate information

Add and Remove programs comes up blank OR takes a long time to populate information


You can alternately uninstall applications manually without using Add/Remove Programs. Each installed application will typically have an uninstall string associated with it that will allow manual uninstall. To find the uninstall string, do the following: 
·         1. Open the registry editor (Regedit.exe) and browse to the following location:
   HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
·         2. Each application should be listed under this key. Find the application by either its name or GUID.
3.   3.Copy the value for UninstallString and paste this into Start- Run. This should uninstall the application in the same manner as Add/Remove Programs.

******AS IS****Apply on your risk.

Wednesday, September 22, 2010

aspnet_regiis

aspnet_regiis

we have come across this term times more than our Birthday's. Running "aspnet_regiis -i" is not a good option. WHY?

Effect: When you will run aspnet_regiis -i , it will associate all websites on the box with the framework from where the command was run.You have two different flavors available to you locating C:\Windows\Microsoft.NET\Framework\v1.1.4322\ and \v2.0.50727. The one from where you will run will associate to all websites on Box.

Then What should I do
Following option will registers script map for our Application.
Aspnet_regiis -s W3SVC/1/ROOT/SampleApp1 
while aspnet_regiis -ir -enable - Installs ASP.NET version with root and enables it.



So you can decide what you need ! whole Box or one Website.




**My all solutions comes with 'AS IS' warranty only. You may use them on your risk.

Monday, September 20, 2010

MS utility to mount .iso image

MS utility to mount .iso image, Just download it and extract it on the server. Load the driver and attach .iso file.
Download link : http://download.microsoft.com/download/7/b/6/7b6abd84-7841-4978-96f5-bd58df02efa2/winxpvirtualcdcontrolpanel_21.exe

Friday, September 10, 2010

Default permissions and user rights for IIS 6.0

Default permissions and user rights for IIS 6.0

http://support.microsoft.com/?kbid=812614


Wednesday, September 8, 2010

IISADMIN service is up and running, however other IIS related services like WWW, SMTP etc do not start

IISADMIN service is up and running, however other IIS related services like WWW, SMTP etc do not start.
In such a scenario please check the link mentioned in the post and here below if it justifies the symptoms related to duplicate c23 keys. If yes follow this article and you should be good.
http://support.microsoft.com/default.aspx?scid=KB;EN-US;884872


Tuesday, September 7, 2010

Application Center 2000 SP2 - issue

MS Health Monitor 2.1 which comes by default with the installation of Application Center that is infected with "Slammer worm"; So should not select 'MS Health Monitor" while installing the Application Center.

Monday, August 16, 2010

How to Create Database in Mysql

How to Create Database in Mysql

Login to your mysql server through console remote shell(putty)

If you want to create a database name = mytestdb and grant permission for user = testuser with password = testpasswd
database name = mytestdb
User Name = testuser
Password  = testpasswd


#mysql -u root -p ( enter the mysql root password)
mysql> create database mytestdb;
mysql> grant all privileges on mytestdb.* to testuser@localhost identified by 'testpasswd';
mysql> FLUSH PRIVILEGES;

mysql>show databases;
mysql> exit


This will create mytestdb and enable access for testuser form localhost
If you want to connect mysql form remote server, then replace localhost with your remote server ip



Risk Involved, Apply on your risk.