Windows Server 2008 Cdonts issue - windows

Cdonts is not working in server 2008 (im using 32bit)
i tried copying cdonts.dll to windows/system32 folder
did regsvr32
it failed
any alternatives?
-Vivek

This is probably because you have the 64-bit version. You have to put cdonts.dll in the windows\SysWOW64 folder and then run
regsvr32 C:\Windows\SysWOW64\cdonts.dll
You will also have to edit the application pool of your site and set "Enable 32-bit Applications" to True.

Someone seems to have successfully installed CDONTS on Windows 2008 x64 on IISLogs.com. I did not try myself though.
Here his procedure :
Copy CDONTS.dll from another server to C:\Windows\SysWOW64
Run regsvr32 c:\windows\SysWOW64\cdonts.dll
Grant the appropriate permissions on C:\inetpub\mailroot\pickup (I granted USERS group Modify permissions). You could get permission denied if the folder security isn't adjusted.
I'm assuming you have installed the SMTP Service located in Server Manager > Features > SMTP Server option
Make sure when you when you install the SMTP service, you enable Relay for localhost > Administrative Tools > Internet Information Services (IIS6) > SMTP Virtual Server > Right click, Properties > Access Tab > Relay button > Add 127.0.0.1 in the option. Also enable logging for additional troubleshooting.

CDONTS is deprecated (around the time of XP, I believe?)
Here are 2 common replacements.
http://www.w3schools.com/asp/asp_send_email.asp
http://www.aspcode.net/ASPMail-SMTPsvgMailer-.aspx

Related

stop and start IIS server for TFS build Access denied

I need to stop and start IIS server for TFS build. When do this using .bat file iisreset /stop, similarly for start.
When I do this I get
Access denied, you must be an administrator of the remote computer to use this command. Either have your account added to the administrator local group of the remote computer or to the domain administrator global group.
Please note: This is Windows server 2019
I am already admin of this machine.
I have given read/write access to everyone in this folder.
I have unset EnableLUA to '0' in the registry as told in link for site
Above all these, I restarted machine.
I still get error in TFS build.
When you start a build in TFS the execution of that build is effectively done by a build agent. A build agent is just a service running on any particular machine. So, your batch file that shall start/stop the IIS service will be executed by whatever build agent is running your particular build.
This in terms means that your batch file is executed by the user that is used to run the build service. If that user does not have the necessary admin rights you face this particular error message.
What you need to do is make sure that all accounts that you use to run your build agents have administrative permissions on whatever machine you want to start/stop IIS.
You are trying to do IISRESET in your batch script. You need to be an Administrator as basic right to execute IISRESET command. So the account which the build is running needs to be part of the Admin group on the box.
Other approach is to stop and start w3svc using sc config commands or NET STOP WAS /Y and NET START W3SVC
Both of your answers are correct, I added the 'Network Service' of TFS to admin group of machine. Then build was success. Administrative tools>Computer Management> Local Users and Groups>Groups>
Inside Administrators and Users add 'Network Services'. If you don't find 'Network Service' then change location to your computer node and add them.

How to change the IIS 7 application pool on a remote server?

I am looking to create new virtual directories on a remote server and set the app pool to a configuration other than the default. I am using NAnt but open to any other commands that can accompolish this.
Here is what I have tried:
<mkiisdir iisserver="${remote.server}" dirpath="${install.path}" vdirname="${vir.dir.name}" />
The above works fine in creating the VD to a remote server but the nant task does not have a parameter for specificing the application pool. Strange as to why not !!
I looked into using powershell to update the application pool since I already have the Virtual Directory created but due to my Windows OS restrictions I am unable to install the WebAdministration module which is required to update the IIS app pool.
Is there any existing method to accompolish this that I have not considered?
Thanks.
You can use AppCmd.exe which is located in the System32 folder.
appcmd set app /app.name:"Default Web Site/MyVirtualDirectoryName" /applicationPool:"MyAppPool"
If you need to Update the web applications directories on other servers remotely, then you can use PSExec \\RemoteServerHostname appcmd set app /app.name:"Default Web Site/MyVirtualDirectoryName" /applicationPool:"MyAppPool"

How do I start IIS Express?

