OPはColdFusionソリューションを検討していましたが、このPowerShellの例をコメントに要求しました。したがって、OPリクエストと一致しないため、否定的な評価を与えないでください。
@DavidBrierton PowerShellタグを質問に追加して、他の人がこの回答を見つけられるようにしてください。
このPowerShellスクリプトは、PowerShellの最新の実装用です。私はPowerShell 5.1でそれをテストしましたが、PowerShellの古いバージョンではおそらく動作します。古いWindows Serverを使用している場合は、「RSAT-AD-PowerShellのインストール」の行を調整する必要があります。必要な場合は、Windows 7からWindows 2012 R2までのインストール手順のURLを記載しました。
別注:PowerShellのアップグレードは無料で、あなたはここにソフトウェアを取得することにより、バージョン5.1にアップグレードすることができます。https://www.microsoft.com/en-us/download/details.aspx?id=54616
のPowerShellのインストール済みのバージョンが表示されます。このサンプルのコードの最初の行。
#display your version of PowerShell
$PSVersionTable.PSVersion
#install the RSAT-AD-PowerShell feature on Windows Server 2012 R2
#Source: https://4sysops.com/archives/how-to-install-the-powershell-active-directory-module/
Add-WindowsFeature RSAT-AD-PowerShell
# create array of usernames
$arrUserNames = @("Sta1", "Sta2", "Sta3", "Sta4", "Sta5")
# assign variable with new password
$password = "newpassword17!"
# loop over usernames and assign a new password
($arrUserNames).split(" ",[StringSplitOptions]'RemoveEmptyEntries') | foreach {
Write-Host "Changing password for: $_"
Set-ADAccountPassword -Identity $_ -Reset -NewPassword (ConvertTo-SecureString -AsPlainText $password -Force)
}
cfexecuteを名前リストのループ内に配置します。 –
@DanBracukこのような? (上記) –
理論的には良いですね。あなたはそれを試したとき何が起こったのですか?オムス、コンマの後のスペースは消えなければなりません。 –