Explore information related to powershell

Install Azure PowerShell module

This article will guide you on how to install the Azure PowerShell module using the cmdlets method and through offline.

Azure CLI is available on #Windows, Mac, Linux, etc. Azure cloud shell is another option that can be browser-accessible and authenticated. 

Azure cloud shell gives you options to choose from either bash or Powershell. 

The Get-Command cmdlet gets all #commands that are installed on the computer, including cmdlets, aliases, functions, filters, scripts, and applications. 

Get-Command gets the commands from #PowerShell modules and commands that were imported from other sessions.

We can use Windows Powershell for managing Azure resources by installing az module.

To install the Azure PowerShell #module, run the following command. Make sure that the Windows PowerShell ISE is opened in "run as administrator” mode. 

By default, the PowerShell gallery is not configured as a Trusted repository for PowerShellGet. 

Click on “Yes to All” to continue with the installation.


Modules included in Azure PowerShell:

1. Azure PowerShell Az. Automation.

2. Azure PowerShell AzureRM. Automation.

3. Other PowerShell modules.

4. Internal Orchestrator. AssetManagement. Cmdlets module.

5. Python 2 modules.

6. Custom modules that you create.

Read More



Install Microsoft PowerShell on Ubuntu

This article will guide you on steps to install PowerShell on #Ubuntu. #PowerShell is a configuration management tool that brings the capabilities of Linux command-line interface (#CLI) control into the historically point-and-click Windows environment to manage Windows servers efficiently in virtual deployments.

With PowerShell and WSL, we can integrate Linux commands into #Windows just as if they were native applications. 

No need to hunt around for Win32 builds of #Linux utilities or be forced to interrupt your workflow to drop into a Linux shell.

To check the PowerShell version installed in your system, you can use either $PSVersionTable or $host command.

To get a list of PowerShell commands:

1. Get-Command gets the commands from #PowerShell modules and commands that were imported from other sessions. 

2. To get only commands that have been imported into the current session, use the ListImported parameter. 

3. Without parameters, Get-Command gets all of the #cmdlets, functions, and aliases installed on the #computer.

Read More



Digitally Signed Files with PowerShell

This article will guide you on how to implement reporting on digitally signed files with PowerShell. 

Get-Command gets the commands from PowerShell modules and commands that were imported from other sessions. 

To get only commands that have been imported into the current session, use the ListImported parameter. 

Without parameters, Get-Command gets all of the cmdlets, functions, and aliases installed on the computer.

Read More



Automate Windows Server 2019 Administration with Ansible

This article will guide you on steps to automate Windows Server 2019 #Administration with Ansible. 

Ansible can be used to manage and execute core functions in Windows #environments, from security updates to remote management using #WinRM. Although Ansible must be run on #Linux, Windows administrators can use Ansible to manage and automate their systems without needing to know how to use a Linux #terminal.

To Connect Ansible on Windows from #Ubuntu:

1. Create Ansible Windows User. Create a new user for the Ansible windows connection setup.

2. Setup Libraries and WinRM.

3. Update the Ansible Inventory file.

4. Update the Ansible Group Variables.

5. Configure #Windows Servers to Manage.

6. Test Connectivity to the Windows Server.

Read More



Powershell to enable script execution

This article will guide you on how to fix #Windows script error via PowerShell. Basically, we used #PowerShell to enable script #execution by running some #commands.

PowerShell is a cross-platform task automation and configuration management framework, consisting of a command-line shell and scripting language. Unlike most shells, which accept and return text, PowerShell is built on top of the . #NET Common Language Runtime (CLR), and accepts and returns . NET objects.

To enable script execution in PowerShell:

i. Open Start.

ii. Search for PowerShell, right-click the top-result and click the Run as administrator option.

iii. Type the following command to allow scripts to run and press Enter: Set-ExecutionPolicy RemoteSigned.

iv. Type A and press Enter (if applicable).

Read More



Disable Password Expiration with PowerShell

This article will guide you on the method to disable password expiration in the #Windows server with PowerShell.

