powershell-intune-samples icon indicating copy to clipboard operation
powershell-intune-samples copied to clipboard

Win10_PrimaryUser_Get.ps1

Open Konnann78 opened this issue 4 years ago • 1 comments

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!

Konnann78 avatar May 12 '21 20:05 Konnann78

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'

taspanja avatar May 20 '21 08:05 taspanja