Chris Bush
asked on
Powershell Azure Active Directory - Need Numbers from Names of Devices
Ok gang,
I have a CSV of Device Names in Azure AD, I want to get a list of DeviceID or ObjectId for each of the names on the list.
I have tried the following
#
$CHGList = Import-Csv -path C:\Users\username\desktop\ CHGList.cs v
get-msoldevice -name $CHGList | Select-Object ObjectID | Export-CSV -Path "C:\Users\username\desktop \AzureDevi ceID.csv"
#
I have tried piping over results and running it that way
I have tried changing the Custom Object to a String
I have tried
#
$CHGList = Import-Csv -path C:\Users\username\desktop\ CHGList.cs v
$Modification = $null
$Modification = $CHGList -join ","
get-msoldevice -name $Modification | Select-Object ObjectID | Export-CSV -Path "C:\Users\username\desktop \AzureDevi ceID.csv"
#
I've looked at trying to loop through the CSV file and it's making no sense.
Can I get some help?
Thanks all for your time.
I have a CSV of Device Names in Azure AD, I want to get a list of DeviceID or ObjectId for each of the names on the list.
I have tried the following
#
$CHGList = Import-Csv -path C:\Users\username\desktop\
get-msoldevice -name $CHGList | Select-Object ObjectID | Export-CSV -Path "C:\Users\username\desktop
#
I have tried piping over results and running it that way
I have tried changing the Custom Object to a String
I have tried
#
$CHGList = Import-Csv -path C:\Users\username\desktop\
$Modification = $null
$Modification = $CHGList -join ","
get-msoldevice -name $Modification | Select-Object ObjectID | Export-CSV -Path "C:\Users\username\desktop
#
I've looked at trying to loop through the CSV file and it's making no sense.
Can I get some help?
Thanks all for your time.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No worries, PowerShell is not that hard when you get the hang of it :) Dont forget to mark the answer.
If you feel this question wasn't answered or should be closed differently, post an objection. The moderators will review all objections and close it as they feel fit.
ASKER