简体   繁体   English

使用CSV文件作为输入来运行交换管理Shell命令

[英]Using CSV files as input to run exchange management shell commands

I have a csv that looks like this: 我有一个csv,看起来像这样:

csv 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.

相关问题 使用Exchange命令行管理程序将邮箱属性从Exchange 2010导出到CSV - Exporting Mailbox Attributes from Exchange 2010 to CSV using Exchange Management Shell 将调用命令脚本块与交换管理 shell 一起使用 - Using invoke-command scriptblock with exchange management shell Exchange命令行管理程序默认Exchange Server - Exchange Management Shell Default Exchange Server 在脚本中检测是否通过普通 PowerShell 窗口或 Exchange 命令行管理程序运行 - Detect in script whether being run via normal PowerShell window, or Exchange Management Shell 从C#调用Exchange命令行管理程序 - Invoking Exchange Management Shell from C# Exchange命令行管理程序未连接到最近的Exchange服务器 - Exchange Management Shell doesn't connect to closest Exchange server Exchange命令行管理程序 - Exchange 2010 - 使用DateRange导出到PST,忽略过滤 - Exchange Management Shell - Exchange 2010 - Exporting with DateRange to PST ignoring the filtering 使用Exchange命令行管理程序基于AD登录名(SAMAccountName?)清除邮箱 - Clear mailboxes using Exchange Management Shell based on AD Logon Name (SAMAccountName?) C#已连接到Powershell,但是我需要连接到Exchange命令行管理程序 - C# Connected to Powershell, but I need connect to Exchange Management Shell Office文件中的Shell或bash命令 - Shell or bash commands in office files
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM