none
Exception when password field of IWSManConnectionOptions is set RRS feed

  • Question

  • Hi,

    I had a WSMAN client application using the WsmAuto.dll which was working well on Windows Server 2008 R2. When tried with Windows Server 2012/8, I get COMException when Password field of IWSManConnectionOptions object is set. Here is the error I get:

    Error Msg:

    The specified procedure could not be found.

    Here is the Stack Trace. (I have '-' dashed out my program name and file):
       at WSManAutomation.IWSManConnectionOptions.set_Password(String )
       at ------------------------------------.Program.Main(String[] args) in c:\----------------------------------------------------------\Program.cs:line 22
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()

    Interestingly if I have the following snippet of code in a newly created application, it works well.

    WSManClass wsman = new WSManClass();
    IWSManConnectionOptions objConnectionOptions = (IWSManConnectionOptions)wsman.CreateConnectionOptions();
    objConnectionOptions.UserName = "root";
    objConnectionOptions.Password = "password";
    Also checked the following between both these project:

    - .NET version is same

    - Using same WsmAuto.dll

    -Sunil

    Wednesday, April 17, 2013 3:29 PM

Answers