воскресенье, 1 июня 2014 г.

Заставляем обновляться удаленный ПК с помощью powershell

<# 
.Synopsis 
    Force Install Updates on Remote Computer 
.DESCRIPTION 
    Force Install Updates on Remote Computer using a scheduled task 
.EXAMPLE 
    InstallUpdates -Computer "server1.contoso.com" -User "Contoso\Administrator" -Password "Password" 
.NOTES 
    Version 1.0 - Initial Script 
    Written by Darryl van der Peijl 
    Date: 30.05.2014 
 
    Use at own risk 
#> 
 
Function InstallUpdates { 
param($Computer,$User,$Password) 
 
$SecurePassword = ConvertTo-SecureString –String $Password –AsPlainText -Force 
$Credential = New-Object –TypeName System.Management.Automation.PSCredential –ArgumentList $User$SecurePassword