wir versuchen derzeit über das Assetmanagement im WPM ein neues Device anzulegen. Dabei wird über ein Wizard die nötige Information abgefragt der dann die Daten an einen Workflow übergibt.
Hier soll nun per Powershell eine Empirum Session geöffnet werden : KLAPPT
Dann soll ein Device per
Code: Select all
$CreatedPC = New-EmpirumComputer -DomainName "$domain" -Name "$Computername" -Session $session -Uuid "$UUID" -IsPxe $TRUE
angelegt werden. Hier bekommen wir folgende Fehlermeldung vom System:
Code: Select all
Type: Matrix42.Workflows.Activities.PowerShell.PowerShellExecutionException Message: System.Management.Automation.CmdletInvocationException: Method not found: 'Void Matrix42.SDK.Contracts.Models.IEmpirumComputer.set_Force(Boolean)'. ---> System.MissingMethodException: Method not found: 'Void Matrix42.SDK.Contracts.Models.IEmpirumComputer.set_Force(Boolean)'. at Matrix42.SDK.Empirum.Powershell.CmdLets.NewEmpirumComputer.HandleCommand() at Matrix42.SDK.Empirum.Powershell.CmdLets.BaseClasses.EmpirumCmdBase.ProcessRecord() at System.Management.Automation.CommandProcessor.ProcessRecord() --- End of inner exception stack trace --- at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception) at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0) at System.Management.Automation.DlrScriptCommandProcessor.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input) at System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper() at System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc() Stack: at Matrix42.Workflows.Activities.PowerShell.ExecutePowerShell`1.EndExecute(AsyncCodeActivityContext context, IAsyncResult result) at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
Alle anderen Powershell befehle die wir getestet haben aus der SDK funktionieren soweit:
Code: Select all
$AddedComputer = (Get-EmpirumComputer -filter "Name eq '$Computername'" -Session $session) | Select -First 1
$AddToGroup= (Get-EmpirumGroup -filter "GroupID eq '$standardGroup'" -Session $session) | Select -First 1
Add-EmpirumComputerToGroup -Computer $AddedComputer -Session $session -Group $AddToGroup
Was machen wir falsch? Wenn ich die Powershell befehle auserhalb des workflows in einer Powershellconsole starte (selber server) funktioniert alles problemlos, am befehl selbst kann es also nicht liegen.
Viele Grüße
Doxlike1