How to report on current Azure MFA registrations in your organisation

Login to Azure Active Directory. Locate Usage & insights , under MonitoringSelect “Users registerd for Multi-Factor Authentication”  Can also be done in powershell : https://dirteam.com/sander/2020/05/14/todo-optimize-the-azure-multi-factor-authentication-methods-used-throughout-your-organization/https://www.cyberdrain.com/monitoring-with-powershell-monitoring-the-used-mfa-type-for-o365-azure/

Powershell to Find Snapshot File

[pastacode lang=”markup” path_id=”b8d027b954f570961ff4f92a25f363ce” file=”snapshotfind.ps1″ highlight=”” lines=”” provider=”gist”/]

Poweshell Script for Intune to Change Office Work/Excel and Powerpoint Autorecover location to OneDrive

You will need to update the CompanyName to yours[pastacode lang=”markdown” manual=”%23Change%20AutoSaveLocation%20to%20OneDrive%0A%0A%0A%0A%24onedrivelocation%20%3D%20%25userprofile%25%5COneDrive%20-%20**CompanyName**%5C%0A%0A%0A%0Amkdir%20%22%24onedrivelocation%5CAutorecover%5CWord%5C%22%0A%0ANew-ItemProperty%20-path%20%22HKCU%3A%5CSoftware%5CMicrosoft%5COffice%5C16.0%5CWord%5COptions%22%20-Name%20AUTOSAVE-PATH%20-PropertyType%20%22ExpandString%22%20-Value%20%22%24onedrivelocation%5CAutorecover%5CWord%5C%22%0A%0Amkdir%20%22%24onedrivelocation%5CAutorecover%5CExcel%5C%22%0A%0ANew-ItemProperty%20-path%20%22HKCU%3A%5CSoftware%5CMicrosoft%5COffice%5C16.0%5Cexcel%5COptions%22%20-Name%20AutoRecoverPath%20-PropertyType%20%22ExpandString%22%20-Value%20%22%24onedrivelocation%5CAutorecover%5CExcel%5C%22%0A%0Amkdir%20%22%24onedrivelocation%5CAutorecover%5CPowerpoint%5C%22%0A%0ANew-ItemProperty%20-path%20%22HKCU%3A%5CSoftware%5CMicrosoft%5COffice%5C16.0%5CPowerPoint%5COptions%22%20-Name%20PathToAutoRecoveryInfo%20-PropertyType%20%22ExpandString%22%20-Value%20%22%24onedrivelocation%5CAutorecover%5CPowerpoint%5C%22″ message=”” highlight=”” provider=”manual”/]

Powershell script to change\set Registry Key Permissions with Subkeys for a User

