I am getting the error below everytime I run the this powershell script I have created. It works fine at my house and my friend's house but not at my job it always gives me the same error below.
Property 'sn' cannot be found on this object; make sure it exists and is settable.
At C:\Scripts\MergeScript3.ps1:20 char:10
+ $ADUser. <<<< sn = $user.'sn'
+ CategoryInfo : InvalidOperation: (:) , RuntimeException
+ FullyQualifiedErrorId : PropertyAssignmentException
If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.