私はPowershellについて学んでいます。私はADでデータを更新しようとしますが、私のADサーバーとPowershellは異なるサーバーにあります。PowershellとColdFusionは異なるサーバーでアクティブなディレクトリを更新します
たとえば、私のADサーバーは111.111.111.111で、Powershell.exeはサーバー222.222.222.222にあります。私はPowershellスクリプトを実行するためにColdFusionプログラミングを使用しています。ここで
は私のColdFusionスクリプトです:ここで
<cfoutput>
<cfexecute name="C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
arguments="C:\Users\Public\Documents\ADtest.ps1" />
</cfoutput>
は私のPowerShellのスクリプトADtest.ps1です:
$userID = "11111"
$password = "[email protected]"
$ADuser = Get-ADUser $userID
If($ADuser)
{
Enable-ADAccount -Identity $userID
Set-adaccountpassword $userID -reset -newpassword (ConvertTo-SecureString -AsPlainText $password -Force)
Set-aduser $userID -changepasswordatlogon $true
}
はAD(アクティブディレクトリ)を更新するPowerShellスクリプトを実行することが可能です上のデータ別のサーバーですか?
を-tomお役に立てば幸いです。 –