Help with Script to collate logon batch files

Hi All,

We have a bunch of logon scripts set for each user i’m trying to convert to GPO

As part of this i need to scan everyones shared directory to pull out the drive mappings in the file.

I’d like it to spit out in a nice csv file with Username,Drive Letter, Path however i don’t have the skills to do so!

Right now i have the below

Get-ChildItem \SharesProfiles$ -include mapdrive.bat -Recurse | ForEach-Object {gc $_; "" + $_.FullName} | out-file C:Results.txt 

Which works in that i end up with a text file with a bunch of data in it – but it’s ugly as hell. Is anyone able to help me out with a script that would do this?

submitted by /u/LowestKillCount
[link] [comments]

Leave a Reply