Powershell script to set Registry Key Permissions with Subkeys for a User ( Needs to be run as admin as its changing things in HKCU:\Software\Policies[pastacode lang=”markdown” manual=”%24acl%20%3D%20Get-Acl%20HKCU%3A%5CSoftware%5CPolicies%5CGoogle%0A%24inherit%20%3D%20%5Bsystem.security.accesscontrol.InheritanceFlags%5D%22ContainerInherit%2C%20ObjectInherit%22%0A%24propagation%20%3D%20%5Bsystem.security.accesscontrol.PropagationFlags%5D%22None%22%0A%24rule%20%3D%20New-Object%20System.Security.AccessControl.RegistryAccessRule%20(%22domain%5Cuser%22%2C%22FullControl%22%2C%24inherit%2C%24propagation%2C%22Allow%22)%0A%24acl.SetAccessRule(%24rule)%0A%24acl%20%7CSet-Acl%20-Path%20HKCU%3A%5CSoftware%5CPolicies%5CGoogle%0A” […]

How to Use Powershell to Mail Merge Outlook Signature for Users out of Active Directory

Script 1[pastacode lang=”markup” manual=”%23Get%20Active%20Directory%20information%20for%20current%20user%0A%0A%24UserName%20%3D%20%24env%3Ausername%0A%0A%24Filter%20%3D%20%E2%80%9C(%26(objectCategory%3DUser)(samAccountName%3D%24UserName))%E2%80%9D%0A%0A%24Searcher%20%3D%20New-Object%20System.DirectoryServices.DirectorySearcher%0A%0A%24Searcher.Filter%20%3D%20%24Filter%0A%0A%24ADUserPath%20%3D%20%24Searcher.FindOne()%0A%0A%24ADUser%20%3D%20%24ADUserPath.GetDirectoryEntry()%0A%0A%24ADDisplayName%20%3D%20%24ADUser.name%0A%0A%24ADTitle%20%3D%20%24ADUser.title%0A%0A%24ADOffice%20%3D%20%24ADUser.physicalDeliveryOfficeName%0A%0A%24script%3AADMobileNumber%20%3D%20%24script%3AADUser.mobile%0A%0A%24ADTelePhoneNumber%20%3D%20%24ADUser.telephoneNumber%0A%0A%24ADExtension1%20%3D%20%24ADUser.extensionAttribute1%0A%0A%24ADExtension2%20%3D%20%24ADUser.extensionAttribute2%0A%0A%24ADExtension3%20%3D%20%24ADUser.extensionAttribute3%0A%0A%20%0A%0A%23Additional%20Variables%0A%0A%24AppData%3D(Get-Item%20env%3Aappdata).value%0A%0A%24SigPath%20%3D%20%E2%80%98%5CMicrosoft%5CSignatures%E2%80%99%0A%0A%24LocalSignaturePath%20%3D%20%24AppData%2B%24SigPath%0A%0A%24SignatureName%20%3D%20’%25signaturename%25’%0A%0A%24DomainName%20%3D%20’%25domainname%25’%0A%0A%24fulladdetails%20%3D%20%24ADDisplayName%2B%24ADExtension1%2B%24ADTitle%2B%24ADOffice%2B%24script%3AADMobileNumber%2B%24ADTelePhoneNumber%0A%0A%20%0A%0A%23Check%20if%20signature%20directory%20exists%20and%2C%20if%20not%2C%20update%20it%0A%0AIf%20(Test-Path%20%24LocalSignaturePath)%0A%0A%7B%7D%0A%0AElse%0A%0A%7BNew-Item%20%24LocalSignaturePath%20-type%20directory%7D%0A%0A%20%0A%0AWrite-host%20%24fulladdetails%0A%0A%20%0A%0A%23Check%20if%20%20Signature%20has%20changed%0A%0AIf%20(%22%24fulladdetails%22%20-eq%20%22%24SigChkDetails%22)%0A%0A%7B%20Exit%20%7D%0A%0AElse%0A%0A%7B%20%20%7D%0A%0A%20%0A%0A%23Delete%20old%20signature%20files%0A%0ARemove-Item%20%22%24LocalSignaturePath%5C%24ADDisplayName.htm%22%20-Recurse%20-Force%0A%0A%20%0A%0A%23Copy%20over%20signature%20template%0A%0A%24SigSource%20%3D%20%E2%80%9C%5C%5Cpath%5Cto%5Csignature%5Csource%22%0A%0A%24filename%20%3D%20%22%5C%5Cpath%5Cto%5Csignature%5Ctemplate.htm%22%0A%0A%24filename2%20%3D%20%22%5C%5Cpath%5Cto%5Clogo.jpg%22%0A%0A%20%0A%0ACopy-Item%20%24filename%20%24LocalSignaturePath%20-Recurse%20-Force%0A%0ACopy-Item%20%24filename2%20%24LocalSignaturePath%20-Recurse%20-Force%0A%20%0A%0A%23Modify%20Signature%20and%20Insert%20Variables%0A%0A(Get-Content%20%24LocalSignaturePath%5Ctemplate.htm)%20-replace%20’FullName’%2C%20%24ADDisplayName%20%7C%20Set-Content%20%24LocalSignaturePath%5Ctemplate.htm%0A%0A(Get-Content%20%24LocalSignaturePath%5Ctemplate.htm)%20-replace%20’PositionTitle’%2C%20%24ADTitle%20%7C%20Set-Content%20%24LocalSignaturePath%5Ctemplate.htm%0A%0A(Get-Content%20%24LocalSignaturePath%5Ctemplate.htm)%20-replace%20’PhoneNumber’%2C%20%24ADTelePhoneNumber%20%7C%20Set-Content%20%24LocalSignaturePath%5Ctemplate.htm%0A%0A%20%0A%0AIf(!%24script%3AADMobileNumber%20-or%20!%24ADExtension2)%7B%0A%0A(Get-Content%20%24LocalSignaturePath%5Ctemplate.htm)%20-replace%20’%3Cb%3EM%3C%2Fb%3E%20MobileNumber’%2C%20%24NULL%20%7C%20Set-Content%20%24LocalSignaturePath%5Ctemplate.htm%7D%0A%0AELSE%0A%0A%7B(Get-Content%20%24LocalSignaturePath%5Ctemplate.htm)%20-replace%20’MobileNumber’%2C%20%24script%3AADMobileNumber%20%7C%20Set-Content%20%24LocalSignaturePath%5Ctemplate.htm%7D%0A%0A%20%0A%0AIf(!%24ADExtension1)%7B%0A%0A(Get-Content%20%24LocalSignaturePath%5Ctemplate.htm)%20-replace%20’%2C%20Qualification’%2C%20%24NULL%20%7C%20Set-Content%20%24LocalSignaturePath%5Ctemplate.htm%7D%0A%0AELSE%0A%0A%7B(Get-Content%20%24LocalSignaturePath%5Ctemplate.htm)%20-replace%20’Qualification’%2C%20%24ADExtension1%20%7C%20Set-Content%20%24LocalSignaturePath%5Ctemplate.htm%7D%0A%0A%20%0A%0AIf(%24ADOffice%20-ne%20’Singapore’)%7B%0A%0AIf(!%24ADExtension3)%7B%0A%0A(Get-Content%20%24LocalSignaturePath%5Ctemplate.htm)%20-replace%20’ImageRow’%2C%20’%3Cimg%20src%3D%22.%2Flogo.jpg%22%20width%3D%22259%22%20height%3D%2274%22%20border%3D%220%22%20%2F%3E’%20%7C%20Set-Content%20%24LocalSignaturePath%5Ctemplate.htm%7D%0A%0A%7DELSE%0A%0A%7B(Get-Content%20%24LocalSignaturePath%5Ctemplate.htm)%20-replace%20’ImageRow’%2C%20%24null%20%7C%20Set-Content%20%24LocalSignaturePath%5Ctemplate.htm%7D%0A%0A%0A%0A%20%0A%0ARename-Item%20-Path%20%24LocalSignaturePath%5Ctemplate.htm%20-NewName%20%22%24ADDisplayName.htm%22%0A%0A%20%0A%0A%23Set%20company%20signature%20as%20default%20for%20New%20messages%0A%0A%5BVoid%5D%20%5BReflection.Assembly%5D%3A%3ALoadWithPartialName(%22Microsoft.Office.Interop.Word%22)%0A%0A%24MSWord%20%3D%20New-Object%20-com%20word.application%0A%0A%24EmailOptions%20%3D%20%24MSWord.EmailOptions%0A%0A%24EmailSignature%20%3D%20%24EmailOptions.EmailSignature%0A%0A%24EmailSignatureEntries%20%3D%20%24EmailSignature.EmailSignatureEntries%0A%0A%24EmailSignature.NewMessageSignature%3D%24ADDisplayName%0A%0A%24MSWord.Quit()%0A%0A%20%0A%0A%23Set%20company%20signature%20as%20default%20for%20Reply%20messages%0A%0A%5BVoid%5D%20%5BReflection.Assembly%5D%3A%3ALoadWithPartialName(%22Microsoft.Office.Interop.Word%22)%0A%0A%24MSWord%20%3D%20New-Object%20-com%20word.application%0A%0A%24EmailOptions%20%3D%20%24MSWord.EmailOptions%0A%0A%24EmailSignature%20%3D%20%24EmailOptions.EmailSignature%0A%0A%24EmailSignatureEntries%20%3D%20%24EmailSignature.EmailSignatureEntries%0A%0A%24EmailSignature.ReplyMessageSignature%3D%24ADDisplayName%0A%0A%24MSWord.Quit()%20″ message=”” highlight=”” provider=”manual”/] Script 2https://pastebin.com/NLJauHgN Script 3https://github.com/raymix/PowerShell-Outlook-Signatures

Add Local Printers via Powershell for Intune

[pastacode lang=”less” manual=”%0A%0AAdd-PrinterDriver%20-Name%20%22HP%20LaserJet%20500%20color%20MFP%20M570%20PCL6%20Class%20Driver%22%0A%0Aadd-printerport%20-name%20%22HP500%22%20-printerhostaddress%20%2210.0.100.21%22%0A%0Aadd-printer%20-name%20%22HP%22%20-drivername%20%22HP%20LaserJet%20500%20color%20MFP%20M570%20PCL6%20Class%20Driver%22%20-port%20%22HP500%22%0A%0ASet-PrintConfiguration%20-PrinterName%20%22AAL-MEL-PR-01(HP)%22%20-PaperSize%20A4%20-Color%20%24false%20-DuplexingMode%20TwoSidedLongEdge%0A%0A%20%0A%0AAdd-PrinterDriver%20-Name%20%22Lexmark%20CX920%20Series%20Class%20Driver%22%0A%0Aadd-printerport%20-name%20%22Lexmark%22%20-printerhostaddress%20%2210.0.100.22%22%0A%0Aadd-printer%20-name%20%22Lexmark%22%20-drivername%20%22Lexmark%20CX920%20Series%20Class%20Driver%22%20-port%20%22Lexmark%22%0A%0ASet-PrintConfiguration%20-PrinterName%20%22AAL-MEL-PR-02(Lexmark)%22%20-PaperSize%20A4%20-Color%20%24false%20-DuplexingMode%20TwoSidedLongEdge%0A” message=”” highlight=”” provider=”manual”/]