Hello, what I need to do is get a CSV file with two columns - the first with a list of all users in AD, and the other column with the value of the AD attribute 'userSharedFolder' for that user.
I'm a PowerShell learner. Here's what I have so far...
Get-ADUser –Filter * -prop cn,userSharedFolder | select cn,userSharedFolder > \\server\share\IT\Scripts\AD\Ldrive.csv
Now, all the info is there in the resulting CSV, but there are a few formatting issues. Firstly, the output is not on separate columns in Excel - it's all on the same column, just with loads of white space between the username and the userSharedFolder. How do I get them onto separate columns, with no white space? Secondly, I have some usernames that have a leading zero, but Excel sees it fit to remove this digit. Can you stop this from happening at the script level, or would this be an Excel thing?
Any other tips to improve the above command would be welcomed.
Thanks.
cn,"userSharedFolder"
I'm guessing the existence of the comma is a Delimiter issue isn't it. Am I able to modify the command to make Excel treat this as two columns? I realise I can do an Insert Object from within Excel but I was just wondering if there is a way to do this from the command.
Also, is there a way of removing the quotes around the userSharedFolder entries?
Thanks.