#PowerShell is the shell #framework developed by Microsoft for administration tasks such as configuration management and automation of repetitive jobs. 

The term 'PowerShell' refers to both – the shell used to execute commands and the scripting language that goes along with the framework.

Why did #Microsoft make me change my password?

This is a security feature of all Microsoft accounts which cannot be turned off. 

If the option for 72 days password expiration is enabled in your account then it will automatically ask you to reset password.

To turn off the password feature on Windows 10:

1. Click the Start menu and type "netplwiz." The top result should be a program of the same name — click it to open.

2. In the User Accounts screen that launches, untick the box that says "Users must enter a name and password to use this computer."

3. Hit "Apply."

4. When prompted, re-enter your password to confirm the changes.

Read More



PowerShell Error clear

This article will guide you on how to tackle PowerShell $Error clear and method to clear errors with $Error. 

To clear error variable when you start #PowerShell, simply run $error. clear(). A downside of this method is that you lose all the errors that were generated before you clear the error variable.

To delete a variable, along with its value, use Remove-Variable or Remove-Item. This cmdlet does not delete the values of variables that are set as constants or owned by the #system, even if you use the Force parameter.

1. You can use this variable to represent an absent or undefined value in #commands and #scripts. 

2. #Windows PowerShell treats $null as an object with a value, that is, as an explicit placeholder, so you can use $null to represent an empty value in a series of values.

Read More



Azure PowerShell context objects How to manage them

This article will guide you on how to manage #Azure #PowerShell #context #objects. Azure PowerShell context objects are to hold subscription and authentication information. 

Azure PowerShell is basically an extension of #Windows PowerShell. It lets Windows PowerShell users control Azure's robust functionality. From the command line, Azure PowerShell programmers use preset scripts called cmdlets to perform complex tasks like provisioning virtual #machines (#VMs) or creating #cloud services.

To select Azure subscription in PowerShell:

1. Enter Login-AzAccount and hit enter, then provide your user id and password.

2. Get-AzureSubscription (this will give you the list of subscription).

3. Select-AzureRmSubscription -SubscriptionId xxxxx-xxxxx-xxxxxx-xxxx (this way you can set which particular subscription you want to use).

Read More



Backup Active Directory Domain Controller

This article will guide you on how to #backup #active #directory domain controller.
A System State backup generally includes a copy of any installed device #drivers and related files, most of the Windows directory, the #Windows #Registry, the Active Directory configuration (where applicable) and system files under Windows File Protection.
In production it is best practice to have at least 2 domain controllers per domain. If you factor in each child domain and the other domains that could easily scale up fast if you have two in each one.
To Configure Windows Backup Users on a Domain Controller:
1. Expand Active Directory "Users > Computers > Users".
2. Right-click the appropriate user who will be performing backups and click Properties.
3. On the Member Of tab, click Add to add the Backup Operators group to the User.
4. Click OK.

Read More



Find the Source of Account Lockouts in Active Directory


This article will guide you on steps to find the source of Account Lockouts in the Active Directory #domain.

The most common underlying cause for #AD account lockouts, beyond users forgetting their password, is a running application or background service on a device that is authenticating with stale credentials. 

To Track Source of Account Lockouts in #Active #Directory:

1. Search for the #DC (Domain Controller) having the PDC Emulator Role. 

2. Look for the Event ID 4740. 

3. Put Appropriate Filters in Place. 

4. Find Out the Locked Out Account Event Whose Information is Require. 

5. Open the #Event Report, to Find the Source of the Locked Out account.

Read More



How to create bacpac file from SQL server

This article will guide you on how to export an existing #database into a #BACPAC file is through #SSMS. A bacpac is a dacpac + data, while a dacpac only contains the schema of the database.

To create a Bacpac file:

a. To #export a database using the Azure portal, open the page for your database and click Export on the toolbar.

b. Specify the BACPAC filename, select an existing Azure storage account and container for the export, and then provide the appropriate credentials for access to the source database.

c. Click OK.

