looking to get this working somehow. I have a script that exports users that are not in a group to a csv file. I need to not export some users to the csv file. how can I adjust this. below is one of my failing scripts. Thanks in advance for any assistance.
Please use the PRE tags when posting code. Move the enabled and cannotchangepassword into the filter so that you not returning those records from the intial AD query. The valuesSamAcctName is an array, so you should use the -contains or -notcontains operator to filter the user: