Creation of mailbox in Microsoft Exchange server 2013 using C# - exchange-server

I am trying to create a mailbox in Exchange server 2013 using C#
Using this Reference I created a console application to create a mail box.
Initially I created Active Directory , using the credintials I tried to create mail box. but the below statment throws exception
Runspace runspace = RunspaceFactory.CreateRunspace(connectionInfo);
throws exception
A first chance exception of type 'System.InvalidProgramException' occurred in Exchange.exe
Additional information: Common Language Runtime detected an invalid program.

Related

SQL Server 2017 Connections working in ASP.NET C# Web projects, but not in Windows projects, in Visual Studio 2019

Using the basic SqlConnection code below, I have discovered that, at my workstation, I am unable to connect to our Sql Server 2017 deployment via ASP.NET C# code in any given type of Windows-based project, such as Winforms (.NET Framework or Core) or Console apps. However, this code will run without incident in any Web-based project, such as Web Forms or MVC, either using .NET Framework or Core.
protected void testConnection()
{
string con = "Server=MySqlServer;database=MyDatabase;Integrated Security=true";
using (SqlConnection cnn = new SqlConnection(con))
{
cnn.Open();
cnn.Close();
}
}
In a web project, this code runs. In a Windows project, I get this error:
System.Data.SqlClient.SqlException: 'A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)'
In investigating this problem, I have tried the following:
Explicitly declaring the domain on which my SQL server is found (eg. MySqlServer.domain.com). No good.
Explicitly declaring the SQL Server port number, according to the example shown on connectionstrings.com (eg. MySqlServer, 1433). We do use the standard port number, for the record. No good.
Changing the protection level of the test method (protected/private/public). No good.
Connecting to the SQL Server in PowerShell. This connection worked.
Pinging in the SQL Server in a command prompt. The server responded in 1ms consistently.
I have asked other users on this network to test this code in a Winforms project on their workstations. No one is able to reproduce my issue.
Consulted my sysadmin. He is so far not able to find any reason why I should be having this issue.
The only difference I have noticed in all of this is that, when I declare the port number, the Inner Exception returned with the error reads "Win32Exception: A non-recoverable error occurred during a database lookup". Otherwise, it simply reads "Access is Denied."
All of this tells me that the issue is obviously something peculiar to my workstation, but I have no idea what, apart from some firewall or other local security setting that the sysadmin neglected to check. Has anyone encountered this problem?
My VS 2019 installation is only one revision out of date as of this writing, 16.8.3 as opposed to 16.8.4. I am able to connect to and run TSQL code on any database I care to via SSMS. We connect using Windows Authentication. According to the results of "select ##version", our version of SQL Server is 2017, 14.0.3356.20 (x64).
Any insight is appreciated.
We fixed it by forcing Named Pipes to be enabled in SQL Server, as opposed to using the default setting.

WScript.CreateObject throwing "Could not create object" error in Windows Server 2016

I am trying to create an object using WScript.CreateObject("ProgID of com.dll").
CreateObject method was working fine in Windows server 2008 and windows server 2012. But in windows server 2016, CreateObject method is not able to instantiate for a com.dll though it works for a normal DLL like "Excel.Application".
Code:
Dim tool
Set tool = WScript.CreateObject("ProgID")
It's throwing the error message:
WScript.CreateObject: Could not create object named "ProgID".
I have tried a few suggestions which I found in different sites to instantiate this like
Set tool = CreateObject("ProgID")
It throws the error message:
Microsoft VBScript runtime error: Out of memory: CreateObject
Is there any special execution instruction we need to take care of to avoid these errors? Has anyone has faced such errors?

IIS Express fails to create virtual directory

I have a web project that uses IISExpress and when attempting to load the project I receive the exception message below.

Visual Studio 2013.3 publish to azure website via web deploy validate connection fails with no error code

