vmware / PowerCLI-Example-Scripts

http://blogs.vmware.com/powercli
Other
754 stars 603 forks source link

Add-ActiveDirectoryIdentitySource fails with Invalid managed method 'AddExternalDomain' requested for Managed Object Type 'SsoAdminConfigurationManagementService' version 'sso/version1' #405

Closed wesold closed 3 years ago

wesold commented 3 years ago

===Tested Against Environment==== vSphere Version: 6.7 U3j (b16709110) PowerCLI Version: PowerCLI 12.0.0.15947286 PowerShell Version: 5.1.14393.2248 OS Version: Windows 10

Trying to add Active Directory as an External Identity Source is failing with the below.

@{PSMessageDetails=; Exception=System.Management.Automation.MethodInvocationException: Exception calling "AddActiveDirectoryExternalDomain" with "8" argument(s): "One or more errors occurred." ---> System.AggregateException: One or more errors occurred. ---> System.ServiceModel.FaultException1[VMware.vSphere.SsoAdminClient.SsoAdminServiceReferencer.RuntimeFault]: Invalid managed method 'AddExternalDomain' requested for Managed Object Type 'SsoAdminConfigurationManagementService' version 'sso/version1' at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result) at System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.<>c__DisplayClass6_0.<CreateTask>b__0(IAsyncResult asyncResult) at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization) --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at VMware.vSphere.SsoAdminClient.SsoAdminClient.AddActiveDirectoryExternalDomain(String domainName, String domainAlias, String friendlyName, String primaryUrl, String baseDNUsers, String baseDNGroups, String authenticationUserName, String authenticationPassword) at CallSite.Target(Closure , CallSite , Object , Object , String , Object , Object , Object , Object , Object , Object ) --- End of inner exception stack trace --- at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception) at System.Management.Automation.Interpreter.ActionCallInstruction2.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.PSScriptCmdlet.RunClause(Action1 clause, Object dollarUnderbar, Object inputToProcess) at System.Management.Automation.PSScriptCmdlet.DoEndProcessing() at System.Management.Automation.CommandProcessorBase.Complete(); TargetObject=; CategoryInfo=NotSpecified: (:) [Add-ActiveDirectoryIdentitySource], MethodInvocationException; FullyQualifiedErrorId=AggregateException,Add-ActiveDirectoryIdentitySource; ErrorDetails=; InvocationInfo=System.Management.Automation.InvocationInfo; ScriptStackTrace=at Add-ActiveDirectoryIdentitySource, C:\Users\Administrator\Documents\WindowsPowerShell\Modules\VMware.vSphere.SsoAdmin\VMware.vSphere.SsoAdmin.psm1: line 1374 at <ScriptBlock>, C:\Users\Administrator\Documents\WindowsPowerShell\Modules\VMware.vSphere.SsoAdmin\Test.ps1: line 55 at <ScriptBlock>, <No file>: line 1; PipelineIterationInfo=System.Collections.ObjectModel.ReadOnlyCollection1[System.Int32]}

Please let me know if there are any other debug details I can provide.

wesold commented 3 years ago

Not sure if the Error showed properly there, adding here without MD formatting

@{PSMessageDetails=; Exception=System.Management.Automation.MethodInvocationException: Exception calling "AddActiveDirectoryExternalDomain" with "8" argument(s): "One or more errors occurred." ---> System.AggregateException: One or more errors occurred. ---> System.ServiceModel.FaultException`1[VMware.vSphere.SsoAdminClient.SsoAdminServiceReferencer.RuntimeFault]: Invalid managed method 'AddExternalDomain' requested for Managed Object Type 'SsoAdminConfigurationManagementService' version 'sso/version1' at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result) at System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.<>c__DisplayClass6_0.b__0(IAsyncResult asyncResult) at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization) --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at VMware.vSphere.SsoAdminClient.SsoAdminClient.AddActiveDirectoryExternalDomain(String domainName, String domainAlias, String friendlyName, String primaryUrl, String baseDNUsers, String baseDNGroups, String authenticationUserName, String authenticationPassword) at CallSite.Target(Closure , CallSite , Object , Object , String , Object , Object , Object , Object , Object , Object ) --- 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.PSScriptCmdlet.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess) at System.Management.Automation.PSScriptCmdlet.DoEndProcessing() at System.Management.Automation.CommandProcessorBase.Complete(); TargetObject=; CategoryInfo=NotSpecified: (:) [Add-ActiveDirectoryIdentitySource], MethodInvocationException; FullyQualifiedErrorId=AggregateException,Add-ActiveDirectoryIdentitySource; ErrorDetails=; InvocationInfo=System.Management.Automation.InvocationInfo; ScriptStackTrace=at Add-ActiveDirectoryIdentitySource, C:\Users\Administrator\Documents\WindowsPowerShell\Modules\VMware.vSphere.SsoAdmin\VMware.vSphere.SsoAdmin.psm1: line 1374 at , C:\Users\Administrator\Documents\WindowsPowerShell\Modules\VMware.vSphere.SsoAdmin\Test.ps1: line 55 at , : line 1; PipelineIterationInfo=System.Collections.ObjectModel.ReadOnlyCollection`1[System.Int32]}

dmilov commented 3 years ago

Managed to reproduce with VC 6.5. This is again related to older than tested VC version API. I'll investigate further whether support for it can be added.

dmilov commented 3 years ago

I've fixed it. Please try with the latest and re-open if you hit any other issues.

wesold commented 3 years ago

Confirmed this fix has resolved the issue against vCenter 6.7 U3j.