powershell-intune-samples
powershell-intune-samples copied to clipboard
Win10_PrimaryUser_Get.ps1
Is there a way to output this into a .csv file 1 entry/row? ./Win10_PrimaryUser_get.ps1 -DeviceName "AUTOPname"
I've tried Out-File, Export-csv Thank you!
Usually what I would do is to create a list of the device names that I want and save it as csv then i would run the below:
$ComputerList = Import-Csv 'C:\FilePath\ComputerList.csv'
$PrimaryUsers = foreach ($ComputerName in $ComputerList){ ./Win10_PrimaryUser_get.ps1 -DeviceName $ComputerName }
$PrimaryUsers | Export-Csv 'C:\FilePath\PrimaryUsers.csv'