を見つけるためにあなただけの新しい値は、ループ内の各ユーザのために一意であるように、foreachのループ内の現在のクォータ値に200MB
を追加する必要があります。どのようにあなたのcsvのように見えるかわからないので、私はサンプルcsvを作成しました。
これは
list.csv
User,IssueWarningQuota,ProhibitSendQuota,ProhibitSendReceiveQuota,SomeOtherColumns
User1,209715200,262144000,293601280,SomeOtherValue
User2,314572800,367001600,398458880,SomeOtherValue2
サンプルのすべての未テストコードですので、私は、Exchange環境を持っていない:あなたのcsvファイルが含まれていない場合は
$list = Import-Csv -Path c:\list.csv
foreach ($user in $list) {
#Create variables with new quota-values for readability. Can be replaced with -IssueWarningQuoa ([int]$_.IssueWarningQuota + $AddQuota) -Prohi.... in the command itself.
#Values from CSV are string by default, so we need to cast the value to int before adding (unless it will append to string).
$IssueWarningQuota = [int]$_.IssueWarningQuota + 200MB
$ProhibitSendQuota = [int]$_.ProhibitSendQuota + 200MB
$ProhibitSendReceiveQuota = [int]$_.ProhibitSendReceiveQuota + 200MB
Set-mailbox -identity $user.user -UseDatabaseQuotaDefaults $false -IssueWarningQuota $IssueWarningQuota -ProhibitSendQuota $ProhibitSendQuota -ProhibitSendReceiveQuota $ProhibitSendReceiveQuota
}
現在のクォータ値を取得するには、Get-MailBox
を使用します。
$list = Import-Csv -Path c:\list.csv
foreach ($user in $list) {
$mb = Get-Mailbox $user.user
$IssueWarningQuota = $mb.IssueWarningQuota + 200MB
$ProhibitSendQuota = $mb.ProhibitSendQuota + 200MB
$ProhibitSendReceiveQuota = $mb.ProhibitSendReceiveQuota + 200MB
Set-mailbox -identity $user.user -UseDatabaseQuotaDefaults $false -IssueWarningQuota $IssueWarningQuota -ProhibitSendQuota $ProhibitSendQuota -ProhibitSendReceiveQuota $ProhibitSendReceiveQuota
}
私はあなたが立ち往生するならあなたのスクリプトを手助けしますが、これはスクリプト作成サービスではありません。メールボックス情報を参照し、メールボックスサイズを返し、200MBを追加し、最後にそのメールボックスクォータを設定したいとします。エラーが発生した場合は、スクリプトを検索して投稿してください。 – user4317867
ありがとうUser437867あなたの返事は:)私のスクリプトを書く人を探していないが、私はここのユーザーはpowershell \ excahngeの専門家であり、彼らはアイデアを共有していると思った 私は自分の仕事を達成する方法についてアイデアを探していた:)すべてのユーザーが同じメールボックスサイズを持つようにしたいのですが、現在のサイズにスペースを追加する方法を見つけようとしています。再度ご返信ありがとうございます – Yallabina
データベースのデフォルトの割り当てを使用しない200Mbのすべての割り当て量を変更する予定ですか? – Matt