To import from a BACPAC file into a new single database using the Azure portal:

1. Open the appropriate server page.

2. On the toolbar, select Import database. 

3. Select the storage account and the container for the BACPAC file and then select the BACPAC file from which to import.

Read More



How to Use PowerShell to Quickly Find Installed Software

This article will guide you on how to get the list of all installed #software using #PowerShell. 

i. First, open PowerShell by clicking on the Start menu and typing “powershell”. 

ii. Select the first option that comes up and you'll be greeted with an empty PowerShell #prompt. 

iii. PowerShell will give you a list of all your #programs, complete with the version, name of the developer, and even the date you installed it.

Read More



Monitor Azure virtual machines with RDP

This article will guide you on how to monitor virtual #machines #RDP using Azure.
You can View performance directly from an Azure VM:
1. In the #Azure portal, select Virtual Machines.
2. From the list, choose a #VM and in the #Monitoring section choose Insights.
3. Select the #Performance tab.

Read More



Clean up Domain Controller DNS Records with Powershell

This article will guide you on the process to clean up Stale/Dead #DC DNS records with the help of #PowerShell. You can see that it is easy to clean up domain controller records with the help of this method using few Windows PowerShell #commands.

To remove old DNS records from a domain controller, simply Remove #DNS Entries by:

1. Right click a #Zone in DNS console and go to properties, Under Name server tab delete the entries that are related to decommissioned DC.

2. Open DNS Console and Remove the IP of the decommissioned DC that might be present on the #network #adapter.

Read More



How to restore Deleted Active Directory Objects and Users

This article will put you through the steps to restore Deleted Active Directory Objects/Users. You can also right click on any unwanted change or object deletion in #Active #Directory and click “Rollback Change” to restore the change with a single-click.

Active Directory #Recycle Bin feature preserves all link valued and non link valued attributes. This means that a restored object will retain all it's settings when restored. By default, a deleted object can be restored within 180 days.

Read More



Testing RPC ports with PowerShell

This article will guide you on how to go about pinging available RPC ports with PowerShell and #Sysinternals tools and we can test #RPC #ports with #PowerShell.

In #Windows, do this by typing "cmd" in the search box in the Start Menu and clicking the command prompt icon. In the command prompt window, type "telnet" followed by a space, then an IP address or domain name followed by another space, and then the port number.

Read More



Steps to deploy DACPAC with SSMS

This article will guide you on the steps to deploy DACPAC which involves registering a DAC instance by storing the DAC definition in the #msdb system database. 

A DAC is a self-contained unit of #SQL Server #database deployment that enables data-tier developers and database administrators to package SQL #Server objects into a portable artifact called a #DAC package, also known as a #DACPAC.

Read More



Configuring Azure Multi factor authentication

This article will guide you on the complete process to set up Azure multi-factor authentication.

Read More



Steps to install OpenLiteSpeed on CentOS

This article will guide you on how to perform installation of OpenLiteSpeed on Centos Server.

Read More



Steps to install Wraith on Ubuntu

This article will guide you on how to install Wraith on Ubuntu which requires adding Ruby, ImageMagick, and some other dependencies added to the system.

Read More



Gradle Installation and Configuration on Linux

This guide will show the steps to install and configure Gradle on Linux and Windows.

Read More



Licensing Mode for Remote Desktop Session Host is not Configured

This article will guide you on the error "Licensing Mode for Remote Desktop Session Host is not Configured" which occurs when the RDS host is running in grace period.

Read More



How to fix corrupt Exchange mailbox

Basically, here is a complete guide on how to fix Corruption of Exchange server mailboxes  which occurs when a client incorrectly updates MAPI flags while processing the mailbox folder elements.

Read More



Solution to PowerShell is not digitally signed error

This article will put you through the steps to fix "PowerShell is not digitally signed" security error which can be triggered when PowerShell Execution Policy is set to AllSigned or RemoteSigned.

Read More



How to use PowerShell to identify Azure unassociated resources

With the PowerShell tool, we can easily find unassociated resources in Azure.

Read More