how can i direct an intune powershell output to a sharepoint file

Michael J. Langone 0 Reputation points
2025-02-25T18:34:32.03+00:00

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

}

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,830 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.