PowerShell : Finding number of lines in a File

Requirement: In Automation using PowerShell Scripting its very often a requirement to read input from a file.  Usually the input is separated by new line in the file. Your PowerShell should read all lines from the file and process the input line by line. Say, you have list of servers in file and you want to check service status for each of the server in the file.  Solution: In PowerShell Get-Content is used for most cases to read a file and process it line by line. It just works fine in most of the cases. But if you need to […]

Read more

Resolving Windows Updates Download and Install Errors on Windows 10

Scenario: Windows Updates stuck at downloading Windows Updates Windows Updates reports Error for “Update for Microsoft Office 2013 (KB2837655) RT” Event Viewer reports below error in the logs: Log Name:      ApplicationSource:        Windows Error ReportingDate:          4/11/2016 1:04:28 AMEvent ID:      1001Task Category: NoneLevel:         InformationKeywords:      ClassicUser:          N/AComputer:      HomePC1Description:Fault bucket 125972652706, type 5Event Name: WindowsUpdateFailure3Response: Not availableCab Id: 0 Problem signature:P1: 10.0.10586.162P2: 800706d9P3: C3EDFD8F-C0AC-4496-9BEF-D7DE6E59AA45P4: DownloadP5: 200P6: 0P7: 0P8: UpdateOrchestratorP9: {7971F918-A847-4430-9279-4A52D1EFE18D}P10: 0 Attached files: These files may be available here:C:\ProgramData\Microsoft\Windows\WER\ReportArchive\NonCritical_10.0.10586.162_b13b8739944280c95dcac07e2ceede31d957cb2e_00000000_1a207812 Analysis symbol: Rechecking for solution: 0Report Id: 2f2a4057-ff53-11e5-8d94-c0cb38f42041Report Status: 0Hashed bucket: 5060ca99256631c7ea14375704e2d961 Windows Update reports Error 0x800706d9 for some of the updates installation failure   […]

Read more

Configuring On-Premise Linux Postfix SMTP Relay Server to Communicate with Office 365 SMTP Relay for email delivery

Scenario:   You have various automation and reporting solutions setup that use an On-Premise Linux Postfix SMTP Servers and relays all the automated email through your On-Premise Exchange server.  You are migrating your Microsoft Exchange from On-Premise Exchange server to Office 365.  You may even be considering acquiring MS Office 365 Monitoring software as well. But before that you are required to configure all your On-Premise Linux Postfix SMTP Servers to communicate with Office 365 Exchange online for email delivery.   Solution:   To simplify your implementation of migration to Office 365, the most elegant method to support your On-Premise […]

Read more