I'm using the following code to update multiple administrator passwords on managed computers. I have looked up documentation, but I cannot determine if the .setpassword command is secure over the network. Is it encrypted in any fashion?
I've heard mention that Powershell sometimes encrypts commands using the network credentials of the logged-in user, but I cannot verify that.
foreach($computer in Get-Content "hosts.txt") {
>> $adminUser = [ADSI] "WinNT://$computer/Administrator"
>> $adminpassword = ...
>> Write-Output $computer
>> Write-Output $adminpassword
>> $adminUser.SetPassword($adminpassword)
>> }
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…