how can i direct an intune powershell output to a sharepoint file
using a powershell script, i want to collect data from my devices, (e.g. setpoints, local admins, among other data not readily available/usable in entra) and store the data in a file i can review. i'm assuming a sharepoint site/file with permissions for all devices or users would be the way to go.
i can't get it to work directly with a sharepoint folder but i am able to get it to work for my own computer when i use a synced folder with perms set for everyone,
i can't get it to work from other devices, either the sharepoint or my synced folder, with all permissions for everyone. i get errors instead.
do i use mggraph? how can i store the retrieved data?here's part of a script i'm trying with the onedrive synced folder:
$computer="$env:COMPUTERNAME"
$rfile="_restorepoint_list.txt"
$errfile="_restorepoint_ps1_err.txt"
$filename="\Users\username\domainname\it - Documents\IT\Device_Local_Data\RPs"+ $computer + $rfile
$errfilename="\Users\username\domainname\it - Documents\IT\Device_Local_Data\RPs"+ $computer + $errfile
try {
#CheckPoint-Computer -description IntuneCreated
Get-ComputerRestorePoint > $filename
}
catch {
out-file $errfilename
}