/build/static/layout/Breadcrumb_cap_w.png

Drive map export to csv

So I have a PS script that just displays a users mapped network drives and I also added the option to export this data to csv. This works fine in Powershell but I cannot figure out how to deploy it out through KACE. Ideally every user it is pushed to would export a unique csv file so I can tell them apart. I am not the best with Powershell so any help is appreciated. 


Get-PSDrive -PSProvider FileSystem | select Name, Root, DisplayRoot, @{N='user';e={$env:username}} | Export-CSV -path "\\FilePath\Filename.csv"


1 Comment   [ + ] Show comment
  • Not sure what you are trying to get KACE to do, is it to export the csv locally to the users’ drive? Or do you want the data displayed within a custom field in the inventory record of the device? - Hobbsy 3 years ago

Answers (1)

Posted by: TheITNooB 3 years ago
Orange Belt
0

Going based off your question you can get this done using Kace Online KScript. Make sure to set the option: Windows RunAs : Logged-in user

Using your script I created a powershell file and modified the file name portion so that it will be named specifically to the user that it runs as: username-drives.csv

Get-PSDrive -PSProvider FileSystem | select Name, Root, DisplayRoot, @{N='user';e={$env:username}} | Export-CSV -path "\\FileServerName\$env:username-drives.csv"

During my test I was able to successfully run your script and export my mapped drives CSV file to one of my file shares. Make sure its a location that your users have access to write to so that they dont get errors.


The alternate way of doing this is having the file saved locally to your computers as a .TXT and making a Custom Inventory Rule to read the file contents. This can then be viewed in the targeted machines "Custom Inventory Fields" section when looking it up in Inventory. The benefit to this is that you dont have hundreds/thousands of CSV files in your file share. Also you can use KACE to run reports if looking for people who are mapped to specific letters or locations.

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