I've used the Web PI to install IIS Express. In the tray, there is not the IIS Express icon. How do I start IIS Express without using the command line? I want that IIS runs permanently, so without command line.
See Running IIS Express from the Command Line
Open a command prompt.
cd \Program Files\IIS Express, or
cd \Program Files (x86)\IIS Express on 64-bit OS
iisexpress /? to show usage
For example, you can start your IIS Express named site by issuing the command
iisexpress /site:WebSite1 where WebSite1 is a site from the user profile configuration file (C:\Program Files (x86)\IIS Express\AppServer\applicationhost.config)
Another common way to start IIS Express is to issue the command iisexpress /path:c:\myapp\ /port:80
This command runs the site from the c:\myapp folder over port 80.
You could use a *.bat that you include in your startup folder that starts IIS Express for you (using C:\Users\<user name>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup or the All Users startup folder C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup).
In Windows 7 you can use the Windows PowerShell to hide the command window, for example i use:
start-process "c:\program files\iis express\iisexpress.exe" -workingdirectory "c:\program files\iis express" -windowstyle Hidden
PowerShell script execution is set to Restricted on most new systems by default so you might need to change that to RemoteSigned or something first.
You can also install Web Matrix, which has an administration interface to IIS Express.
IIS Express isn't really meant to be run without some kind of interaction with it - Visual Studio, WebMatrix, or other. IIS Express isn't a service.
If you wanted to automate its startup in Windows, you can do so via Startup directory, or add a new item to the registry key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
C:\Program Files (x86)\IIS Express\iisexpress.exe
You could run this executable ad-hoc if you like, perhaps create a shortcut on your quicklaunch or desktop or other.
I don't think running IIS Express without the command line is achievable unless you're successful in writing a separate program to do it, as some have attempted to do in this related question.
Quoting the online documentation:
IIS Express is a lightweight,
self-contained version of IIS
optimized for developers. IIS Express
makes it easy to use the most current
version of IIS to develop and test
websites. It has all the core
capabilities of IIS 7 as well as
additional features designed to ease
website development including:
It doesn't run as a service or require administrator user rights to
perform most tasks.
IIS Express works well with ASP.NET and PHP applications.
Multiple users of IIS Express can work independently on the same
computer.
You could use srvany to run IISExpress as a service.
Here is a blog post about this (though I haven't tested it yet, it looks promissing).
http://arvinboggs.wordpress.com/2011/04/08/installing-iisexpress-as-a-service-on-windows-2003/
The interesting part is where you pass a /config ... parameter to iisexpress, otherwise IIS Express loads the config from the users documents folder.
If you want your IISExpress to be able to be reachable from remote machines you can either
Start is with admin privileges and edit your applicationhost.config file: http://blogs.iis.net/vaidyg/archive/2010/07/29/serving-external-traffic-with-webmatrix-beta.aspx
Start is a a user and set up an ACL: http://blogs.iis.net/vaidyg/archive/2010/07/29/serving-external-traffic-with-webmatrix-beta.aspx
Use Vb.net 2010
and put this on a button
this will execute the IIS Express console less
shell("C:\Program files\IIS Express\iisexpress", vbhide)
To kill the process
*this will kill the IIS Express *
shell("taskkill /f /im iisexpress.exe", vbhide)

partially trusted reading app.config on Windows 7 in network share

I'm getting this error in Windows 7 64 bits:
An error occurred creating the configuration section handler for '': That assembly does not allow partially trusted callers.
This happens when I try to read a config section, the section is mapped to a class that is in a DLL in the GAC, I'm using Visual Studio 2010 targeting the framework 3.5, I'm in a domain and the exe is running from a network share, the exe is signed.
This is failing only on Windows 7, an XP Machine can run the app just fine from the same network share, I'm using my domain account on both machines.
Does anyone know why this is failing on Windows 7?, thanks a lot for your time.
Having bumped into similar trouble when our IT department did a stealth upgrade of users' machines to Windows 7, I suspect you may need to update the trust level with caspol.exe
For XP we would normally run:
%windir%\Microsoft.NET\Framework\v2.0.50727\CasPol.exe -q -m -ag 1.2 -url file:\\s:\* FullTrust
but now with Win7 it has changed to:
%windir%\Microsoft.NET\Framework64\v2.0.50727\CasPol.exe -q -m -ag 1.2 -url file:\\s:\* FullTrust
I Fixed using this command:
caspol -cg 1.2 FullTrust
The Intranet Zone had the LocalIntranet permissions set, (don't know why it was LocalIntranet, it should be FullTrust).
Thanks to dreynold.

Can't find IISROOTFOLDER on Windows Server 2008

I'm using installshield to install my website to IIS, it works fine on windows server 2003, but while running on windows server 2008, it raise an error saying:
Error 1606. Could not access network location {IISROOTFOLDER}.
How can I fix this problem?
First you need to check your iisrootfolder.
In default website properites check home directory - local path.
Some times its missing changes so you could try vbscript custom action to get the "true" root directory:
Dim objIIsWebService
Set objIIsWebService = GetObject("IIS://localhost/W3SVC/1/ROOT")
MsgBox objIIsWebService.Path

Resources