#JORGE NAVARRO MANZANO Script Doc Windows Server 20XX, needs .net 2.0 and powershell 2.0(check version with get-host) (updated for w2016)
#https://es.linkedin.com/in/jorgenavarromanzano
#more scripts here https://github.com/jorgenavarromanzano
#it creates two files nodename.html (in html format) and nodename.txt (tikiwiki format http://tiki.org)
#lot of info, like hw, devices, services, programs, updates, env, app infos, nlb, cluster, iis, ad, dns, dhcp, etc etc.
#used functions of productkeys for windows and sql from JAKOB BINDSLET and Chrissy LeMaire
#only compatible with english/spanish windows servers(you can run it in other languages but some string filters wont work)

#Instructions:#run as an administrator user powershell and copy all code
#if you want the script to copy the .txt and .html files to the directory of your pc from where you connect by rdp to the servers, just change the next folder:
#(need rdp drive redirection enabled)
#example: $locationdir = "\\tsclient\C\users\che\desktop\"
$locationdir = "\\tsclient\C\users\che\desktop\"
if(test-path $locationdir){ set-location $locationdir}

#INFO: #always #?optional only if exists


#Server Info
#ProductKeys
#Hardware
#Devices
#?Remote Console requieres hponcfg
#Performance
#ENV
#Eventlog
#Startup Programs
#Net
#ipconfig
#?nicteaming
#?MTU -> w2008 and earlier
#routes
#hosts file
#ntpclient
#other
#netstat
#?NLB
#?Cluster
#Shares-Mapped Drives
#ODBC
#?Roles-Features
#Programs
#Updates
#?IIS-FTP-SMTP
#?HyperV
#?RDS
#?PrintServer
#?Terminal Server
#?NPS
#?RAS
#Services
#Info Services
#Local Users/Groups/Policies
#?SQL Server -> user need to has access/permissions to SQL and pssnapin SqlServerCmdletSnapin100
#?DNS Server
#?DHCP Server
#?Printers
#?Active Directory
#Stats
#DCS
#Sites
#Trusts
#Authorized DHCP Servers
#DCDIAG
#Tasks
#Review
#Server Description add manually
#Service Check add manually
#Notes add manually

#changes (only after 202004)
#changes20200424
#add nic teaming
#add w2019
#add pending updates
#changes20200428
#added info allservices
#changed tiki first sections
#changes20200512
#added support automation tools output in $home of the user (usually local system is in C:\Windows\system32\config\systemprofile)
#changed copy to rdp folder
#added option to copy output to a shared folder
#changes20200513
#modified updates section (some errors because of wrong values in installedon value)
#notranscript if run from automation tool (because it fails with hp server automation)
#changes20200520
#added variable $numoutperformance for generating big performance report of servers