päivitysten piilottaminen

miten olisi parasta piilottaa ja poistaa tarpeettomat päivitykset kun ei ole wsus käytössä. tällä hetkellä on käytössä tuollainen skripti mutta sen suoritusaika alkaa olla melkoisen pitkä vähänkin heikommalla raudalla. poistoon on toinen skripti jolla vaan wusa.exellä käydään läpi poistaen kaikki tarpeettomat päivitykset.

Function WuaVersion 'get current WUA version
Dim oAgentInfo, ProductVersion
On Error Resume Next
Err.Clear
Set oAgentInfo = CreateObject("Microsoft.Update.AgentInfo")
If ErrNum = 0 Then
WuaVersion = oAgentInfo.GetInfo("ProductVersionString")
Else
Wscript.Echo "Error getting WUA version."
WuaVersion = 0 'calling code can interpret 0 as an error.
End If
On Error Goto 0
End Function


if WuaVersion <> "0" then
Set ServiceManager = CreateObject("Microsoft.Update.ServiceManager")
ServiceManager.ClientApplicationID = "My App"

'add the Microsoft Update Service, GUID
Set NewUpdateService = ServiceManager.AddService2("7971f918-a847-4430-9279-4a52d1efe18d",7,"")
end if


'ServerSelection values
ssDefault = 0
ssManagedServer = 1
ssWindowsUpdate = 2
ssOthers = 3

'InStr values
intSearchStartChar = 1


dim strTitle


Set updateSession = CreateObject("Microsoft.Update.Session")
Set updateSearcher = updateSession.CreateupdateSearcher()

updateSearcher.ServerSelection = ssWindowsUpdate
Set searchResult = updateSearcher.Search("IsInstalled=0 and Type='Software'")


For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
strTitle = update.Title
if InStr(intSearchStartChar, strTitle, "KB971033", vbTextCompare) <> "0" then
update.IsHidden = True
end if
Next

For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
strTitle = update.Title
if InStr(intSearchStartChar, strTitle, "KB2970228", vbTextCompare) <> "0" then
update.IsHidden = True
end if
Next

For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
strTitle = update.Title
if InStr(intSearchStartChar, strTitle, "KB3004394", vbTextCompare) <> "0" then
update.IsHidden = True
end if
Next

For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
strTitle = update.Title
if InStr(intSearchStartChar, strTitle, "KB3035583", vbTextCompare) <> "0" then
update.IsHidden = True
end if
Next

For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
strTitle = update.Title
if InStr(intSearchStartChar, strTitle, "KB2965295", vbTextCompare) <> "0" then
update.IsHidden = True
end if
Next

For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
strTitle = update.Title
if InStr(intSearchStartChar, strTitle, "KB2965270", vbTextCompare) <> "0" then
update.IsHidden = True
end if
Next

For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
strTitle = update.Title
if InStr(intSearchStartChar, strTitle, "KB3038314", vbTextCompare) <> "0" then
update.IsHidden = True
end if
Next

For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
strTitle = update.Title
if InStr(intSearchStartChar, strTitle, "KB2990214", vbTextCompare) <> "0" then
update.IsHidden = True
end if
Next

For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
strTitle = update.Title
if InStr(intSearchStartChar, strTitle, "KB2952664", vbTextCompare) <> "0" then
update.IsHidden = True
end if
Next

For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
strTitle = update.Title
if InStr(intSearchStartChar, strTitle, "KB3021917", vbTextCompare) <> "0" then
update.IsHidden = True
end if
Next

For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
strTitle = update.Title
if InStr(intSearchStartChar, strTitle, "KB3068708", vbTextCompare) <> "0" then
update.IsHidden = True
end if
Next

WScript.Quit


mutta onko tähän jotain parempaa tapaa, tuo toimii mutta hidas.
0<50
Äänestä

Muut lukivat myös

Vastaukset

Vanhimmat

Ei vielä vastauksia

Aloittaja odottaa vastauksia. Kerro oma näkemyksesi ensimmäisenä.

Kommentoi aloitusta


xpjatkaa kirjoitti:

miten olisi parasta piilottaa ja poistaa tarpeettomat päivitykset kun ei ole wsus käytössä. tällä hetkellä on käytössä tuollainen skripti mutta sen suoritusaika alkaa olla melkoisen pitkä vähänkin heikommalla raudalla. poistoon on toinen skripti jolla vaan wusa.exellä käydään läpi poistaen kaikki tarpeettomat päivitykset.

