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…
Beat your Idle-Timeout on your computer so you do not have to unlock your computer every time you walk your dog.
Scenario: My computer is configured by my organization to lock after its idle for, what feels like, 5 minutes. Solution: Run this loop in PowerShell.
Pull a list of all Microsoft Licenses and Service Plans for all users
Scenario: You need to pull all licenses assigned to all users in your Azure Online tenant.Solution: LETS GRAPH IT in PowerShell
Azure Licenses: License cannot be assigned to a user without a usage location specified.
Scenario: You try to apply a Azure License to a user, but receive this error message: License cannot be assigned to a user without a usage location specified.Solution: Navigate to the User in Azure, edit the properties, and select the Usage Location.
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…
Scriptlets to check Recent Windows and Exchange updates/patches
Scenario: You have just updated your Exchange Servers (or Windows Servers) and you want to verify the successful install of the patches through logic.Solution: SCRIPTLETS:
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…
Loading…
Something went wrong. Please refresh the page and/or try again.
Follow My Blog
Get new content delivered directly to your inbox.