PowerShell: Automatically load scripts or functions when starting PowerShell

Scenario: You want to kick off certain scripts or functions when opening PowerShell Solution:1. Navigate to: C:\Users\<you>\Documents\WindowsPowerShell\2. Create a .ps1 script in this directory called: profile.ps13. Inside the profile.ps1, add the following command(s) to call and run in your .ps1 scripts. Obviously, change the script name. I have multiple scripts that contain Authenticate.ps1 at the…

Add-WindowsCapability : Add-WindowsCapability failed. Error code = 0x800f0954

Scenario: You are trying to install a Windows Capability via PowerShell, such as the AD Tools, however you receive this error: Add-WindowsCapability : Add-WindowsCapability failed. Error code = 0x800f0954 Solution:On your computer, go to:1. GPEdit.msc2. Computer Configuration –> Administrative Templates –> System3. Open Specify settings for optional component installation and component repair …4. Select Enabled…

Check MFA status for users in Azure

Scenario: You need to verify who has MFA configured and how does not. You are interested in knowing which MFA methods users are enrolled into as well.Scritplet:

Locate specific commands, words, or logic in a SEA OF SCRIPTS

Scenario: I have 300 scripts in a directory, but I am not sure which script is running a specific command. Using the following, you can quickly parse through all of your scripts and locate the string ( Command | Word | Phrase ) to see which script has it.Solution: Scritplet:

Check for Autodiscover ServiceBindingInformation during the installation of Exchange — This way you can be alerted when the property is configured, and we can $Null it out.

Scenario: We are installing Exchange On-Premises on some new servers, and we want to minimize the amount of Security Alerts that pop up on users Outlook connections. The Security Alerts pop up because we do not put the servername on the public certificates AND Exchange wants to configure the autodiscover record with https://<local server name>/autodiscover/autodiscover.xml…

Windows – Unable to join domain. “An account with the same name exists in Active Directory. Re-using the account was blocked by security policy”

Scenario: The error below was received when joining a new computer to a domain (the computer object was pre-staged in AD by creating the computer object and resetting it).Error: “An account with the same name exists in Active Directory. Re-using the account was blocked by security policy”Solution: Add the following Reg Key: Reg add HKLM\System\CurrentControlSet\Control\Lsa…


Something went wrong. Please refresh the page and/or try again.

Follow My Blog

Get new content delivered directly to your inbox.