PowerShell: Successful MFA logins with Log Analytics

Despite of the intent, nowadays I don’t get enough time to get back to blogging. It’s not the case that content is not there but in a way, so many things happening that its hard to decide if anything that important to write about.

Came across a typical issue of getting O365 login reports using PowerShell than usual GUI way, which is not only painfully slow but doesn’t has option to filter out basis user names or target specific list of applications. To solve the issue, have created a small script which may help you on the particular issue if you have OMS subscription for log analytics

Continue reading “PowerShell: Successful MFA logins with Log Analytics”

Applying passport in India – Still a stupid affair in name of police verification

Not to say things don’t change in India as there been some rapid changes in last decade. We have moved past of LPG lines, we have moved past of accepting daily power cuts as fate in a developing nation, we have moved past of considering trains as only way of transport due to higher prices of planes and bad roads… but as much things change, some still remain the same. Indian red tape and police system can be considered something like that.

Its been almost 3.5 yrs since I wrote about my last experience with applying passport in india and proudly bragged that situation seem to have improved much better than the past, but only to find from recent experience that the systematic nonsense continues to harass citizens same way since always.

In my last attempt for passport, I noticed only one stupidity that PSK refused to take AADHAAR photocopy on counter while this is just a number, which can be verified by the fingerprint scan or other means anyway installed inside PSK and this time it came about police verification.

Continue reading “Applying passport in India – Still a stupid affair in name of police verification”

Powershell: Servers inventory

Quite many months since when I might have written a blog post. Life been quite busy at workplace and home end both. Thought to share yet another PowerShell script, which might be quite useful for System Admins.

This covers CPU, Memory, Network cards, Disks etc and other parameters can be added accordingly.

You might run into issues with some servers if WMI related ports not open on them. Below CMD should help on that

Continue reading “Powershell: Servers inventory”

PowerShell: File Share inventory for all DFS shares – Permissions and Size

Managing file servers in a large environment where there are more than one administrators might be a tough job if you do not have audit tool keeping track of changes in File Shares. Similar problematic part is migrating stuff from one server to another. DFS helps, but how to document everything??

Continue reading “PowerShell: File Share inventory for all DFS shares – Permissions and Size”

PowerShell: Quickly finding source of Brute Force attack on O365 Tenant

A small PowerShell Script to quickly find out source IPs in case of a brute force attack on O365 Infra. This can save manual efforts and can improve turnaround time to mitigate the issue in Infrastructures which still not using MFA or ExtraNetLockOut. This is just a basic code. One can set email alerts basis the thresholds or even can write a custom event on any of the server to be picked by SCOM or OMS.

Continue reading “PowerShell: Quickly finding source of Brute Force attack on O365 Tenant”

PowerShell: DNS Inventory – All records

Here goes the PowerShell script for DNS Inventory for AD Integrated DNS zones. This script needs to be altered to set variable for DC Name and once ran, it would fetch details from each zone and would save it in separate files.

Updated the code to provide option to dynamic selection of DNS Server. Thanks for input from @singhalyogi22

Note: Skipping SOA records etc to avoid complexity

Continue reading “PowerShell: DNS Inventory – All records”

PowerShell: DHCP settings, leases and reservations inventory

Another day, another PowerShell script.. this time to get DHCP settings, leases and reservations from all DHCP Servers in current domain. Pre-requisite is all DHCP Servers should be Windows 2012 based and WinRM should be enabled on all of them.

Continue reading “PowerShell: DHCP settings, leases and reservations inventory”