[英]Using CSV files as input to run exchange management shell commands
I have a csv that looks like this: 我有一个csv,看起来像这样:
Column A is the account alias, B is the OU, c is firstname, D is lastname and so on. 列A是帐户别名,B是OU,c是名字,D是姓氏,依此类推。 I want to run the New-Mailbox -Alias firstlast -Name FirstLast -OrganizationalUnit domain/OU -FirstName firstname -LastName lastname - DisplayName "First Last" -UserPrincipalName firstlast@domain.com
我想运行New-Mailbox -Alias firstlast -Name FirstLast -OrganizationalUnit domain/OU -FirstName firstname -LastName lastname - DisplayName "First Last" -UserPrincipalName firstlast@domain.com
How do I get the CSV file to function as the input for these cmdlets? 如何使CSV文件用作这些cmdlet的输入? I'm familiar with the Import-CSV
cmdlet but I'm unsure of how to get it to work in these specific circumstances. 我熟悉Import-CSV
cmdlet,但是不确定如何在特定情况下使用它。
Import-Csv file.csv | % { New-Mailbox -Alias $_.Alias -Name $_.Name ... }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.