This is directed towards Exchange/Office 365 powershell but can apply for other types as well.
If i have a list of users for example, and I use UserPrincipalName
for their identity - now in all my scripts I can pull data using UserPrincipalName
for the identity, but in most UserPrincipalName
isn't actually an exportable value. So, if you take my two examples below I can pull data in both using UserPrincipalName
for the identity, but in the 2nd one the ouput would be blank.
How can I insert for example the identity value UserPrincipalName
into the 2nd. This would apply for more than the two scripts mentioned below.
$CSV | foreach {
Get-Mailbox -resultsize unlimited -Identity $_.UserPrincipalName
} | select userprincipalname, server |out-gridview
Example output:
UPN@something.com, server101
$csv | ForEach {
Get-ActiveSyncDeviceStatistics -Identity:$_.UserPrincipalName
} | select DeviceFriendlyName,UserPrincipalName |out-gridview
Example output:
2nd: DeviceIOS4,-