Dear
i'm trying to execute Exchange PS command in asp.net
it's working fine when i run this command from my local machine
this is url http://localhost:1975/meABC/test.aspx
but wehn i run this code inside the server i got this error http://me.ABC.com.sa/test.aspx
Server Error in '/PS_Enable' Application.
Database "ABCCNTMSG02\ABCCNTMSG02-SG7\ABCCNTMSG02-DB7" was not found. Please make sure you have typed it correctly.
here is my code
'references to work with Powershell command
Imports System.Management.Automation
Imports System.Management.Automation.Host
Imports System.Management.Automation.Runspaces
'references to work with Powershell command
Imports System.Collections.Generic
Imports System.Collections.ObjectModel
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim rsConfig As RunspaceConfiguration = RunspaceConfiguration.Create
Dim snapInException As PSSnapInException = Nothing
Dim info As PSSnapInInfo = rsConfig.AddPSSnapIn("Microsoft.Exchange.Management.PowerShell.Admin", snapInException)
Dim myRunSpace As Runspace = RunspaceFactory.CreateRunspace(rsConfig)
myRunSpace.Open()
Dim pipeLine As Pipeline = myRunSpace.CreatePipeline
Dim vid As String = "ABC.corp\uid"
Dim PrimarySMTP As String = "uid.c@ABC.com.sa"
Dim valias As String = "uid"
Dim vdb As String = "CN=ABCCNTMSG02-DB7,CN=ABCCNTMSG02-SG7,CN=InformationStore,CN=ABCCNTMSG02,CN=Servers,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=ABC,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=root,DC=ad"
Dim EMSCmd As Command = New Command("Enable-Mailbox")
EMSCmd.Parameters.Add("DomainController", "ABCCNTDC21")
EMSCmd.Parameters.Add("Identity", vid)
EMSCmd.Parameters.Add("Alias", valias)
EMSCmd.Parameters.Add("Database", vdb)
EMSCmd.Parameters.Add("PrimarySmtpAddress", PrimarySMTP)
pipeLine.Commands.Add(EMSCmd)
Dim cmdData1 As Collection(Of PSObject) = pipeLine.Invoke()
End Sub
End Class
when i added this line to see more error details Response.Write("IsOpen: " & pipeLine.Error.IsOpen)
I got this error IsOpen: False
then after searchinig in many articles i've read this Post from asp.net forum and i follow the steps but still same problem
http://forums.asp.net/p/1272317/2408799.aspx
one i change DefaultAppPool identity to my account and try to browse web site
I got error Service Unavaliable
Plz help me to to solve this issue so i can sleep good 
Thanks in advance