AdsiPS icon indicating copy to clipboard operation
AdsiPS copied to clipboard

Get-ADSIComputer -Identity $Computer does not like multiple computers with same name

Open lazywinadmin opened this issue 9 years ago • 0 comments

PSMessageDetails : Exception : System.Management.Automation.MethodInvocationException: Exception calling "FindByIdentity" with "2" argument(s): "Multiple principals contain a matching Identity." ---> System.DirectoryServices.AccountManagement.MultipleMatchesException: Multiple principals contain a matching Identity. at System.DirectoryServices.AccountManagement.ADStoreCtx.FindPrincipalByIdentRefHelper(Type principalType, String urnScheme, String urnValue, DateTime referenceDate, Boolean useSidHistory) at System.DirectoryServices.AccountManagement.ADStoreCtx.FindPrincipalByIdentRef(Type principalType, String urnScheme, String urnValue, DateTime referenceDate) at System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithTypeHelper(PrincipalContext context, Type principalType, Nullable1 identityType, String identityValue, DateTime refDate) at System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithType(PrincipalContext context, Type principalType, String identityValue) at System.DirectoryServices.AccountManagement.ComputerPrincipal.FindByIdentity(PrincipalContext context, String identityValue) at CallSite.Target(Closure , CallSite , Type , Object , String ) --- 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) TargetObject : CategoryInfo : NotSpecified: (:) [], MethodInvocationException FullyQualifiedErrorId : MultipleMatchesException ErrorDetails : InvocationInfo : System.Management.Automation.InvocationInfo ScriptStackTrace : at Get-ADSIComputer<Process>, <No file>: line 200 at <ScriptBlock>, <No file>: line 219 PipelineIterationInfo : {}

lazywinadmin avatar Nov 01 '16 21:11 lazywinadmin