Hi<\/p>\n
Can someone please help with this error below?<\/p>\n
If I run only the CSV import, I can see the correct values.<\/p>\n
PS C:\\Windows\\system32> Import-Csv C:\\PowerShell\\usersAD.csv -Delimiter ‘,’ | foreach{copy-ADaccount -UserPrincipalName $.UserPrincipalName -targetSite $<\/em>.targetSite -Domain $.Domain -Rename $<\/em>.Rename -Move $_.Move}<\/p>\n ErrorRecord : The argument is null or an element of the argument collection contains a null value.<\/p>\n WasThrownFromThrowStatement : False<\/p>\n Message : The argument is null or an element of the argument collection contains a null value.<\/p>\n Data : {}<\/p>\n InnerException :<\/p>\n TargetSite : Void Validate(System.Object, System.Management.Automation.EngineIntrinsics)<\/p>\n StackTrace : at Microsoft.ActiveDirectory.Management.Commands.ValidateAttributeValueHashtableAttribute.Validate(Object arguments,<\/p>\n EngineIntrinsics engineIntrinsics)<\/p>\n at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal parameter,<\/p>\n CompiledCommandParameter parameterMetadata, ParameterBindingFlags flags)<\/p>","upvoteCount":5,"answerCount":6,"datePublished":"2022-02-22T15:08:26.000Z","author":{"@type":"Person","name":"virtual-fixer","url":"https://community.spiceworks.com/u/virtual-fixer"},"suggestedAnswer":[{"@type":"Answer","text":" Hi<\/p>\n Can someone please help with this error below?<\/p>\n If I run only the CSV import, I can see the correct values.<\/p>\n PS C:\\Windows\\system32> Import-Csv C:\\PowerShell\\usersAD.csv -Delimiter ‘,’ | foreach{copy-ADaccount -UserPrincipalName $.UserPrincipalName -targetSite $<\/em>.targetSite -Domain $.Domain -Rename $<\/em>.Rename -Move $_.Move}<\/p>\n ErrorRecord : The argument is null or an element of the argument collection contains a null value.<\/p>\n WasThrownFromThrowStatement : False<\/p>\n Message : The argument is null or an element of the argument collection contains a null value.<\/p>\n Data : {}<\/p>\n InnerException :<\/p>\n TargetSite : Void Validate(System.Object, System.Management.Automation.EngineIntrinsics)<\/p>\n StackTrace : at Microsoft.ActiveDirectory.Management.Commands.ValidateAttributeValueHashtableAttribute.Validate(Object arguments,<\/p>\n EngineIntrinsics engineIntrinsics)<\/p>\n at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal parameter,<\/p>\n CompiledCommandParameter parameterMetadata, ParameterBindingFlags flags)<\/p>","upvoteCount":5,"datePublished":"2022-02-22T15:08:26.000Z","url":"https://community.spiceworks.com/t/powershell-ise-error-null-value/825808/1","author":{"@type":"Person","name":"virtual-fixer","url":"https://community.spiceworks.com/u/virtual-fixer"}},{"@type":"Answer","text":" If you post code, please use the ‘Insert Code’ button. Please and thank you!<\/p>\n