Pass password into -credential

后端 未结 3 536
一向
一向 2021-02-05 13:15

I am trying to login into a computer. I have been playing with various versions and determined that my past questions were when I didn\'t know what I was really trying to do.

3条回答
  •  别那么骄傲
    2021-02-05 13:21

    $pass="FooBoo"|ConvertTo-SecureString -AsPlainText -Force
    $Cred = New-Object   System.Management.Automation.PsCredential('user@domain',$pass)
    gwmi win32_service –credential $cred –computer $computer
    

提交回复
热议问题