Войти

Показать полную графическую версию : [решено] Работа с объектами Wsus API


lox-ness
22-01-2019, 09:40
Добрый День!
Прошу помочь разобраться как вызывать интерфейсы, ни как не получается
Существует "IComputerTarget Interface" ttps://docs.microsoft.com/en-us/previous-versions/windows/desktop/aa354292%28v%3dvs.85%29
и как его получить не могу понять

PS Может букварь еще какой-нибудь кто-то подскажет, как работать с такими объектами

Kazun
22-01-2019, 10:08
Есть WSUS модуль - https://docs.microsoft.com/en-us/powershell/module/wsus (Get-WsusComputer)
Есть PoshWSUS модуль - https://github.com/proxb/PoshWSUS (Get-PSWSUSClient)

В документации можно найти: To get this interface, call one of the following methods: Item; GetComputer; GetComputerTarget; GetComputerTarget; RegisterComputer.

Скажем для примера, возьмем GetComputerTarget - https://blogs.technet.microsoft.com/heyscriptingguy/2012/01/19/use-powershell-to-find-missing-updates-on-wsus-client-computers/

[void][reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration")

#Connect to the WSUS Server and create the wsus object

$wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::getUpdateServer('dc1',$False)

#Create a computer scope object

$computerscope = New-Object Microsoft.UpdateServices.Administration.ComputerTargetScope

#Find all clients using the computer target scope

$wsus.GetComputerTargets($computerscope)

https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/76/18/8371.hsg-1-19-12-2.jpg

lox-ness
22-01-2019, 10:58
Спасибо, до меня дошло все!!!!!




© OSzone.net 2001-2012