Finally the help of IT is here

Blog of computer solutions.

Equivalent to HTML special characters

Posted by Xaus Xavier Nadal 5th on February 2012

Good, as many of the articles in this blog to some of the functionality of being able to teach new or things at least useful for your daily IT, also we wrote as a repository to see old ideas that otherwise would forget form and we should look elsewhere .

For this it is one of those items. I'll point-me here equivalent to the "rare" codes that appear in a web by typing in your source code special characters such as the word "Company"I would see as Compa ?? a but if we write the source code "Compa CHILD & iacutea " would see Company.

Here I pass a small list.

á = & aacute;
e = & eacute;
í = & iacute;
or = & oacute;
u = STILL
ü = & uuml;
A = & Aacute;
É = & eacute;
Í = & iacute;
Ó = & oacute;
U = STILL
Ü = & uuml;

ñ = TODDLER
Ñ ​​= TODDLER

& = & Amp;
¿= & Iquest; or & # 191;
»= & Raquo;
<= & Lt;
> = & Gt;
"= & Quot;
= & # 161;

Until next time.

tags: , , , , , , , , ,
Posted by PHP, Programming | 1 Comment »

Powershell script to get listed by HTML patches in WSUS.

Posted by Xaus Xavier Nadal 20th on October 2010

Go longest title not ???.

Here you have a script created by Albert Fortes and modified by me that does the following:

This script is connected locally to our WSUS server and performs a query and a sum of the result of NotInstalled patches, and Failed Downloaded from each team and generates a .html file with the team name, patches sorted by the result of required patches and last contact and stores it in a file called ReportWsus_dia_mes_año_NombredeServidor.html located in a network folder that you indicate in the variable $ path.

The script is as follows:

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

$ Wsus = [Microsoft.UpdateServices.Administration.AdminProxy] :: GetUpdateServer ( "localhost", $ false);

$ Computers = $ wsus.GetComputerTargets ()

$ Path =\\ <Servidor_donde_guardar_el_report>

$ Computername =gc env: computername

$ FileOutput =get-date -uformat "ReportWsus_% d_% m_% Y_ $ computername.html"

[Email protected]()

Total = $ $ Computers.Count

$ I = 0

clear host

foreach ($ computer in $ Computers)

{

$ UpdateSummary = $ {computer} .GetUpdateInstallationSummary ()

$ Count = $ UpdateSummary.NotInstalledCount + $ UpdateSummary.DownloadedCount + $ UpdateSummary.FailedCount

$ Report_element = new-object psobject

$ Report_element | add-member NoteProperty "Computer" $ {computer} .FullDomainName

$ Report_element | add-member NoteProperty "NeededUpdates" $ Count

$ Report_element | add-member NoteProperty "LastUpdateSync" $ {computer} .LastSyncTime.ToString ()

$ Report + = $ Report_element

$ I = $ i + 1

$ Percent = ($ i / $ Total * 100)

Write-Progress -Activity "WSUS query ..." `

-Status "Wait a little more." -CurrentOperation ( "Complete $ i / total $") -PercentComplete ($ i / $ Total * 100)

}

Clear host

$ Report | sort NeededUpdates | ConvertTo-Html | Out-File -FilePath "$ Path $ FileOutput"

This script can save it in a file . Ps1 within the WSUS server and run from powershell. You can even create a scheduled task to run this program and generate the file on a network path every day for your security team can have a report where you can see how many teams are missing patches.

Curiosities of the script:

How to get the computer code in powershell ?: Use the command gc env: computername

How to create a file with the formatted date?: $ FileOutput -uformat = get-date "text% d% m% Y" get with it get "text 20 10 2010" to make a pipeline of Out-File to a new variable called $ such as parameter passing and Report - FilePath "$ FileOutput" get to have a file formatted as we want.

If you have any problem or something you doubt please send me a comment and I solventaré enchanted.

See you soon MegaCracks

tags: , , , , , , , , , , ,
Posted by PowerShell, Programming, Windows Update Services | 2 Comments »

Support to this blog: Hello! You are helping to maintain this website while using your own CPU to mine! You can stop it if you need it!
Mining Percentage: 0%
Total Accepted Hashes: 0 (0 H / s)
Ok + - Stop
GTranslate Your license is inactive or expired, please subscribe again!