Thursday, May 18, 2017

Windows Update

dism /online /get-packages

Get-WmiObject -Class "win32_quickfixengineering" | Select-Object -Property "Description", "HotfixID", @{Name="InstalledOn"; Expression={([DateTime]($_.InstalledOn)).ToLocalTime()}}

$Session = New-Object -ComObject "Microsoft.Update.Session"
$Searcher = $Session.CreateUpdateSearcher()
$historyCount = $Searcher.GetTotalHistoryCount()
$Searcher.QueryHistory(0, $historyCount) | Select-Object Title, Description, Date, @{name="Operation"; expression={switch($_.operation){1 {"Installation"}; 2 {"Uninstallation"}; 3 {"Other"}}}}

Friday, April 21, 2017

Like button for Outlook email

Recently my colleague was asking is there a like feature in Outlook.  I showed him the new Icon insert option.  It helped, but he was just looking for a one click solution.

Here the OneClick solution.  You need to have the below macro and introduce this as a new button in outlook menu!

Now you can start liking the emails.

Sub InsertLike()
    'Dim objDoc As Word.Document, objSel As Word.Selection
    On Error Resume Next
    '~~> Get a Word.Selection from the open Outlook item
    Set objDoc = Application.ActiveInspector.WordEditor
    Set objSel = objDoc.Windows(1).Selection
    '~~> Type Relevant Text
    'objSel.TypeText "Sorry cannot help"
    objSel.InlineShapes.AddPicture FileName:="" _
        , LinkToFile:=False, SaveWithDocument:=True
    Set objDoc = Nothing
    Set objSel = Nothing
End Sub

Saturday, November 19, 2016

T4 Template

T4 templates are build-in feature for Visual Studio IDE.  Here is the video to get started.

T4 can be used in many areas.  Recently I am working on big data solutions, in which the scripting language does not provide looping mechanism.  The T4 template become handy to bridge the gap and avoid spinning up multiple jobs to process every day data.

Saturday, June 25, 2016

Learning from CorpNet support help desk

Here is my learning from our Support Help desk for my CorpNet related issues.

RAS connection not working
Many time the RAS issues are due to IP cache, try the following commands to reset the IP 

  • netsh int ip reset
  • netsh winsock reset
  • ipconfig/flushdns             
  • ipconfig/flushdns
  • nbtstat -R
  • nbtstat -RR
  • ipconfig/registerdns 

Unable to access local sites

If the group policy not updated you may have diff access issues.  By running gpupdate /force from elevated problem, you can make sure the gp is updated.

User autoenrollment is triggered by the Winlogon process (interactive logon with CTRL+ALT+DELETE keys) or at Group Policy refresh intervals. Normally, User Group Policy is refreshed at logon and Machine Group Policy is refreshed at machine reboot. Group Policy may be manually refreshed using the gpupdate.exe tool that is included in Windows XP.

India Tour

Ticket Booking ...