I'm trying to make a script that would let me add phonenumber 2factor for multiple azure users at once from an array/list.
I thought that maybe a 2d array would be a nice solution. and then loop through the array and add each persons number as it goes down the list.
however powersehell is very much not my thing. so i cant rly get it going.
So if anyone could help me with how to make the 2 array, and how to then grab each nested array within the aray.
below is a "sketch" of what i would like to work.
$name = [
["[email protected]","+1 12345678"],
["[email protected]","+1 12345678"],
["[email protected]","+1 12345678"],
["[email protected]","+1 12345678"],
["[email protected]","+1 12345678"],
["[email protected]","+1 12345678"],
["[email protected]","+1 12345678"],
["[email protected]","+1 12345678"],
["[email protected]","+1 12345678"],
["[email protected]","+1 12345678"]
]
bellow is the command that i would use to add the number that belongs to the email.
foreach ($i in $name) {
New-MgUserAuthenticationPhoneMethod -UserId $navn[$i][0] -phoneType "mobile" -phoneNumber $navn[$i][1]
}