%3CLINGO-SUB%20id%3D%22lingo-sub-1399297%22%20slang%3D%22en-US%22%3ETracking%20the%20Source%20of%20ADFS%20Account%20Lockouts%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1399297%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1350626066%22%20id%3D%22toc-hId--1350623431%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc40451445%22%3E%3C%2FA%3EIntroduction%3C%2FH2%3E%0A%3CP%3EI%20am%20Eunice%20Chinchilla%2C%20and%20I%20am%20a%20Premier%20Field%20Engineer%20at%20Microsoft%20focusing%20in%20the%20Identity%20space.%20In%20this%20guide%20you%20will%20find%20a%20description%20of%20the%20task%20at%20hand%20and%20the%20journey%20I%20went%20on%20to%20deliver%20a%20solution%20for%20my%20customer.%20Each%20section%20includes%20a%20high-level%20summary%20of%20what%20will%20be%20discussed%20and%20any%20pre-requisites%20to%20be%20able%20to%20try%20these%20in%20your%20own%20test%20environment.%20Once%20you%20are%20ready%20to%20start%20testing%20there%20are%20steps%20accompanied%20by%20descriptions%20and%20screenshots%20to%20walk%20you%20through%20the%20whole%20process%20I%20went%20through%2C%20including%20any%20hiccups%20I%20ran%20into.%20Please%20read%20the%20Problem%20Statement%2FCustomer%20Story%20up%20next%20to%20provide%20you%20with%20background%20information%20and%20help%20you%20get%20started.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1136886767%22%20id%3D%22toc-hId-1136889402%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc40451446%22%3E%3C%2FA%3EProblem%20Statement%2FCustomer%20Story%3C%2FH2%3E%0A%3CP%3EI%20was%20working%20with%20a%20customer%20and%20they%20needed%20to%20identify%20why%20user%20lockouts%20were%20occurring.%20They%20had%20a%20hybrid%20environment%20with%20ADFS%20in%20place%20meaning%20the%20domains%20are%20federated.%20In%20this%20scenario%2C%20it%20is%20necessary%20to%20know%20if%20the%20lockout%20happened%20on-prem%20or%20on%20a%20O365%20application.%20The%20plan%20of%20action%20was%20to%20look%20at%20the%20logs%20in%20both%20the%20Domain%20Controller%20and%20the%20ADFS%20server%20and%20compare%20them%20to%20the%20logs%20in%20Azure%20to%20see%20what%20we%20could%20find.%20Unfortunately%2C%20we%20were%20limited%20to%20only%20the%20ADFS%20server%20logs%20because%20there%20was%20no%20access%20to%20the%20Domain%20controller%20due%20to%20permissions.%20All%20the%20investigation%20was%20done%20solely%20on%20the%20ADFS%20server%20and%20Azure%20logs.%20The%20following%20solutions%20are%20a%20summary%20of%20the%20journey%20I%20went%20on%20with%20the%20purpose%20to%20find%20the%20most%20information%20possible%20related%20to%20the%20lockouts.%20I%20spent%20time%20testing%20in%20my%20own%20environment%20which%20is%20set%20up%20like%20theirs.%20In%20the%20end%2C%20it%20was%20narrowed%20down%20to%20the%20application%20used%20when%20the%20lockout%20occurred.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1827448241%22%20id%3D%22toc-hId-1827450876%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc40451447%22%3E%3C%2FA%3EApproaches%3C%2FH3%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-19993778%22%20id%3D%22toc-hId-19996413%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc40451448%22%3E%3C%2FA%3EFirst%20Approach%3C%2FH3%3E%0A%3CP%3EThe%20first%20attempt%20in%20searching%20for%20the%20information%20needed%20was%20to%20look%20through%20the%20security%20logs%20and%20see%20what%20we%20could%20find.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1787460685%22%20id%3D%22toc-hId--1787458050%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc40451449%22%3E%3C%2FA%3ESecond%20Approach%3C%2FH3%3E%0A%3CP%3ESince%20looking%20through%20the%20logs%20resulted%20in%20very%20little%20information%20that%20was%20not%20enough%20for%20the%20customer%20to%20figure%20out%20where%20the%20lockouts%20where%20coming%20from%2C%20we%20resorted%20to%20Log%20Analytics%20and%20Azure%20Security%20Center%20to%20help%20find%20more%20specific%20and%20detailed%20information.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-700052148%22%20id%3D%22toc-hId-700054783%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc40451450%22%3E%3C%2FA%3EThird%20Approach%3C%2FH3%3E%0A%3CP%3EThe%20customer%20did%20not%20have%20access%20to%20Azure%20Log%20Analytics%20and%20Azure%20Security%20Center%20which%20left%20us%20to%20explore%20the%20Azure%20Sign%20in%20Logs.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-689549044%22%20id%3D%22toc-hId-689551679%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc40451451%22%3E%3C%2FA%3EFirst%20Approach%20%E2%80%93%20PowerShell%20Script%20run%20on%20ADFS%20Server%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1380110518%22%20id%3D%22toc-hId-1380113153%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc40451452%22%3E%3C%2FA%3ESummary%3C%2FH3%3E%0A%3CP%3EInitially%2C%20I%20looked%20at%20the%20event%20logs%20in%20the%20ADFS%20server%20in%20my%20test%20environment.%20There%20were%20a%20few%20things%20I%20did%20before%20which%20are%20listed%20below%20in%20a%20checklist.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%E2%98%90%20Enable%20the%20appropriate%20logs%3A%20%E2%80%98Source%20AD%20FS%20Auditing%20Logs%E2%80%99%3C%2FP%3E%0A%3CP%3E%E2%98%90%20Create%20test%20lockout%20events%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CEM%3ENote%3A%3C%2FEM%3E%20You%20can%20create%20these%20for%20testing%20purposes%20or%20just%20use%20the%20lockouts%20that%20already%20exist%20in%20your%20environment.%3C%2FP%3E%0A%3CP%3E%E2%98%90%20Make%20sure%20you%20have%20PowerShell%20installed%20in%20your%20ADFS%20Server%3C%2FP%3E%0A%3CP%3E%E2%98%90%20If%20you%20have%20multiple%20servers%2C%20make%20sure%20to%20enable%20remote%20access%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--427343945%22%20id%3D%22toc-hId--427341310%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc40451453%22%3E%3C%2FA%3ESteps%3C%2FH3%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E1.%26nbsp%3BFirst%2C%20make%20sure%20the%20%E2%80%98Source%20AD%20FS%20Auditing%20Logs%E2%80%99%20are%20enabled%20in%20the%20ADFS%20server.%20This%20allows%20you%20to%20see%20the%20events%20with%20ID%20411.%20Event%20411%20occurs%20when%20there%20is%20a%20failed%20token%20validation%20attempt%20(authentication%20attempts).%20In%20the%20event%20viewer%2C%20the%20IP%20address%20of%20the%20device%20used%20is%20provided.%20This%20can%20be%20useful%20for%20tracking%20the%20lockout.%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSTRONG%3EEnabling%20the%20Source%20AD%20FS%20Auditing%20Logs%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EOpen%20the%20%3CEM%3ELocal%20Security%20Policy%20%3C%2FEM%3Ewindow%20from%20the%20Start%20menu%20on%20your%20server.%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_38-1589809614343.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192632iAFEED5CE2CB86CD3%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22BrandonWilson_38-1589809614343.png%22%20alt%3D%22BrandonWilson_38-1589809614343.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EOnce%20opened%2C%20you%20should%20see%20a%20view%20like%20the%20window%20below.%20Click%20on%20%E2%80%98Advanced%20Audit%20Policy%20Configuration.%E2%80%99%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EClick%20on%20%E2%80%98System%20Audit%20Policies%20%E2%80%93%20Local%20Group%20Policy%20Object.%E2%80%99%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3ENavigate%20to%20the%20%E2%80%98Logon%2FLogoff%E2%80%99%20category.%20You%20should%20now%20see%20all%20the%20subcategories%20available.%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3ESelect%20the%20%E2%80%98Audit%20Account%20Lockout%E2%80%99%20subcategory.%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_39-1589809614349.png%22%20style%3D%22width%3A%20700px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192634i971918D579E1B752%2Fimage-dimensions%2F700x454%3Fv%3D1.0%22%20width%3D%22700%22%20height%3D%22454%22%20title%3D%22BrandonWilson_39-1589809614349.png%22%20alt%3D%22BrandonWilson_39-1589809614349.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EA%20separate%20window%20will%20appear%2C%20and%20you%20can%20check%20the%20boxes%20for%20Success%20and%20Failure%20audit%20events.%20After%20having%20done%20this%2C%20the%20%E2%80%98Source%20AD%20FS%20Auditing%20Logs%E2%80%99%20have%20successfully%20been%20enabled.%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_40-1589809614351.png%22%20style%3D%22width%3A%20444px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192633iF5BA76290DB97DBA%2Fimage-dimensions%2F444x546%3Fv%3D1.0%22%20width%3D%22444%22%20height%3D%22546%22%20title%3D%22BrandonWilson_40-1589809614351.png%22%20alt%3D%22BrandonWilson_40-1589809614351.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EUnder%20the%20%E2%80%98Explain%E2%80%99%20tab%20you%20can%20find%20a%20detailed%20explanation%20of%20what%20happens%20when%20you%20enable%20these%20audit%20logs.%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_41-1589809614353.png%22%20style%3D%22width%3A%20456px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192635iF4B92BE28AA23CB6%2Fimage-dimensions%2F456x561%3Fv%3D1.0%22%20width%3D%22456%22%20height%3D%22561%22%20title%3D%22BrandonWilson_41-1589809614353.png%22%20alt%3D%22BrandonWilson_41-1589809614353.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E2.%20Skip%20this%20step%20if%20you%20already%20have%20lockouts%20in%20your%20environment.%20If%20not%2C%20you%20can%20create%20some%20account%20lockouts%2C%20as%20I%20did%20in%20my%20test%20environment.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSTRONG%3ECreate%20test%20account%20lockout%20events%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EOpen%20the%20%E2%80%98Local%20Security%20Policy%E2%80%99%20window%20and%20click%20on%20%E2%80%98Account%20Policies.%E2%80%99%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EClick%20on%20%E2%80%98Account%20Lockout%20Policy.%E2%80%99%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EOn%20the%20right-hand%20side%20are%20the%20security%20settings%20you%20can%20customize%20for%20the%20account%20lockouts.%20I%20set%20lower%20amounts%20of%20time%20so%20I%20could%20create%20multiple%20account%20lockout%20in%20shorter%20amounts%20of%20time.%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_42-1589809614357.png%22%20style%3D%22width%3A%20695px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192636iADD9C57C452A629E%2Fimage-dimensions%2F695x498%3Fv%3D1.0%22%20width%3D%22695%22%20height%3D%22498%22%20title%3D%22BrandonWilson_42-1589809614357.png%22%20alt%3D%22BrandonWilson_42-1589809614357.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CEM%3ENote%3A%20%3C%2FEM%3EIt%20is%20necessary%20to%20set%20the%20account%20lockout%20policy%20in%20the%20Domain%20Controller%20as%20well.%20Make%20sure%20the%20account%20lockout%20policy%20in%20the%20ADFS%20Server%20%3CSTRONG%3Edoes%20not%3C%2FSTRONG%3E%20surpass%20the%20Domain%20Controller%20account%20lockout%20policy%20amounts%20of%20time%20and%20attempts.%20This%20will%20cause%20an%20error.%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EAfter%20setting%20the%20lockout%20policy%20on%20the%20appropriate%20server%2C%20start%20one%20of%20your%20Windows%2010%20joined%20Virtual%20Machines.%20From%20this%20VM%2C%20on%20any%20browser%2C%20you%20will%20attempt%20to%20log%20on%20to%20your%20account%20using%20any%20of%20your%20test%20user%20accounts.%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_43-1589809614660.png%22%20style%3D%22width%3A%20697px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192637i8D447AA96C15F966%2Fimage-dimensions%2F697x448%3Fv%3D1.0%22%20width%3D%22697%22%20height%3D%22448%22%20title%3D%22BrandonWilson_43-1589809614660.png%22%20alt%3D%22BrandonWilson_43-1589809614660.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EEnter%20the%20wrong%20password%20on%20purpose%20as%20a%20simulation%20of%20an%20account%20lockout.%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_44-1589809614690.png%22%20style%3D%22width%3A%20688px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192640i145ADB14751D491F%2Fimage-dimensions%2F688x442%3Fv%3D1.0%22%20width%3D%22688%22%20height%3D%22442%22%20title%3D%22BrandonWilson_44-1589809614690.png%22%20alt%3D%22BrandonWilson_44-1589809614690.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EThe%20ADFS%20splash%20page%20will%20not%20notify%20you%20when%20you%E2%80%99ve%20been%20locked%20out%20and%20will%20continue%20to%20display%20the%20view%20below.%20If%20your%20%E2%80%9Cinvalid%20attempt%20logon%E2%80%9D%20number%20was%202%2C%20repeat%20this%20process%203%20times%20to%20ensure%20the%20lockout%20of%20the%20account%20occurred.%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_45-1589809614694.png%22%20style%3D%22width%3A%20296px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192639iCB2708D1739D69CF%2Fimage-dimensions%2F296x366%3Fv%3D1.0%22%20width%3D%22296%22%20height%3D%22366%22%20title%3D%22BrandonWilson_45-1589809614694.png%22%20alt%3D%22BrandonWilson_45-1589809614694.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSTRONG%3EView%20the%20lockout%20event(s)%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3ETo%20verify%20the%20lockout%20happened%20open%20the%20Event%20Viewer.%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_46-1589809614695.png%22%20style%3D%22width%3A%20357px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192638i63BBD3A7DFCDF419%2Fimage-dimensions%2F357x266%3Fv%3D1.0%22%20width%3D%22357%22%20height%3D%22266%22%20title%3D%22BrandonWilson_46-1589809614695.png%22%20alt%3D%22BrandonWilson_46-1589809614695.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3ENavigate%20to%20the%20%E2%80%98Security%20Logs%E2%80%99%20under%20%E2%80%98Windows%20Logs.%E2%80%99%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_47-1589809614698.png%22%20style%3D%22width%3A%20334px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192641i4359AE02F4E1825B%2Fimage-dimensions%2F334x486%3Fv%3D1.0%22%20width%3D%22334%22%20height%3D%22486%22%20title%3D%22BrandonWilson_47-1589809614698.png%22%20alt%3D%22BrandonWilson_47-1589809614698.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EHere%20you%20can%20view%20the%20event(s)%20generated%20when%20the%20lockout(s)%20occurred.%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_48-1589809614703.png%22%20style%3D%22width%3A%20701px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192643i096EB03580D31DBA%2Fimage-dimensions%2F701x520%3Fv%3D1.0%22%20width%3D%22701%22%20height%3D%22520%22%20title%3D%22BrandonWilson_48-1589809614703.png%22%20alt%3D%22BrandonWilson_48-1589809614703.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EYou%20can%20also%20filter%20by%20error%20code%20(once%20you%20know%20which%20error%20code%20to%20look%20for).%20In%20this%20case%2C%20we%20can%20filter%20by%20error%20code%204625.%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EOn%20the%20right-hand%20side%2C%20in%20the%20%E2%80%98Security%E2%80%99%20window%20under%20%E2%80%98Actions%E2%80%99%20select%20the%20%E2%80%98Filter%20Current%20Log%E2%80%A6%E2%80%99%20option.%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_49-1589809614706.png%22%20style%3D%22width%3A%20346px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192642i91B604B7494DD06F%2Fimage-dimensions%2F346x383%3Fv%3D1.0%22%20width%3D%22346%22%20height%3D%22383%22%20title%3D%22BrandonWilson_49-1589809614706.png%22%20alt%3D%22BrandonWilson_49-1589809614706.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3ECheck%20every%20box%20for%20the%20%E2%80%98Event%20Level%E2%80%99%20and%20enter%20the%20event%20ID.%20Click%20%E2%80%98Ok.%E2%80%99%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_50-1589809614708.png%22%20style%3D%22width%3A%20510px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192645i088FFE05837C3D44%2Fimage-dimensions%2F510x514%3Fv%3D1.0%22%20width%3D%22510%22%20height%3D%22514%22%20title%3D%22BrandonWilson_50-1589809614708.png%22%20alt%3D%22BrandonWilson_50-1589809614708.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EBelow%20are%20the%20results%20of%20the%20filtered%20events.%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_51-1589809614719.png%22%20style%3D%22width%3A%20704px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192647i544E5E8F92222184%2Fimage-dimensions%2F704x287%3Fv%3D1.0%22%20width%3D%22704%22%20height%3D%22287%22%20title%3D%22BrandonWilson_51-1589809614719.png%22%20alt%3D%22BrandonWilson_51-1589809614719.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E3.%20In%20your%20ADFS%20Server%2C%20open%20PowerShell%20ISE%20to%20run%20script%20that%20will%20be%20pulling%20the%20events%20related%20the%20lockout%20events.%20In%20this%20script%20we%20are%20querying%20for%20all%20the%20411%20events%20from%20the%20Source%20AD%20FS%20Auditing%20logs.%20The%20reason%20you%20want%20to%20filter%20for%20Event%20ID%20411%20is%20because%20this%20event%20gets%20created%20when%20there%20is%20a%20failed%20authentication%20attempt.%20The%20expected%20output%20is%20the%20Username%2C%20Activity%20ID%2C%20IP%20address%2C%20Date%20Created.%3C%2FP%3E%0A%3CP%3EIf%20you%20don%E2%80%99t%20have%20PowerShell%20ISE%20installed%20visit%20this%20site%20and%20resume%20at%20this%20step%20after%20installing%20successfully.%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fscripting%2Finstall%2Finstalling-windows-powershell%3Fview%3Dpowershell-7%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fscripting%2Finstall%2Finstalling-windows-powershell%3Fview%3Dpowershell-7%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSTRONG%3ERunning%20the%20Script%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EIn%20your%20ADFS%20Server%2C%20Open%20PowerShell%20ISE%20and%20%E2%80%98Run%20as%20an%20Administrator.%E2%80%99%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_52-1589809614721.png%22%20style%3D%22width%3A%20329px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192646i5D4E2F368E2863DA%2Fimage-dimensions%2F329x265%3Fv%3D1.0%22%20width%3D%22329%22%20height%3D%22265%22%20title%3D%22BrandonWilson_52-1589809614721.png%22%20alt%3D%22BrandonWilson_52-1589809614721.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3ECopy%20the%20script%20below%20(Ctrl%20%2B%20C).%20It%20will%20be%20pasted%20onto%20the%20PowerShell%20ISE%20Script%20Window%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%23Get%20all%20the%20events%20with%20Event%20ID%20411%0A%24eventLogs%20%3D%20Get-EventLog%20-LogName%20Security%20-Source%20%22AD%20FS%20Auditing%22%20%7C%20Where-Object%20%7B%24_.EventID%20-eq%20411%7D%0A%24eventList%20%3D%20%40()%20%23list%20that%20holds%20event%20objects%0A%0Aforeach%20(%24event%20in%20%24eventLogs)%0A%7B%0A%20%20%20%20%24message%20%3D%20%24event.Message%0A%20%20%20%20%24emailRegEx%20%3D%20%22%5Cb%5BA-Z0-9._%25%2B-%5D%2B%40%5BA-Z0-9.-%5D%2B%5C.%5BA-Z%5D%7B2%2C4%7D%5Cb%22%0A%20%20%20%20%24message%20-match%20%24emailRegEx%20%7C%20Out-Null%0A%0A%20%20%20%20%24eventObject%20%3D%20New-Object%20-TypeName%20psobject%20%23start%20off%20with%20an%20new%20object%0A%0A%20%20%20%20%23add%20the%20User%20Name%0A%20%20%20%20%24eventObject%20%7C%20Add-Member%20-MemberType%20NoteProperty%20-Name%20Username%20-Value%20%24Matches.Values%0A%0A%20%20%20%20%24activityIDRegEx%20%3D%20%22%5BA-Za-z0-9%5D%2B-%5BA-Za-z0-9%5D%2B-%5BA-Za-z0-9%5D%2B-%5BA-Za-z0-9%5D%2B-%5BA-Za-z0-9%5D*%22%0A%20%20%20%20%24message%20-match%20%24activityIDRegEx%20%7C%20Out-Null%0A%0A%20%20%20%20%23add%20the%20activity%20ID%0A%20%20%20%20%24eventObject%20%7C%20Add-Member%20-MemberType%20NoteProperty%20-Name%20%22Activity%20ID%22%20-Value%20%24Matches.Values%0A%20%20%20%20%20%20%0A%20%20%20%20%24IPAddressRegEx%20%3D%20%22%5B0-9%5D%2B%5C.%5B0-9%5D%2B%5C.%5B0-9%5D%2B%5C.%5B0-9%5D*%22%0A%20%20%20%20%24message%20-match%20%24IPAddressRegEx%20%7C%20Out-Null%0A%0A%20%20%20%20%23add%20the%20IP%20address%0A%20%20%20%20%24eventObject%20%7C%20Add-Member%20-MemberType%20NoteProperty%20-Name%20%22IP%20Address%22%20-Value%20%24Matches.Values%0A%0A%20%20%20%20%23add%20the%20date%20the%20event%20happened%0A%20%20%20%20%24eventObject%20%7C%20Add-Member%20-MemberType%20NoteProperty%20-Name%20%22Date%20Created%22%20-Value%20%24event.TimeGenerated%0A%0A%20%20%20%20%24eventList%20%2B%3D%20%24eventObject%20%23add%20each%20event%20object%20to%20a%20list%0A%0A%20%20%20%20%23Now%2C%20there%20is%20an%20event%20object%20that%20contains%20all%20the%20relevant%20information%20about%20the%20event.%20%0A%20%20%20%0A%0A%7D%0A%0A%23Group%20by%20user%20name%20and%20send%20the%20list%20of%20account%20info%20to%20a%20CSV%20file%0A%24eventList%20%7C%20Sort-Object%20-Property%20%22Username%22%20%7C%20Out-File%20-FilePath%20%22C%3AEnter%20your%20path%20here%5Clockouts.csv%22%20-Encoding%20utf8%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EPaste%20the%20code%20into%20the%20Script%20window%20(Ctrl%20%2B%20V).%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_53-1589809614742.png%22%20style%3D%22width%3A%20722px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192650i4F9E0D812719E721%2Fimage-dimensions%2F722x460%3Fv%3D1.0%22%20width%3D%22722%22%20height%3D%22460%22%20title%3D%22BrandonWilson_53-1589809614742.png%22%20alt%3D%22BrandonWilson_53-1589809614742.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CEM%3ENote%3A%3C%2FEM%3E%20If%20you%20have%20multiple%20ADFS%20Servers%20you%20can%20either%20run%20the%20script%20above%20on%20each%20server%20individually%20and%20have%20multiple%20csv%20output%20files%20or%20run%20the%20code%20below%20in%20PowerShell%20ISE%20from%20any%20ADFS%20server%2C%20but%20you%20must%20first%20enable%20remote%20access%20to%20the%20other%20ADFS%20servers.%20See%20link%20below%20on%20how%20to%20enable%20remote%20access%20to%20your%20other%20machines.%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows-server%2Fremote%2Fremote-desktop-services%2Fclients%2Fremote-desktop-allow-access%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows-server%2Fremote%2Fremote-desktop-services%2Fclients%2Fremote-desktop-allow-access%3C%2FA%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSTRONG%3EMultiple%20Server%20Script%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3Eforeach(%24s%20in%20%24adfsServers)%7B%0A%0A%20%20%20%20%23Get%20all%20the%20events%20with%20Event%20ID%20411%0A%20%20%20%20%20%20%20%0A%20%20%20%20%24_xmlLockoutAdfs%20%3D%20%22*%5BSystem%5BEventID%3D411%5D%5D%22%0A%20%20%20%20%24eventLogs%20%3D%20%20Get-WinEvent%20-ComputerName%20%24s%20-LogName%20Security%20-FilterXPath%20%20%20%20%20%20%20%24_xmlLockoutAdfs%0A%20%20%20%20%0A%20%20%20%20%24eventList%20%3D%20%40()%20%23list%20that%20holds%20event%20objects%0A%0A%20%20%20%20foreach%20(%24event%20in%20%24eventLogs)%0A%20%20%20%20%7B%0A%0A%20%20%20%20%20%20%20%20%24eventObject%20%3D%20New-Object%20-TypeName%20psobject%20%23start%20off%20empty%20object%0A%0A%20%20%20%20%20%20%20%20%24message%20%3D%20%24event.Message%0A%20%20%20%20%20%20%20%20%24emailRegEx%20%3D%20%22%5Cb%5BA-Z0-9._%25%2B-%5D%2B%40%5BA-Z0-9.-%5D%2B%5C.%5BA-Z%5D%7B2%2C4%7D%5Cb%22%0A%20%20%20%20%20%20%20%20%24message%20-match%20%24emailRegEx%20%7C%20Out-Null%0A%0A%20%20%20%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%23add%20the%20User%20Name%0A%20%20%20%20%20%20%20%20%24eventObject%20%7C%20Add-Member%20-MemberType%20NoteProperty%20-Name%20Username%20-Value%20%24Matches.Values%0A%0A%20%20%20%20%20%20%20%20%24activityIDRegEx%20%3D%20%22%5BA-Za-z0-9%5D%2B-%5BA-Za-z0-9%5D%2B-%5BA-Za-z0-9%5D%2B-%5BA-Za-z0-9%5D%2B-%5BA-Za-z0-9%5D*%22%0A%20%20%20%20%20%20%20%20%24message%20-match%20%24activityIDRegEx%20%7C%20Out-Null%0A%0A%20%20%20%20%20%20%20%20%23add%20the%20activity%20ID%0A%20%20%20%20%20%20%20%20%24eventObject%20%7C%20Add-Member%20-MemberType%20NoteProperty%20-Name%20%22Activity%20ID%22%20-Value%20%24Matches.Values%0A%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%24IPAddressRegEx%20%3D%20%22%5B0-9%5D%2B%5C.%5B0-9%5D%2B%5C.%5B0-9%5D%2B%5C.%5B0-9%5D*%22%0A%20%20%20%20%20%20%20%20%24message%20-match%20%24IPAddressRegEx%20%7C%20Out-Null%0A%0A%20%20%20%20%20%20%20%20%23add%20the%20IP%20address%0A%20%20%20%20%20%20%20%20%24eventObject%20%7C%20Add-Member%20-MemberType%20NoteProperty%20-Name%20%22IP%20Address%22%20-Value%20%24Matches.Values%0A%0A%20%20%20%20%20%20%20%20%23add%20the%20date%20the%20event%20happened%0A%20%20%20%20%20%20%20%20%24eventObject%20%7C%20Add-Member%20-MemberType%20NoteProperty%20-Name%20%22Date%20Created%22%20-Value%20%24event.TimeCreated%0A%0A%20%20%20%20%20%0A%0A%20%20%20%20%20%20%20%20%24eventList%20%2B%3D%20%24eventObject%20%23add%20each%20event%20object%20to%20a%20list%0A%0A%20%20%20%20%20%20%20%20%23Now%2C%20there%20is%20an%20event%20object%20that%20contains%20all%20the%20relevant%20information%20about%20the%20event.%20%0A%20%20%20%0A%0A%20%20%20%20%7D%0A%0A%20%20%20%20%24eventList%20%7C%20Sort-Object%20-Property%20%22Username%22%20%7C%20Out-File%20-FilePath%20%22C%3AEnter%20your%20path%20here%5Clockouts.csv%22%20-Encoding%20utf8%20%0A%0A%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E4.%20Open%20the%20Event%20Viewer%20and%20filter%20for%20Events%20411.%20This%20is%20useful%20to%20confirm%20the%20results%20from%20the%20script.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_54-1589809614752.png%22%20style%3D%22width%3A%20274px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192649iC913800811DBE51E%2Fimage-dimensions%2F274x395%3Fv%3D1.0%22%20width%3D%22274%22%20height%3D%22395%22%20title%3D%22BrandonWilson_54-1589809614752.png%22%20alt%3D%22Open%20the%20security%20log%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EOpen%20the%20security%20log%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_55-1589809614758.png%22%20style%3D%22width%3A%20282px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192648i7DB70743CEA3362E%2Fimage-dimensions%2F282x362%3Fv%3D1.0%22%20width%3D%22282%22%20height%3D%22362%22%20title%3D%22BrandonWilson_55-1589809614758.png%22%20alt%3D%22Select%20filter%20current%20log%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESelect%20filter%20current%20log%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_56-1589809614771.png%22%20style%3D%22width%3A%20591px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192652i1901F1140726E04E%2Fimage-dimensions%2F591x597%3Fv%3D1.0%22%20width%3D%22591%22%20height%3D%22597%22%20title%3D%22BrandonWilson_56-1589809614771.png%22%20alt%3D%22Filter%20on%20411%20events%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFilter%20on%20411%20events%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_57-1589809614810.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192653i08A58C707A0F59CE%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22BrandonWilson_57-1589809614810.png%22%20alt%3D%22411%20event%20example%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3E411%20event%20example%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-1359104310%22%20id%3D%22toc-hId-1359106945%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc40451454%22%3E%3C%2FA%3E%3CSPAN%3ESecond%20Approach%20%E2%80%93%20Log%20Analytics%20and%20Kusto%20Query%20Language%20on%20ADFS%20%3C%2FSPAN%3EServer%3C%2FH1%3E%0A%3CH3%20id%3D%22toc-hId--442449054%22%20id%3D%22toc-hId--442446419%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId-2045063779%22%20id%3D%22toc-hId-2045066414%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc40451455%22%3E%3C%2FA%3ESummary%3C%2FH3%3E%0A%3CP%3EGiven%20the%20limited%20results%20of%20the%20event%20logs%20we%20decided%20to%20take%20another%20approach%20in%20the%20search%20of%20more%20detailed%20information.%20The%20event%20logs%20provided%20the%20Username%2C%20Activity%20ID%2C%20IP%20address%2C%20Date%20Created%20which%20was%20not%20enough%20information%20to%20conclude%20where%20exactly%20the%20lockouts%20where%20occurring.%20In%20hopes%20of%20finding%20more%20specific%20information%20we%20resorted%20to%20Azure%20Log%20Analytics.%20Through%20Log%20Analytics%20we%20were%20able%20to%20successfully%20collect%20the%20information%20needed%20such%20as%20the%20application%20being%20used%20when%20the%20lockout%20occurred.%20Below%20is%20a%20list%20of%20requirements%20to%20attempt%20this%20approach.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%E2%98%90%20Log%20Analytics%20must%20be%20set%20up%20with%20current%20environment%20and%20connected%20to%20the%20correct%20Virtual%20Machines.%3C%2FP%3E%0A%3CP%3E%E2%98%90%20Have%20Azure%20Security%20Center%20set%20up%20in%20order%20to%20retrieve%20security%20events%20from%20the%20ADFS%20Server.%3C%2FP%3E%0A%3CP%3E%E2%98%90%20Admin%20Credentials%20to%20Azure%20Active%20Directory%20to%20be%20able%20to%20access%20the%20logs%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-237609316%22%20id%3D%22toc-hId-237611951%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc40451456%22%3E%3C%2FA%3ESteps%3C%2FH3%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EIf%20you%20don%E2%80%99t%20have%20Log%20Analytics%2C%20below%20are%20some%20helpful%20links%20to%20get%20all%20set%20up.%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEM%3ECreating%20a%20workspace%3A%20%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Flearn%2Fquick-create-workspace%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Flearn%2Fquick-create-workspace%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEM%3ECollecting%20data%20from%20Azure%20Virtual%20Machines%3A%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Flearn%2Fquick-collect-azurevm%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Flearn%2Fquick-collect-azurevm%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EIf%20you%20do%20not%20have%20Azure%20Security%20Center%20set%20up%2C%20below%20are%20some%20helpful%20links%20to%20get%20all%20set%20up.%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnboard%20Windows%20computers%20to%20Azure%20Security%20Center%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsecurity-center%2Fquick-onboard-windows-computer%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsecurity-center%2Fquick-onboard-windows-computer%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E1.%20Navigate%20to%20your%20Log%20Analytics%20workspace%20-%26gt%3B%20Logs%20where%20you%20will%20be%20querying%20the%20security%20logs.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_58-1589809614813.png%22%20style%3D%22width%3A%20294px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192651iAA9EBC8BDA3826B5%2Fimage-dimensions%2F294x469%3Fv%3D1.0%22%20width%3D%22294%22%20height%3D%22469%22%20title%3D%22BrandonWilson_58-1589809614813.png%22%20alt%3D%22BrandonWilson_58-1589809614813.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E2.%20Copy%20(Ctrl%20%2B%20C)%20and%20Paste%20(Ctrl%20%2B%20V)%20the%20Kusto%20Query%20shown%20below%20and%20then%20run%20it%20by%20clicking%20on%20the%20%E2%80%98Run%E2%80%99%20button.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3ESecurityEvent%0A%7C%20where%20EventID%20%3D%3D%20411%0A%7C%20project%20EventData%2C%20Computer%2C%20TimeGenerated%2C%20EventSourceName%20%0A%7C%20extend%20p%20%3D%20parse_xml(EventData)%0A%7C%20extend%20CorrelationId%20%3D%20tostring(parse_json(tostring(parse_json(tostring(p.EventData)).Data))%5B0%5D)%0A%20%20%20%20%7C%20join%20(SigninLogs%0A%20%20%20%20%20%20%20%20%7C%20where%20Status.errorCode%20%3D%3D%20%2250140%22%20%0A%20%20%20%20%20%20%20%20%7C%20project%20Status%2C%20UserDisplayName%2C%20UserPrincipalName%2C%20UserId%2C%20AppDisplayName%2C%20ClientAppUsed%2C%20AppId%2C%20IPAddress%2C%20CorrelationId%20%0A%20%20%20%20)%20on%20CorrelationId%20%0A%20%20%20%20%7C%20project%20EventSourceName%2C%20Status%2C%20UserDisplayName%2C%20UserPrincipalName%2C%20UserId%2C%20AppDisplayName%2C%20ClientAppUsed%2C%20AppId%2C%20IPAddress%2C%20TimeGenerated%2C%20CorrelationId%20%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E3.%20Once%20you%20see%20the%20results%20in%20the%20result%20window%20you%20can%20export%20the%20result%20to%20a%20CSV%20file%20where%20it%20will%20display%20the%20columns%20specified%20in%20the%20query.%20You%20can%20find%20the%20button%20in%20the%20top%20right-hand%20corner%20of%20the%20window.%20Make%20sure%20you%20set%20the%20time%20range%20to%20your%20desired%20time%20range%20before%20running%20the%20query.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_59-1589809614822.png%22%20style%3D%22width%3A%20644px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192655i13C56457071EE60D%2Fimage-dimensions%2F644x174%3Fv%3D1.0%22%20width%3D%22644%22%20height%3D%22174%22%20title%3D%22BrandonWilson_59-1589809614822.png%22%20alt%3D%22BrandonWilson_59-1589809614822.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1698927866%22%20id%3D%22toc-hId--1698925231%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc40451457%22%3E%3C%2FA%3EThird%20Approach%20%E2%80%93%20Run%20PS%20Command%20on%20ADFS%20Server%20to%20retrieve%20Sign%20in%20Logs%20from%20Azure%20Active%20Directory%3C%2FH2%3E%0A%3CH3%20id%3D%22toc-hId-917667686%22%20id%3D%22toc-hId-917670321%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId--889786777%22%20id%3D%22toc-hId--889784142%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc40451458%22%3E%3C%2FA%3ESummary%3C%2FH3%3E%0A%3CP%3EThe%20customer%20did%20not%20have%20a%20Log%20Analytics%20workspace%20or%20Azure%20Security%20Center%20set%20up.%20After%20having%20a%20couple%20conversations%2C%20we%20concluded%20we%20had%20to%20move%20forward%20without%20the%20help%20of%20these%20services.%20This%20meant%20we%20were%20now%20limited%20to%20only%20viewing%20the%20Sign-in%20Logs%20from%20the%20portal.%20Since%20the%20portal%20does%20not%20allow%20to%20filter%20by%20error%20code%2C%20we%20can%20use%20a%20command%20in%20PowerShell%20to%20pull%20the%20right%20records.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20error%20code%20being%20used%20to%20filter%20by%20is%20error%20code%2050140%20which%20is%20occurs%20when%20there%20is%20an%20interruption%20that%20has%20occurred%20when%20attempting%20to%20authenticate.%20Since%20we%20know%20the%20authentication%20is%20happening%20in%20ADFS%20and%20not%20in%20Azure%20that%20is%20why%20we%20used%20this%20error%20code%20to%20help%20us%20pinpoint%20the%20accounts%20that%20were%20being%20locked%20out.%20An%20interruption%20in%20the%20Azure%20Sign-in%20Logs%20actually%20meant%20a%20lockout%20for%20us.%3C%2FP%3E%0A%3CP%3EIn%20order%20to%20attempt%20this%20approach%2C%20you%20must%20have%20all%20the%20below%20items%20checked%20off.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%E2%98%90%20Make%20sure%20you%20have%20PowerShell%20installed%20in%20your%20ADFS%20Server%3C%2FP%3E%0A%3CP%3E%E2%98%90%20Verify%20the%20Azure%20AD%20Preview%20is%20installed%3C%2FP%3E%0A%3CP%3E%E2%98%90%20Connect%20to%20Azure%20AD%20from%20PowerShell%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1597726056%22%20id%3D%22toc-hId-1597728691%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc40451459%22%3E%3C%2FA%3ESteps%3C%2FH3%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20don%E2%80%99t%20have%20PowerShell%20ISE%20installed%20visit%20this%20site%20and%20resume%20at%20this%20step%20after%20installing%20successfully.%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fscripting%2Finstall%2Finstalling-windows-powershell%3Fview%3Dpowershell-7%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fscripting%2Finstall%2Finstalling-windows-powershell%3Fview%3Dpowershell-7%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E1.%20In%20the%20ADFS%20Server%2C%20open%20PowerShell%20and%20run%20command%20with%20error%20code.%20This%20command%20is%20pulling%20from%20the%20Azure%20AD%20Sign-in%20logs.%20You%20can%20export%20your%20results%20to%20CSV%20file%20from%20PowerShell.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSTRONG%3EVerify%20the%20AzureADPreview%20Module%20is%20installed%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EIn%20your%20ADFS%20Server%2C%20Open%20PowerShell%20ISE%20and%20%E2%80%98Run%20as%20an%20Administrator.%E2%80%99%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_60-1589809614824.png%22%20style%3D%22width%3A%20291px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192654i81B6E74FAD24370E%2Fimage-dimensions%2F291x234%3Fv%3D1.0%22%20width%3D%22291%22%20height%3D%22234%22%20title%3D%22BrandonWilson_60-1589809614824.png%22%20alt%3D%22BrandonWilson_60-1589809614824.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EIn%20the%20Script%20window%2C%20type%20in%20the%20command%20below%20into%20the%20Script%20window%20and%20hit%20the%20%E2%80%98Enter%E2%80%99%20key%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EGet-Module%20azureadpreview%20-ListAvailable%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_61-1589809614831.png%22%20style%3D%22width%3A%20709px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192656i903C42F1586445E2%2Fimage-dimensions%2F709x78%3Fv%3D1.0%22%20width%3D%22709%22%20height%3D%2278%22%20title%3D%22BrandonWilson_61-1589809614831.png%22%20alt%3D%22BrandonWilson_61-1589809614831.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EIf%20you%20need%20to%20install%20the%20AzureADPreview%20module%20type%20the%20command%20below%20into%20the%20Script%20window%20and%20hit%20the%20%E2%80%98Enter%E2%80%99%20key.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EInstall-module%20AzureADPreview%20-Verbose%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSTRONG%3ERunning%20the%20Command%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EIn%20your%20ADFS%20Server%2C%20Open%20PowerShell%20ISE%20and%20%E2%80%98Run%20as%20an%20Administrator.%E2%80%99%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_62-1589809614834.png%22%20style%3D%22width%3A%20275px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192657i0B85DFB271DCCBC2%2Fimage-dimensions%2F275x221%3Fv%3D1.0%22%20width%3D%22275%22%20height%3D%22221%22%20title%3D%22BrandonWilson_62-1589809614834.png%22%20alt%3D%22BrandonWilson_62-1589809614834.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EType%20in%20the%20command%20%E2%80%98Connect-AzureAD%E2%80%99%20into%20the%20Script%20window%20and%20hit%20the%20%E2%80%98Enter%E2%80%99%20key.%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_63-1589809614836.png%22%20style%3D%22width%3A%20462px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192658iC3E6367A3759E884%2Fimage-dimensions%2F462x387%3Fv%3D1.0%22%20width%3D%22462%22%20height%3D%22387%22%20title%3D%22BrandonWilson_63-1589809614836.png%22%20alt%3D%22BrandonWilson_63-1589809614836.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EAfter%20hitting%20enter%2C%20the%20%E2%80%98Sign%20in%20to%20your%20account%E2%80%99%20window%20appears.%20Enter%20your%20Azure%20credentials.%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_64-1589809614840.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192659iDAFFC46C44C933F1%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22BrandonWilson_64-1589809614840.png%22%20alt%3D%22BrandonWilson_64-1589809614840.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_65-1589809614843.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192660i8C58F4836199AE80%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22BrandonWilson_65-1589809614843.png%22%20alt%3D%22BrandonWilson_65-1589809614843.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3ENow%2C%20your%20Azure%20account%20is%20connected%20to%20PowerShell%2C%20you%E2%80%99ve%20verified%20that%20you%20have%20the%20AzureADPreview%20module%20installed%20and%20the%20command%20can%20be%20run.%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3ECopy%20the%20command%20below%20(Ctrl%20%2B%20C)%20and%20paste%20(Ctrl%20%2B%20V)%20onto%20the%20PowerShell%20ISE%20Script%20Window%20and%20hit%20the%20%E2%80%98Enter%E2%80%99%20key.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EGet-AzureADAuditSignInLogs%20-Filter%20%22status%2FerrorCode%20eq%2050140%22%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSTRONG%3EOutput%20to%20CSV%20file%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3ETo%20export%20the%20results%20onto%20a%20CSV%20file%2C%20run%20the%20command%20below.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EGet-AzureADAuditSignInLogs%20-Filter%20%22status%2FerrorCode%20eq%2050140%22%20%7C%20Out-File%20-FilePath%20%22%5Clogs.csv%22%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSTRONG%3EHow%20to%20handle%20the%20bug%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EDuring%20testing%20in%20my%20environment%2C%20the%20command%20ran%20smoothly%2C%20and%20I%20acquired%20the%20desired%20results%20with%20my%20test%20data.%20Unfortunately%2C%20in%20my%20customer%E2%80%99s%20environment%20we%20were%20getting%20the%20error%20below%20when%20running%20the%20command.%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrandonWilson_66-1589809614846.png%22%20style%3D%22width%3A%20954px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192661iE2AF35E69EF3A170%2Fimage-dimensions%2F954x127%3Fv%3D1.0%22%20width%3D%22954%22%20height%3D%22127%22%20title%3D%22BrandonWilson_66-1589809614846.png%22%20alt%3D%22BrandonWilson_66-1589809614846.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EAfter%20researching%2C%20we%20discovered%20this%20was%20a%20bug%20in%20the%20AzureADPreview%20module%2C%20to%20which%20this%20command%20belongs%20to.%20Check%20out%20the%20GitHub%20blog%20below%20if%20you%E2%80%99d%20like%20to%20read%20more%20about%20the%20bug%20and%20check%20for%20updates.%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2Fazure-docs-powershell-azuread%2Fissues%2F337%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FAzure%2Fazure-docs-powershell-azuread%2Fissues%2F337%3C%2FA%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EWe%20reached%20out%20to%20the%20product%20group%20and%20it%20is%20an%20ongoing%20process%20meaning%20we%20would%20not%20get%20a%20resolution%20in%20a%20timely%20manner.%20Then%20we%20reached%20out%20to%20Microsoft%20support%20and%20worked%20with%20a%20Support%20Engineer%20on%20finding%20alternatives.%20Below%20is%20a%20script%20provided%20by%20him%20to%20help%20us%20filter%20and%20retrieve%20the%20sign%20in%20logs%20from%20Azure%20and%20send%20them%20to%20a%20CSV%20file%20for%20record%20keeping.%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSTRONG%3EGet%20Sign-in%20Logs%20using%20the%20script%20below%20in%20PowerShell%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%23%20------------------------------------------------------------%0A%23%20Copyright%20(c)%20Microsoft%20Corporation.%20%20All%20rights%20reserved.%0A%23%20------------------------------------------------------------%0A%0AImport-Module%20Azure%0A%0A%23%20Replace%20with%20your%20tenantId%20or%20tenantDomain%0A%24tenantId%20%3D%20%22%22%0A%0A%23%20Replace%20with%20your%20desired%20time%20ranges%0A%24toDate%20%3D%20%22%7B0%3As%7D%22%20-f%20(get-date).ToUniversalTime()%20%2B%20%22Z%22%0A%24fromDate%20%3D%20%22%7B0%3As%7D%22%20-f%20(get-date).AddDays(-7).ToUniversalTime()%20%2B%20%22Z%22%0A%0A%23%20You%20can%20add%20more%20filters%20here%0A%24url%20%3D%20%22https%3A%2F%2Fgraph.microsoft.com%2Fbeta%2FauditLogs%2FsignIns%3F%60%24filter%3DcreatedDateTime%20ge%20%24fromDate%20and%20createdDateTime%20le%20%24toDate%20and%20status%2Ferrorcode%20eq%2050140%22%0A%0A%23%20By%20default%2C%20it%20saves%20the%20result%20to%20DownloadedReport_currentTime.csv.%20Change%20it%20to%20different%20file%20name%20as%20needed.%0A%24now%20%3D%20%22%7B0%3AyyyyMMdd_hhmmss%7D%22%20-f%20(get-date)%0A%24outputFile%20%3D%20%22AAD_SignInReport_%24now.csv%22%0A%0A%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%0A%23%23%23%23%20DO%20NOT%20MODIFY%20BELOW%20LINES%20%23%23%23%23%0A%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%0A%0AFunction%20Expand-Collections%20%7B%0A%20%20%20%20%5Bcmdletbinding()%5D%0A%20%20%20%20Param%20(%0A%20%20%20%20%20%20%20%20%5Bparameter(ValueFromPipeline)%5D%0A%20%20%20%20%20%20%20%20%5Bpsobject%5D%24MSGraphObject%0A%20%20%20%20)%0A%20%20%20%20Begin%20%7B%0A%20%20%20%20%20%20%20%20%24IsSchemaObtained%20%3D%20%24False%0A%20%20%20%20%7D%0A%20%20%20%20Process%20%7B%0A%20%20%20%20%20%20%20%20If%20(!%24IsSchemaObtained)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%24OutputOrder%20%3D%20%24MSGraphObject.psobject.properties.name%0A%20%20%20%20%20%20%20%20%20%20%20%20%24IsSchemaObtained%20%3D%20%24True%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20%24MSGraphObject%20%7C%20ForEach-Object%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%24singleGraphObject%20%3D%20%24_%0A%20%20%20%20%20%20%20%20%20%20%20%20%24ExpandedObject%20%3D%20New-Object%20-TypeName%20PSObject%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%24OutputOrder%20%7C%20ForEach-Object%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Add-Member%20-InputObject%20%24ExpandedObject%20-MemberType%20NoteProperty%20-Name%20%24_%20-Value%20%24((%24singleGraphObject.%24(%24_)%20%7C%20Out-String).Trim())%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24ExpandedObject%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%20%20End%20%7B%7D%0A%7D%0A%0AFunction%20Get-Headers%20%7B%0A%20%20%20%20param(%20%24token%20)%0A%0A%20%20%20%20Return%20%40%7B%0A%20%20%20%20%20%20%20%20%22Authorization%22%20%3D%20(%22Bearer%20%7B0%7D%22%20-f%20%24token)%3B%0A%20%20%20%20%20%20%20%20%22Content-Type%22%20%3D%20%22application%2Fjson%22%3B%0A%20%20%20%20%7D%0A%7D%0A%0A%24clientId%20%3D%20%221b730954-1685-4b74-9bfd-dac224a7b894%22%20%23%20Azure%20Active%20Directory%20PowerShell%20clientId%0A%24redirectUri%20%3D%20%22urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob%22%0A%24MSGraphURI%20%3D%20%22https%3A%2F%2Fgraph.microsoft.com%22%0A%0A%24authority%20%3D%20%22https%3A%2F%2Flogin.microsoftonline.com%2F%24tenantId%22%0A%24authContext%20%3D%20New-Object%20%22Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext%22%20-ArgumentList%20%24authority%0A%24authResult%20%3D%20%24authContext.AcquireToken(%24MSGraphURI%2C%20%24clientId%2C%20%24redirectUri%2C%20%22Always%22)%0A%24token%20%3D%20%24authResult.AccessToken%0A%0Aif%20(%24token%20-eq%20%24null)%20%7B%0A%20%20%20%20Write-Output%20%22ERROR%3A%20Failed%20to%20get%20an%20Access%20Token%22%0A%20%20%20%20exit%0A%7D%0A%0AWrite-Output%20%22--------------------------------------------------------------%22%0AWrite-Output%20%22Downloading%20report%20from%20%24url%22%0AWrite-Output%20%22Output%20file%3A%20%24outputFile%22%0AWrite-Output%20%22--------------------------------------------------------------%22%0A%0A%23%20Call%20Microsoft%20Graph%0A%24headers%20%3D%20Get-Headers(%24token)%0A%0A%24count%3D0%0A%24retryCount%20%3D%200%0A%24oneSuccessfulFetch%20%3D%20%24False%0A%0ADo%20%7B%0A%20%20%20%20Write-Output%20%22Fetching%20data%20using%20Url%3A%20%24url%22%0A%0A%20%20%20%20Try%20%7B%0A%20%20%20%20%20%20%20%20%24myReport%20%3D%20(Invoke-WebRequest%20-UseBasicParsing%20-Headers%20%24headers%20-Uri%20%24url)%0A%20%20%20%20%20%20%20%20%24convertedReport%20%3D%20(%24myReport.Content%20%7C%20ConvertFrom-Json).value%0A%20%20%20%20%20%20%20%20%24convertedReport%20%7C%20Expand-Collections%20%7C%20ConvertTo-Csv%20-NoTypeInformation%20%7C%20Add-Content%20%24outputFile%0A%20%20%20%20%20%20%20%20%24url%20%3D%20(%24myReport.Content%20%7C%20ConvertFrom-Json).'%40odata.nextLink'%0A%20%20%20%20%20%20%20%20%24count%20%3D%20%24count%2B%24convertedReport.Count%0A%20%20%20%20%20%20%20%20Write-Output%20%22Total%20Fetched%3A%20%24count%22%0A%20%20%20%20%20%20%20%20%24oneSuccessfulFetch%20%3D%20%24True%0A%20%20%20%20%20%20%20%20%24retryCount%20%3D%200%0A%20%20%20%20%7D%0A%20%20%20%20Catch%20%5BSystem.Net.WebException%5D%20%7B%0A%20%20%20%20%20%20%20%20%24statusCode%20%3D%20%5Bint%5D%24_.Exception.Response.StatusCode%0A%20%20%20%20%20%20%20%20Write-Output%20%24statusCode%0A%20%20%20%20%20%20%20%20Write-Output%20%24_.Exception.Message%0A%20%20%20%20%20%20%20%20if(%24statusCode%20-eq%20401%20-and%20%24oneSuccessfulFetch)%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%23%20Token%20might%20have%20expired!%20Renew%20token%20and%20try%20again%0A%20%20%20%20%20%20%20%20%20%20%20%20%24authResult%20%3D%20%24authContext.AcquireToken(%24MSGraphURI%2C%20%24clientId%2C%20%24redirectUri%2C%20%22Auto%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20%24token%20%3D%20%24authResult.AccessToken%0A%20%20%20%20%20%20%20%20%20%20%20%20%24headers%20%3D%20Get-Headers(%24token)%0A%20%20%20%20%20%20%20%20%20%20%20%20%24oneSuccessfulFetch%20%3D%20%24False%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20elseif(%24statusCode%20-eq%20429)%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%23%20throttled%20request%2C%20wait%20for%20a%20few%20seconds%20and%20retry%0A%20%20%20%20%20%20%20%20%20%20%20%20Start-Sleep%20-5%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20elseif(%24statusCode%20-eq%20403%20-or%20%24statusCode%20-eq%20400%20-or%20%24statusCode%20-eq%20401)%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20Write-Output%20%22Please%20check%20the%20permissions%20of%20the%20user%22%0A%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(%24retryCount%20-lt%205)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Write-Output%20%22Retrying...%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24retryCount%2B%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Write-Output%20%22Download%20request%20failed.%20Please%20try%20again%20in%20the%20future.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%7D%0A%20%20%20%20Catch%20%7B%0A%20%20%20%20%20%20%20%20%24exType%20%3D%20%24_.Exception.GetType().FullName%0A%20%20%20%20%20%20%20%20%24exMsg%20%3D%20%24_.Exception.Message%0A%0A%20%20%20%20%20%20%20%20Write-Output%20%22Exception%3A%20%24_.Exception%22%0A%20%20%20%20%20%20%20%20Write-Output%20%22Error%20Message%3A%20%24exType%22%0A%20%20%20%20%20%20%20%20Write-Output%20%22Error%20Message%3A%20%24exMsg%22%0A%0A%20%20%20%20%20%20%20%20%20if%20(%24retryCount%20-lt%205)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20Write-Output%20%22Retrying...%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%24retryCount%2B%2B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20Write-Output%20%22Download%20request%20failed.%20Please%20try%20again%20in%20the%20future.%22%0A%20%20%20%20%20%20%20%20%20%20%20%20break%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%0A%20%20%20%20Write-Output%20%22--------------------------------------------------------------%22%0A%7D%20while(%24url%20-ne%20%24null)%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--338811126%22%20id%3D%22toc-hId--338808491%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22toc-hId--2146265589%22%20id%3D%22toc-hId--2146262954%22%3EGitHub%20Reference%20to%20Scripts%3C%2FH2%3E%0A%3CP%3EI%20have%20posted%20all%20the%20scripts%20used%20in%20this%20guide%20onto%20GitHub.%20If%20any%20updates%20are%20made%20in%20the%20future%20you%20will%20find%20them%20here.%20Please%20access%20through%20the%20link%20below.%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FEunice-Chinchilla%2FADFSLockoutTracking%2Ftree%2Fmaster%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FEunice-Chinchilla%2FADFSLockoutTracking%2Ftree%2Fmaster%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-341247244%22%20id%3D%22toc-hId-341249879%22%3EConclusion%3C%2FH2%3E%0A%3CP%3EAfter%20exploring%20different%20methods%20and%20going%20down%20different%20paths%20to%20achieve%20our%20goal%20of%20tracking%20where%20the%20ADFS%20Account%20Lockouts%20were%20coming%20from%20I%20was%20able%20to%20deliver%20multiple%20solutions%20to%20our%20customer.%20It%20was%20a%20learning%20experience%20which%20allowed%20me%20to%20readjust%20when%20presented%20with%20blockers%20or%20obstacles.%20Through%20my%20journey%20I%20did%20not%20have%20too%20many%20sources%20to%20guide%20me%20and%20therefore%20I%20documented%20the%20steps%20I%20went%20through.%20Hopefully%20this%20guide%20provided%20you%20with%20some%20helpful%20information.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20for%20reading!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3E%3CFONT%20size%3D%222%22%3EDisclaimer%3C%2FFONT%3E%3C%2FEM%3E%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CEM%3E%3CFONT%20size%3D%222%22%3EThe%20sample%20scripts%20are%20not%20supported%20under%20any%20Microsoft%20standard%20support%20program%20or%20service.%20The%20sample%20scripts%20are%20provided%20AS%20IS%20without%20warranty%20of%20any%20kind.%20Microsoft%20further%20disclaims%20all%20implied%20warranties%20including%2C%20without%20limitation%2C%20any%20implied%20warranties%20of%20merchantability%20or%20of%20fitness%20for%20a%20particular%20purpose.%20The%20entire%20risk%20arising%20out%20of%20the%20use%20or%20performance%20of%20the%20sample%20scripts%20and%20documentation%20remains%20with%20you.%20In%20no%20event%20shall%20Microsoft%2C%20its%20authors%2C%20or%20anyone%20else%20involved%20in%20the%20creation%2C%20production%2C%20or%20delivery%20of%20the%20scripts%20be%20liable%20for%20any%20damages%20whatsoever%20(including%2C%20without%20limitation%2C%20damages%20for%20loss%20of%20business%20profits%2C%20business%20interruption%2C%20loss%20of%20business%20information%2C%20or%20other%20pecuniary%20loss)%20arising%20out%20of%20the%20use%20of%20or%20inability%20to%20use%20the%20sample%20scripts%20or%20documentation%2C%20even%20if%20Microsoft%20has%20been%20advised%20of%20the%20possibility%20of%20such%20damages.%3C%2FFONT%3E%3C%2FEM%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1399297%22%20slang%3D%22en-US%22%3E%3CP%3EEunice%20Chinchilla%20walks%20you%20through%20tracking%20the%20source%20of%20ADFS%20account%20lockouts%20using%26nbsp%3Bsolely%20the%20ADFS%20server%20and%20Azure%20logs.%20The%20following%20solutions%20are%20a%20summary%20of%20the%20journey%20I%20went%20on%20with%20the%20purpose%20to%20find%20the%20most%20information%20possible%20related%20to%20the%20lockouts.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1399297%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EEuniceChinchilla%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

 

Introduction

I am Eunice Chinchilla, and I am a Premier Field Engineer at Microsoft focusing in the Identity space. In this guide you will find a description of the task at hand and the journey I went on to deliver a solution for my customer. Each section includes a high-level summary of what will be discussed and any pre-requisites to be able to try these in your own test environment. Once you are ready to start testing there are steps accompanied by descriptions and screenshots to walk you through the whole process I went through, including any hiccups I ran into. Please read the Problem Statement/Customer Story up next to provide you with background information and help you get started.

 

Problem Statement/Customer Story

I was working with a customer and they needed to identify why user lockouts were occurring. They had a hybrid environment with ADFS in place meaning the domains are federated. In this scenario, it is necessary to know if the lockout happened on-prem or on a O365 application. The plan of action was to look at the logs in both the Domain Controller and the ADFS server and compare them to the logs in Azure to see what we could find. Unfortunately, we were limited to only the ADFS server logs because there was no access to the Domain controller due to permissions. All the investigation was done solely on the ADFS server and Azure logs. The following solutions are a summary of the journey I went on with the purpose to find the most information possible related to the lockouts. I spent time testing in my own environment which is set up like theirs. In the end, it was narrowed down to the application used when the lockout occurred.

 

Approaches

 

First Approach

The first attempt in searching for the information needed was to look through the security logs and see what we could find.

 

Second Approach

Since looking through the logs resulted in very little information that was not enough for the customer to figure out where the lockouts where coming from, we resorted to Log Analytics and Azure Security Center to help find more specific and detailed information.

 

Third Approach

The customer did not have access to Azure Log Analytics and Azure Security Center which left us to explore the Azure Sign in Logs.

 

First Approach – PowerShell Script run on ADFS Server

 

Summary

Initially, I looked at the event logs in the ADFS server in my test environment. There were a few things I did before which are listed below in a checklist.

 

☐ Enable the appropriate logs: ‘Source AD FS Auditing Logs’

☐ Create test lockout events

Note: You can create these for testing purposes or just use the lockouts that already exist in your environment.

☐ Make sure you have PowerShell installed in your ADFS Server

☐ If you have multiple servers, make sure to enable remote access

 

Steps

 

1. First, make sure the ‘Source AD FS Auditing Logs’ are enabled in the ADFS server. This allows you to see the events with ID 411. Event 411 occurs when there is a failed token validation attempt (authentication attempts). In the event viewer, the IP address of the device used is provided. This can be useful for tracking the lockout.

 

Enabling the Source AD FS Auditing Logs

Open the Local Security Policy window from the Start menu on your server.

 

BrandonWilson_38-1589809614343.png

 

Once opened, you should see a view like the window below. Click on ‘Advanced Audit Policy Configuration.’

Click on ‘System Audit Policies – Local Group Policy Object.’

Navigate to the ‘Logon/Logoff’ category. You should now see all the subcategories available.

Select the ‘Audit Account Lockout’ subcategory.

BrandonWilson_39-1589809614349.png

 

A separate window will appear, and you can check the boxes for Success and Failure audit events. After having done this, the ‘Source AD FS Auditing Logs’ have successfully been enabled.

 

BrandonWilson_40-1589809614351.png

 

Under the ‘Explain’ tab you can find a detailed explanation of what happens when you enable these audit logs.

 

BrandonWilson_41-1589809614353.png

 

2. Skip this step if you already have lockouts in your environment. If not, you can create some account lockouts, as I did in my test environment.

 

Create test account lockout events

Open the ‘Local Security Policy’ window and click on ‘Account Policies.’

Click on ‘Account Lockout Policy.’

On the right-hand side are the security settings you can customize for the account lockouts. I set lower amounts of time so I could create multiple account lockout in shorter amounts of time.

 

BrandonWilson_42-1589809614357.png

 

Note: It is necessary to set the account lockout policy in the Domain Controller as well. Make sure the account lockout policy in the ADFS Server does not surpass the Domain Controller account lockout policy amounts of time and attempts. This will cause an error.

 

After setting the lockout policy on the appropriate server, start one of your Windows 10 joined Virtual Machines. From this VM, on any browser, you will attempt to log on to your account using any of your test user accounts.

 

BrandonWilson_43-1589809614660.png

 

Enter the wrong password on purpose as a simulation of an account lockout.

 

BrandonWilson_44-1589809614690.png

 

The ADFS splash page will not notify you when you’ve been locked out and will continue to display the view below. If your “invalid attempt logon” number was 2, repeat this process 3 times to ensure the lockout of the account occurred.

 

BrandonWilson_45-1589809614694.png

 

View the lockout event(s)

To verify the lockout happened open the Event Viewer.

              

BrandonWilson_46-1589809614695.png

 

Navigate to the ‘Security Logs’ under ‘Windows Logs.’

             

BrandonWilson_47-1589809614698.png

 

Here you can view the event(s) generated when the lockout(s) occurred.

 

BrandonWilson_48-1589809614703.png

 

You can also filter by error code (once you know which error code to look for). In this case, we can filter by error code 4625.

On the right-hand side, in the ‘Security’ window under ‘Actions’ select the ‘Filter Current Log…’ option.

 

BrandonWilson_49-1589809614706.png

 

Check every box for the ‘Event Level’ and enter the event ID. Click ‘Ok.’

 

BrandonWilson_50-1589809614708.png

 

Below are the results of the filtered events.

 

BrandonWilson_51-1589809614719.png

 

3. In your ADFS Server, open PowerShell ISE to run script that will be pulling the events related the lockout events. In this script we are querying for all the 411 events from the Source AD FS Auditing logs. The reason you want to filter for Event ID 411 is because this event gets created when there is a failed authentication attempt. The expected output is the Username, Activity ID, IP address, Date Created.

If you don’t have PowerShell ISE installed visit this site and resume at this step after installing successfully.

https://docs.microsoft.com/en-us/powershell/scripting/install/installing-windows-powershell?view=pow...

 

Running the Script

In your ADFS Server, Open PowerShell ISE and ‘Run as an Administrator.’

 

BrandonWilson_52-1589809614721.png

 

Copy the script below (Ctrl + C). It will be pasted onto the PowerShell ISE Script Window

 

 

#Get all the events with Event ID 411
$eventLogs = Get-EventLog -LogName Security -Source "AD FS Auditing" | Where-Object {$_.EventID -eq 411}
$eventList = @() #list that holds event objects

foreach ($event in $eventLogs)
{
    $message = $event.Message
    $emailRegEx = "\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b"
    $message -match $emailRegEx | Out-Null

    $eventObject = New-Object -TypeName psobject #start off with an new object

    #add the User Name
    $eventObject | Add-Member -MemberType NoteProperty -Name Username -Value $Matches.Values

    $activityIDRegEx = "[A-Za-z0-9]+-[A-Za-z0-9]+-[A-Za-z0-9]+-[A-Za-z0-9]+-[A-Za-z0-9]*"
    $message -match $activityIDRegEx | Out-Null

    #add the activity ID
    $eventObject | Add-Member -MemberType NoteProperty -Name "Activity ID" -Value $Matches.Values
      
    $IPAddressRegEx = "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]*"
    $message -match $IPAddressRegEx | Out-Null

    #add the IP address
    $eventObject | Add-Member -MemberType NoteProperty -Name "IP Address" -Value $Matches.Values

    #add the date the event happened
    $eventObject | Add-Member -MemberType NoteProperty -Name "Date Created" -Value $event.TimeGenerated

    $eventList += $eventObject #add each event object to a list

    #Now, there is an event object that contains all the relevant information about the event. 
   

}

#Group by user name and send the list of account info to a CSV file
$eventList | Sort-Object -Property "Username" | Out-File -FilePath "C:Enter your path here\lockouts.csv" -Encoding utf8

 

 

 

Paste the code into the Script window (Ctrl + V).

 

BrandonWilson_53-1589809614742.png

 

Note: If you have multiple ADFS Servers you can either run the script above on each server individually and have multiple csv output files or run the code below in PowerShell ISE from any ADFS server, but you must first enable remote access to the other ADFS servers. See link below on how to enable remote access to your other machines.

https://docs.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/remote-deskto...

 

Multiple Server Script

 

 

foreach($s in $adfsServers){

    #Get all the events with Event ID 411
       
    $_xmlLockoutAdfs = "*[System[EventID=411]]"
    $eventLogs =  Get-WinEvent -ComputerName $s -LogName Security -FilterXPath       $_xmlLockoutAdfs
    
    $eventList = @() #list that holds event objects

    foreach ($event in $eventLogs)
    {

        $eventObject = New-Object -TypeName psobject #start off empty object

        $message = $event.Message
        $emailRegEx = "\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b"
        $message -match $emailRegEx | Out-Null

        

        #add the User Name
        $eventObject | Add-Member -MemberType NoteProperty -Name Username -Value $Matches.Values

        $activityIDRegEx = "[A-Za-z0-9]+-[A-Za-z0-9]+-[A-Za-z0-9]+-[A-Za-z0-9]+-[A-Za-z0-9]*"
        $message -match $activityIDRegEx | Out-Null

        #add the activity ID
        $eventObject | Add-Member -MemberType NoteProperty -Name "Activity ID" -Value $Matches.Values
      
        $IPAddressRegEx = "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]*"
        $message -match $IPAddressRegEx | Out-Null

        #add the IP address
        $eventObject | Add-Member -MemberType NoteProperty -Name "IP Address" -Value $Matches.Values

        #add the date the event happened
        $eventObject | Add-Member -MemberType NoteProperty -Name "Date Created" -Value $event.TimeCreated

     

        $eventList += $eventObject #add each event object to a list

        #Now, there is an event object that contains all the relevant information about the event. 
   

    }

    $eventList | Sort-Object -Property "Username" | Out-File -FilePath "C:Enter your path here\lockouts.csv" -Encoding utf8 

}

 

 

 

4. Open the Event Viewer and filter for Events 411. This is useful to confirm the results from the script.

 

Open the security logOpen the security log

 

Select filter current logSelect filter current log

 

Filter on 411 eventsFilter on 411 events

 

411 event example411 event example

 

Second Approach – Log Analytics and Kusto Query Language on ADFS Server

 

Summary

Given the limited results of the event logs we decided to take another approach in the search of more detailed information. The event logs provided the Username, Activity ID, IP address, Date Created which was not enough information to conclude where exactly the lockouts where occurring. In hopes of finding more specific information we resorted to Azure Log Analytics. Through Log Analytics we were able to successfully collect the information needed such as the application being used when the lockout occurred. Below is a list of requirements to attempt this approach.

 

☐ Log Analytics must be set up with current environment and connected to the correct Virtual Machines.

☐ Have Azure Security Center set up in order to retrieve security events from the ADFS Server.

☐ Admin Credentials to Azure Active Directory to be able to access the logs

 

Steps

 

If you don’t have Log Analytics, below are some helpful links to get all set up.

 

Creating a workspace:

https://docs.microsoft.com/en-us/azure/azure-monitor/learn/quick-create-workspace

 

Collecting data from Azure Virtual Machines:

https://docs.microsoft.com/en-us/azure/azure-monitor/learn/quick-collect-azurevm

 

If you do not have Azure Security Center set up, below are some helpful links to get all set up.

 

Onboard Windows computers to Azure Security Center:

https://docs.microsoft.com/en-us/azure/security-center/quick-onboard-windows-computer

 

1. Navigate to your Log Analytics workspace -> Logs where you will be querying the security logs.

 

BrandonWilson_58-1589809614813.png

 

2. Copy (Ctrl + C) and Paste (Ctrl + V) the Kusto Query shown below and then run it by clicking on the ‘Run’ button.

 

 

SecurityEvent
| where EventID == 411
| project EventData, Computer, TimeGenerated, EventSourceName 
| extend p = parse_xml(EventData)
| extend CorrelationId = tostring(parse_json(tostring(parse_json(tostring(p.EventData)).Data))[0])
    | join (SigninLogs
        | where Status.errorCode == "50140" 
        | project Status, UserDisplayName, UserPrincipalName, UserId, AppDisplayName, ClientAppUsed, AppId, IPAddress, CorrelationId 
    ) on CorrelationId 
    | project EventSourceName, Status, UserDisplayName, UserPrincipalName, UserId, AppDisplayName, ClientAppUsed, AppId, IPAddress, TimeGenerated, CorrelationId 

 

 

 

3. Once you see the results in the result window you can export the result to a CSV file where it will display the columns specified in the query. You can find the button in the top right-hand corner of the window. Make sure you set the time range to your desired time range before running the query.

 

BrandonWilson_59-1589809614822.png

 

Third Approach – Run PS Command on ADFS Server to retrieve Sign in Logs from Azure Active Directory

 

Summary

The customer did not have a Log Analytics workspace or Azure Security Center set up. After having a couple conversations, we concluded we had to move forward without the help of these services. This meant we were now limited to only viewing the Sign-in Logs from the portal. Since the portal does not allow to filter by error code, we can use a command in PowerShell to pull the right records.

 

The error code being used to filter by is error code 50140 which is occurs when there is an interruption that has occurred when attempting to authenticate. Since we know the authentication is happening in ADFS and not in Azure that is why we used this error code to help us pinpoint the accounts that were being locked out. An interruption in the Azure Sign-in Logs actually meant a lockout for us.

In order to attempt this approach, you must have all the below items checked off.

 

☐ Make sure you have PowerShell installed in your ADFS Server

☐ Verify the Azure AD Preview is installed

☐ Connect to Azure AD from PowerShell

 

Steps

 

If you don’t have PowerShell ISE installed visit this site and resume at this step after installing successfully.

https://docs.microsoft.com/en-us/powershell/scripting/install/installing-windows-powershell?view=pow...

 

1. In the ADFS Server, open PowerShell and run command with error code. This command is pulling from the Azure AD Sign-in logs. You can export your results to CSV file from PowerShell.

 

Verify the AzureADPreview Module is installed

In your ADFS Server, Open PowerShell ISE and ‘Run as an Administrator.’

 

BrandonWilson_60-1589809614824.png

 

In the Script window, type in the command below into the Script window and hit the ‘Enter’ key

 

 

Get-Module azureadpreview -ListAvailable

 

 

 

BrandonWilson_61-1589809614831.png

 

If you need to install the AzureADPreview module type the command below into the Script window and hit the ‘Enter’ key.

 

 

Install-module AzureADPreview -Verbose

 

 

 

Running the Command

In your ADFS Server, Open PowerShell ISE and ‘Run as an Administrator.’

 

BrandonWilson_62-1589809614834.png

 

Type in the command ‘Connect-AzureAD’ into the Script window and hit the ‘Enter’ key.

 

BrandonWilson_63-1589809614836.png

 

After hitting enter, the ‘Sign in to your account’ window appears. Enter your Azure credentials.

 

BrandonWilson_64-1589809614840.png

 

BrandonWilson_65-1589809614843.png

 

Now, your Azure account is connected to PowerShell, you’ve verified that you have the AzureADPreview module installed and the command can be run.

 

Copy the command below (Ctrl + C) and paste (Ctrl + V) onto the PowerShell ISE Script Window and hit the ‘Enter’ key.

 

 

Get-AzureADAuditSignInLogs -Filter "status/errorCode eq 50140"

 

 

 

Output to CSV file

To export the results onto a CSV file, run the command below.

 

 

Get-AzureADAuditSignInLogs -Filter "status/errorCode eq 50140" | Out-File -FilePath "\logs.csv"

 

 

 

How to handle the bug

During testing in my environment, the command ran smoothly, and I acquired the desired results with my test data. Unfortunately, in my customer’s environment we were getting the error below when running the command.

 

BrandonWilson_66-1589809614846.png

 

After researching, we discovered this was a bug in the AzureADPreview module, to which this command belongs to. Check out the GitHub blog below if you’d like to read more about the bug and check for updates.

https://github.com/Azure/azure-docs-powershell-azuread/issues/337

 

We reached out to the product group and it is an ongoing process meaning we would not get a resolution in a timely manner. Then we reached out to Microsoft support and worked with a Support Engineer on finding alternatives. Below is a script provided by him to help us filter and retrieve the sign in logs from Azure and send them to a CSV file for record keeping.

 

Get Sign-in Logs using the script below in PowerShell

 

 

# ------------------------------------------------------------
# Copyright (c) Microsoft Corporation.  All rights reserved.
# ------------------------------------------------------------

Import-Module Azure

# Replace with your tenantId or tenantDomain
$tenantId = ""

# Replace with your desired time ranges
$toDate = "{0:s}" -f (get-date).ToUniversalTime() + "Z"
$fromDate = "{0:s}" -f (get-date).AddDays(-7).ToUniversalTime() + "Z"

# You can add more filters here
$url = "https://graph.microsoft.com/beta/auditLogs/signIns?`$filter=createdDateTime ge $fromDate and createdDateTime le $toDate and status/errorcode eq 50140"

# By default, it saves the result to DownloadedReport_currentTime.csv. Change it to different file name as needed.
$now = "{0:yyyyMMdd_hhmmss}" -f (get-date)
$outputFile = "AAD_SignInReport_$now.csv"

###################################
#### DO NOT MODIFY BELOW LINES ####
###################################

Function Expand-Collections {
    [cmdletbinding()]
    Param (
        [parameter(ValueFromPipeline)]
        [psobject]$MSGraphObject
    )
    Begin {
        $IsSchemaObtained = $False
    }
    Process {
        If (!$IsSchemaObtained) {
            $OutputOrder = $MSGraphObject.psobject.properties.name
            $IsSchemaObtained = $True
        }

        $MSGraphObject | ForEach-Object {
            $singleGraphObject = $_
            $ExpandedObject = New-Object -TypeName PSObject

            $OutputOrder | ForEach-Object {
                Add-Member -InputObject $ExpandedObject -MemberType NoteProperty -Name $_ -Value $(($singleGraphObject.$($_) | Out-String).Trim())
            }
            $ExpandedObject
        }
    }
    End {}
}

Function Get-Headers {
    param( $token )

    Return @{
        "Authorization" = ("Bearer {0}" -f $token);
        "Content-Type" = "application/json";
    }
}

$clientId = "1b730954-1685-4b74-9bfd-dac224a7b894" # Azure Active Directory PowerShell clientId
$redirectUri = "urn:ietf:wg:oauth:2.0:oob"
$MSGraphURI = "https://graph.microsoft.com"

$authority = "https://login.microsoftonline.com/$tenantId"
$authContext = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext" -ArgumentList $authority
$authResult = $authContext.AcquireToken($MSGraphURI, $clientId, $redirectUri, "Always")
$token = $authResult.AccessToken

if ($token -eq $null) {
    Write-Output "ERROR: Failed to get an Access Token"
    exit
}

Write-Output "--------------------------------------------------------------"
Write-Output "Downloading report from $url"
Write-Output "Output file: $outputFile"
Write-Output "--------------------------------------------------------------"

# Call Microsoft Graph
$headers = Get-Headers($token)

$count=0
$retryCount = 0
$oneSuccessfulFetch = $False

Do {
    Write-Output "Fetching data using Url: $url"

    Try {
        $myReport = (Invoke-WebRequest -UseBasicParsing -Headers $headers -Uri $url)
        $convertedReport = ($myReport.Content | ConvertFrom-Json).value
        $convertedReport | Expand-Collections | ConvertTo-Csv -NoTypeInformation | Add-Content $outputFile
        $url = ($myReport.Content | ConvertFrom-Json).'@odata.nextLink'
        $count = $count+$convertedReport.Count
        Write-Output "Total Fetched: $count"
        $oneSuccessfulFetch = $True
        $retryCount = 0
    }
    Catch [System.Net.WebException] {
        $statusCode = [int]$_.Exception.Response.StatusCode
        Write-Output $statusCode
        Write-Output $_.Exception.Message
        if($statusCode -eq 401 -and $oneSuccessfulFetch)
        {
            # Token might have expired! Renew token and try again
            $authResult = $authContext.AcquireToken($MSGraphURI, $clientId, $redirectUri, "Auto")
            $token = $authResult.AccessToken
            $headers = Get-Headers($token)
            $oneSuccessfulFetch = $False
        }
        elseif($statusCode -eq 429)
        {
            # throttled request, wait for a few seconds and retry
            Start-Sleep -5
        }
        elseif($statusCode -eq 403 -or $statusCode -eq 400 -or $statusCode -eq 401)
        {
            Write-Output "Please check the permissions of the user"
            break;
        }
        else {
            if ($retryCount -lt 5) {
                Write-Output "Retrying..."
                $retryCount++
            }
            else {
                Write-Output "Download request failed. Please try again in the future."
                break
            }
        }
     }
    Catch {
        $exType = $_.Exception.GetType().FullName
        $exMsg = $_.Exception.Message

        Write-Output "Exception: $_.Exception"
        Write-Output "Error Message: $exType"
        Write-Output "Error Message: $exMsg"

         if ($retryCount -lt 5) {
            Write-Output "Retrying..."
            $retryCount++
        }
        else {
            Write-Output "Download request failed. Please try again in the future."
            break
        }
    }

    Write-Output "--------------------------------------------------------------"
} while($url -ne $null)

 

 

 

GitHub Reference to Scripts

I have posted all the scripts used in this guide onto GitHub. If any updates are made in the future you will find them here. Please access through the link below.

https://github.com/Eunice-Chinchilla/ADFSLockoutTracking/tree/master

 

Conclusion

After exploring different methods and going down different paths to achieve our goal of tracking where the ADFS Account Lockouts were coming from I was able to deliver multiple solutions to our customer. It was a learning experience which allowed me to readjust when presented with blockers or obstacles. Through my journey I did not have too many sources to guide me and therefore I documented the steps I went through. Hopefully this guide provided you with some helpful information.

 

Thanks for reading!

 

 

 

Disclaimer
The sample scripts are not supported under any Microsoft standard support program or service. The sample scripts are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.