.net - Running Powershell scripts for Exchange in web services -
.net - Running Powershell scripts for Exchange in web services -
i trying run powershell scripts microsoft exchange in web services. code written below works fine when run console application when move web services project , phone call web method, errors when calls addpssnapin. thought why? i'm running on windows server 2008 r2 64-bit machine. target platform has been changed cpu x64 without luck.
dim rsconfig runspaceconfiguration = runspaceconfiguration.create() dim snapinexception pssnapinexception = nil dim info pssnapininfo = rsconfig.addpssnapin("microsoft.exchange.management.powershell.e2010", snapinexception) <-- throws error ' create powershell runspace , open dim myrunspace runspace = runspacefactory.createrunspace(rsconfig) myrunspace.open() error- system.web.services.protocols.soapexception: system.web.services.protocols.soapexception: server unable process request. ---> system.management.automation.psargumentexception: no snap-ins have been registered windows powershell version 2."
the issue web service created on visual studio development server, not local (or other) server , security/permissions must tighter. after selecting properties web service project , going web tab, selected "use local iis web server" , had virtual directory created. in iis manager, enabled windows authentication web service , fixed issue!
.net web-services powershell pssnapin
Comments
Post a Comment