Scripts

Ghetto Script to get Edge Information

I wrote this script in about 15 minutes to do Edge Configuration checks in Lync/Skype for Business.  It’s not very fancy, and in the next version, I will make it a little more automated.  The problem is most people don’t allow Remote PS (They just don’t set it up, or block it for some security reason, never mind RDP…).  Anyways here you go

new-item -Path “c:\Sources” -ItemType directory

$hostname = “c:\sources\” + $env:COMPUTERNAME

ipconfig /all | out-file $hostname-ipconfig.txt

route print | out-file $hostname-route.txt

$String = (get-content c:\windows\system32\drivers\etc\hosts) -notmatch {^#}

out-file -InputObject $String -FilePath $hostname-hosts.txt -Append

Get-CsCertificate | out-file “$hostname-cscerts.txt”

get-eventlog -LogName ‘Lync Server’ -EntryType Warning -Newest 200 | Select-Object -Unique | fl | out-file “$hostname-Warning.txt”

get-eventlog -LogName ‘Lync Server’ -EntryType Error -Newest 200 | Select-Object -Unique | fl | out-file “$hostname-Error.txt”

(gwmi win32_computersystem).partofdomain | out-file “$hostname-DomainMembership.txt”

Get-ChildItem hklm:\software\microsoft\windows\currentversion\uninstall | ForEach-Object {Get-ItemProperty $_.pspath | ? {($_.DisplayName -like “*SKype*”) -or ($_.DisplayName -like “*Lync*”)} | Select DisplayName,DisplayVersion,InstallDate} | fl | out-file $hostname-Version.txt

Get-ItemProperty hklm:\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters | select -ExpandProperty DisabledComponents -ErrorAction SilentlyContinue | out-file “$hostname-IPv6Registry.txt”

set-content “$hostname.zip” (“PK” + [char]5 + [char]6 + (“$([char]0)” * 18))

$ZipFile = (new-object -com shell.application).NameSpace(“$hostname.zip”)

Get-ChildItem -Exclude *.zip -Path c:\sources | foreach {$zipfile.CopyHere($_.fullname)}

5 thoughts on “Ghetto Script to get Edge Information

  1. Pingback: viagra 100mg
  2. Nolvadex Package Insert Lasix Indication [url=http://cheapcial40mg.com]cialis vs viagra[/url] For Sale Progesterone Next Day Tablets Fedex Shipping Saturn Cialis Levitra Antibiotic Amoxicillin

Leave a Reply

Your email address will not be published. Required fields are marked *