I would like to install office sp2 remotely by creating a PSSession.
I will have the kb package in a share … This is what I have so far
$COMPAREDATE=GET-DATE
$NumberDays=14
$Pcs = $computers | Get-QADComputer -SizeLimit 0 -IncludedProperties LastLogonTimeStamp | where { ($CompareDate-$_.LastLogonTimeStamp).Days -lt $NumberDays }
$s = new-PSSession -computername ($PCs | select -ExpandProperty name) -ErrorAction SilentlyContinue
Invoke-Command -Session $s -ScriptBlock {
net use z: \\Servre01\Share
.\officesp2010-kb2687455-fullfile-x64-en-us.exe /quiet /norestart /log:c:\office.txt
}