0
매개 변수가있는 Office 2010을 설치하는 중 스크립트를 배포 할 수있는 관리자 권한이있는 PSSession
을 만들었지 만 여러 사용자에게 문제가 있습니다.Powershell foreach in pssession
설치가 시작되지 않으므로 invoke를 사용할 수 없습니다.
이 스크립트를 여러 컴퓨터에 배포하는 다른 방법이 있습니까?
CLS
Start-Job -Name Job1 -ScriptBlock {
$domainuser = "$env:USERDNSDOMAIN\administrator"
$domainpassword = 'Credential' | ConvertTo-SecureString -AsPlainText -Force
$domaincredentials = New-Object System.Management.Automation.PSCredential ($domainuser, $domainpassword)
$ip = "192.168.10.75"
Enter-PSSession -ComputerName $ip -Credential $domaincredentials }
Wait-Job -Name Job1
Start-Process -FilePath "powershell" -Verb runAs
Start-Process -FilePath "C:\temp\32 Bit\setup.exe" -ArgumentList "/adminfile Office2010.MSP"