I created a script that reads out the ADgroups that have accessrights to networkshares, as listed in a txt file, and that reads out all ADUsers that are in those groups and saves them in a csv including which rights they have
My Prob: there are several People in multible Groups at some shares, so they appear multible times in the csv.
My question:
How do I delete double entriys in a csv by one column and leave the one with one special value in one of the columns?
This forum is for scripting questions rather than script requests. We do not write customized and ready to use scripts or solutions on request.
We actually expect you to make an own attempt at the first place to get your task done or to solve your problem. If you have done so already please document here what exactly you have done and show your code. Then we probably might be able to help you step further.
And BTW: When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.
What exactly does that mean? Processing your example from the top to the bottom I’d expect the data set Max;123456;ReadOnly to survive - not the one with the Write.
When you crosspost the same question at the same time to different forums you should at least post links to the other forums along with your question to avoid people willing to help you making their work twice or more.
Thanks
Johannes,
what’s wrong? Why do you ask your question again on StackOverflow before you even answer the back question you get here?
Hi Olaf
I guessed by get-Content select-object -unique, but that does not solve my problem that I want to keep the one with a specified value in the 3rd column.
I actually have no clue at all how I should get there
In my case I want do search the csv for duplicate employeenumbers, delete the duplicates and keep only the one with the value “write” in Accessrights
Wow thanks
And no offense, I’m a PS novice, I hardly stay in forums on such topics, but look for my answers piece by piece, I didn’t know that this would be interpreted so negatively.
Thank you for your help
Wouldn’t it be expected to behave in a good manner in Austria when you freshly come to a new group of people you don’t know and you expect help from?
So it is in communities in the internet as well. And I asked what value you want to keep in my first reply 2 hours ago.
Thanks again for the help
Yes, I actually missed the part where you ask me about the value, sorry for that again.
The method is thought outside the box, I focused all the time on first bringing the duplicate employee numbers together and then deleting the entry according to the value in the permissions instead of sorting by permission.
Learned something new again