In Visual Studio 2013.3 I have created a test .Net 4.5 C# MVC 5 project to run in an Azure Website. I created a new Azure a/c and logged into it in VS. When I try and publish the project (running VS as Administator) the Validate Connection fails with no error code. I have re-downloaded the Publish settings from Azure to make sure I have the correct publish settings. The message I get is:
(2014-10-27 11:04:13) An error occurred when the request was processed on the remote computer.
The server experienced an issue processing the request. Contact the server administrator for more information.
When I try and publish the project anyway I get the following message:
C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(4270,5):
Error : Web deployment task failed. ((2014-10-27 11:06:25) An error
occurred when the request was processed on the remote computer.)
(2014-10-27 11:06:25) An error occurred when the request was processed
on the remote computer. The server experienced an issue processing the
request. Contact the server administrator for more information.
Publish failed to deploy.
I have installed the latest Azure SDK for Visual Studio 2013 2.4.1 via MS Web Plaform Installer 5.
The online Azure management pages shows the default website running. I'm running Windows 8.1.
One thing I have noticed is that if I change the sitename in the Publish settings I get:
Could not connect to the remote computer [...] The Remote name could
not be resolved.
Also when I try to ping the remote url i.e. [sitename].scm.azurewebsites.net:443 it times out, however, I can access it via a browser.
[UPDATE]
By Changing the output to verbose I get this message:
(2014-10-27 12:28:01) An error occurred when the request was processed on the remote computer.
The server experienced an issue processing the request. Contact the server administrator for more information.
at Microsoft.Web.Deployment.AgentClientProvider.GetHttpResponse(HttpWebRequest request)
at Microsoft.Web.Deployment.AgentClientProvider.PerformHeadRequestHelper(Boolean getVersionInfo, Version& maximumSupportedVersion, Version& minimumSupportedVersion)
at Microsoft.Web.Deployment.AgentClientProvider..ctor(DeploymentProviderContext providerContext, DeploymentBaseContext baseContext, String serverVersion)
at Microsoft.Web.Deployment.DeploymentManager.CreateObjectPrivate(DeploymentProviderContext providerContext, DeploymentBaseOptions baseOptions, DeploymentObject sourceObject, String serverVersion)
at Microsoft.Web.Deployment.DeploymentManager.CreateDestinationObject(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions, DeploymentObject sourceObject, String serverVersion)
at Microsoft.Web.Deployment.DeploymentObject.SyncTo(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions)
at CallSite.Target(Closure , CallSite , Object , Object , Object , Object )
at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid4[T0,T1,T2,T3](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
at Microsoft.Web.Publishing.Tasks.VSMSDeployObject.SyncTo(VSMSDeployObject destObject, Object syncOptions, IVSMSDeployHost _host)
at CallSite.Target(Closure , CallSite , VSMSDeployObject , VSMSDeployObject , Object , IVSMSDeployHost )
at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid4[T0,T1,T2,T3](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
at Microsoft.Web.Publishing.Tasks.BaseMSDeployDriver.InvokeMSdeploySync()
at Microsoft.Web.Publishing.Tasks.VSMSDeployDriverInCmd.StartSync()
at Microsoft.Web.Publishing.Tasks.BaseMSDeployDriver.SyncThruMSDeploy()
at Microsoft.Web.Publishing.Tasks.VSMSDeploy.Execute()
VSMSDeploy: Publish failed to deploy.
Done executing task "VSMSDeploy" -- FAILED.
Many thanks in advance.
Will
I ran to a similar problem while trying to publish Azure Mobile Service. Finally I managed to get rid of the problem by using MSDeploy.exe with -verb:delete parameter. I cannot provide you with the exact command line for your case, but in my case I've downloaded .publishsettings file from Azure Management portal and then I've run the following command:
set MSDeployPath=C:\Program Files\IIS\Microsoft Web Deploy V3\
"%MSDeployPath%"\msdeploy.exe -verb:delete -dest:ContentPath=<site name here>,PublishSettings=<path to downloaded .publishsettings file here>,AuthType='Basic'
Without .publishsettings file you'd have to deal with detailed parameters: computername, username and password.
After running the above command, I could publish my mobile service from VS.
It turned out to be an issue with the Windows region setting I was using. Apparently the region I was using wasn't supported by the VS publish system and Microsoft hadn't a fall back setup. I posted the question on an MSDN forum and a Microsoft engineer worked out what was going on.

SSIS: Using a script to download a file from an FTP site error

I am using SSIS 2008 on Windows 7. I am attempting to download a file from a site. I am able to connect to the site and I get a true when checking for a successful connection. However, when I invoke the method ftp.GetListing it jumps to the error handling portion of the code. The only errors I can get out of this are as follows:
From the Immediate Window:
A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in Microsoft.SqlServer.ManagedDTS.dll
From a message box in my try catch block:
Exception from HRESULT: 0xC001602A
I have checked and I am allowing SSIS Debug Host through the firewall. (It prompted me to the first time I ran the package.)
I have tried several FTP sites with the same results.
Thanks,

Resources