Function WuaVersion 'get current WUA version
Dim oAgentInfo, ProductVersion
On Error Resume Next
Err.Clear
Set oAgentInfo = CreateObject("Microsoft.Update.AgentInfo")
If ErrNum = 0 Then
WuaVersion = oAgentInfo.GetInfo("ProductVersionString")
Else
Wscript.Echo "Error getting WUA version."
WuaVersion = 0 'calling code can interpret 0 as an error.
End If
On Error Goto 0
End Function


if WuaVersion <> "0" then
Set ServiceManager = CreateObject("Microsoft.Update.ServiceManager")
ServiceManager.ClientApplicationID = "My App"

'add the Microsoft Update Service, GUID
Set NewUpdateService = ServiceManager.AddService2("7971f918-a847-4430-9279-4a52d1efe18d",7,"")
end if


'ServerSelection values
ssDefault = 0
ssManagedServer = 1
ssWindowsUpdate = 2
ssOthers = 3

'InStr values
intSearchStartChar = 1


dim strTitle


Set updateSession = CreateObject("Microsoft.Update.Session")
Set updateSearcher = updateSession.CreateupdateSearcher()

updateSearcher.ServerSelection = ssWindowsUpdate
Set searchResult = updateSearcher.Search("IsInstalled=0 and Type='Software'")


For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
strTitle = update.Title
if InStr(intSearchStartChar, strTitle, "KB971033", vbTextCompare) <> "0" then
update.IsHidden = True
end if
Next

For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
strTitle = update.Title
if InStr(intSearchStartChar, strTitle, "KB2970228", vbTextCompare) <> "0" then
update.IsHidden = True
end if
Next

For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
strTitle = update.Title
if InStr(intSearchStartChar, strTitle, "KB3004394", vbTextCompare) <> "0" then
update.IsHidden = True
end if
Next

For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
strTitle = update.Title
if InStr(intSearchStartChar, strTitle, "KB3035583", vbTextCompare) <> "0" then
update.IsHidden = True
end if
Next

For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
strTitle = update.Title
if InStr(intSearchStartChar, strTitle, "KB2965295", vbTextCompare) <> "0" then
update.IsHidden = True
end if
Next

For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
strTitle = update.Title
if InStr(intSearchStartChar, strTitle, "KB2965270", vbTextCompare) <> "0" then
update.IsHidden = True
end if
Next

For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
strTitle = update.Title
if InStr(intSearchStartChar, strTitle, "KB3038314", vbTextCompare) <> "0" then
update.IsHidden = True
end if
Next

For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
strTitle = update.Title
if InStr(intSearchStartChar, strTitle, "KB2990214", vbTextCompare) <> "0" then
update.IsHidden = True
end if
Next

For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
strTitle = update.Title
if InStr(intSearchStartChar, strTitle, "KB2952664", vbTextCompare) <> "0" then
update.IsHidden = True
end if
Next

For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
strTitle = update.Title
if InStr(intSearchStartChar, strTitle, "KB3021917", vbTextCompare) <> "0" then
update.IsHidden = True
end if
Next

For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
strTitle = update.Title
if InStr(intSearchStartChar, strTitle, "KB3068708", vbTextCompare) <> "0" then
update.IsHidden = True
end if
Next

WScript.Quit


mutta onko tähän jotain parempaa tapaa, tuo toimii mutta hidas.

Anonyymi
5000

Ilmoita asiaton sisältö

  • Sisältää materiaalia, joka on loukkaavaa, herjaavaa, rasistista, uhkailevaa tai ahdistelevaa.

  • Materiaali sisältää nimiä, yhteystietoja tai muita henkilökohtaisia tietoja. Julkisuuden henkilöistä, julkisissa viroissa toimivista ihmisistä sekä yritysten vastuuhenkilöistä saa keskustella työhön liittyen. Myös yksityiselämään liittyvistä asioista voi keskustella siltä osin, kuin niistä on julkisesti kerrottu.

  • Sisältää lapsille haitallista tai heiltä kiellettyä materiaalia. Seksuaalinen sisältö on sallittua aiheeseen tarkoitetuilla palstoilla, joiden ikäraja on 18 vuotta.

  • Lainvastaista sisältöä voi olla mm. yksityiselämää loukkaavan tiedon levitys, kiihottaminen kansanryhmää vastaan, laiton uhkaaminen, alaikäisiin liittyvä seksuaalinen sisältö/grooming, petokset, identiteettivarkaudet, kunnianloukkaukset ja tekijänoikeusrikkomukset.

  • Sisältö ei liity palstan tai keskusteluketjun aiheeseen.

  • Viesti ei ole suomea tai ruotsia (pl. International Forums), se sisältää mainontaa, se sisältää tekijänoikeuksin suojattua materiaalia, se on massapostitus tai jokin muu syy.

Jaa keskustelu