PowerShell Archives - One admin's notes https://www.kondaurov.me/tag/powershell/ PowerShell, Office 365, Azure and automation Tue, 15 Oct 2024 06:06:02 +0000 en-US hourly 1 https://wordpress.org/?v=6.7.1 https://www.kondaurov.me/wp-content/uploads/ms-icon-310x310-150x150.png PowerShell Archives - One admin's notes https://www.kondaurov.me/tag/powershell/ 32 32 Unlock Terraform state on Azure storage https://www.kondaurov.me/2022/unlock-terraform-state-on-azure-storage/ https://www.kondaurov.me/2022/unlock-terraform-state-on-azure-storage/#respond Fri, 11 Feb 2022 14:33:05 +0000 https://www.kondaurov.me/?p=660 I’ve been in an awkward situation once, when I was provisioning Azure resources using Terraform via Azure DevOps pipeline. Pipeline stuck with the provisioning and I cancelled the apply step. The state file got locked. As it is stored on Azure Blob Storage in a dedicated container and only the Service Principal …

The post Unlock Terraform state on Azure storage appeared first on One admin's notes.

]]>
https://www.kondaurov.me/2022/unlock-terraform-state-on-azure-storage/feed/ 0
Add Windows local users and admins by PowerShell https://www.kondaurov.me/2021/add-windows-local-users-and-admins-by-powershell/ https://www.kondaurov.me/2021/add-windows-local-users-and-admins-by-powershell/#respond Fri, 16 Jul 2021 10:07:48 +0000 https://www.kondaurov.me/?p=396 Once I got a task to create Windows Server local users on 10 machines and give them Admin permissions. I’ve found that I’d rather automate and be effective. I prefer to spend 10 minutes writing a script and 10 minutes running it rather than spending 30 minutes for manual job. This small …

The post Add Windows local users and admins by PowerShell appeared first on One admin's notes.

]]>
https://www.kondaurov.me/2021/add-windows-local-users-and-admins-by-powershell/feed/ 0
Azure File Sync: Synchronize files with your own schedule https://www.kondaurov.me/2021/azure-file-sync-run-with-your-own-schedule/ https://www.kondaurov.me/2021/azure-file-sync-run-with-your-own-schedule/#respond Thu, 01 Jul 2021 09:30:55 +0000 https://www.kondaurov.me/?p=378 When I was implementing Azure Storage File Sync solution, I found that it worked pretty quick with the files to be uploaded from a server to the cloud storage. The reason for it is the agent installed on the server that checks for file changes. Unfortunately, when a file needs to be …

The post Azure File Sync: Synchronize files with your own schedule appeared first on One admin's notes.

]]>
https://www.kondaurov.me/2021/azure-file-sync-run-with-your-own-schedule/feed/ 0
Install PS 5.1 and Az PowerShell to Windows Server 2008R2 https://www.kondaurov.me/2021/install-ps-5-1-and-az-powershell-to-windows-server-2008r2/ https://www.kondaurov.me/2021/install-ps-5-1-and-az-powershell-to-windows-server-2008r2/#respond Sat, 12 Jun 2021 10:36:46 +0000 https://www.kondaurov.me/?p=351 Once I got a task that required PowerShell Az modules to be installed on a Windows Server 2008 R2 box. Azure PowerShell modules update quite often and I wasn’t sure if that will work at all. I found on MS Docs site that there is a need to install at least PowerShell …

The post Install PS 5.1 and Az PowerShell to Windows Server 2008R2 appeared first on One admin's notes.

]]>
https://www.kondaurov.me/2021/install-ps-5-1-and-az-powershell-to-windows-server-2008r2/feed/ 0
Send test email with PowerShell https://www.kondaurov.me/2021/send-test-email-powershell/ https://www.kondaurov.me/2021/send-test-email-powershell/#respond Fri, 21 May 2021 10:09:01 +0000 https://www.kondaurov.me/?p=285 It is a quite common situation. when you need to send an email from a PowerShell script that contains a status report or another kind of data. Nevertheless, before you can send a normal email you would like to run a quick test to confirm that you can send email from this …

The post Send test email with PowerShell appeared first on One admin's notes.

]]>
https://www.kondaurov.me/2021/send-test-email-powershell/feed/ 0
AD DC replication test using PowerShell https://www.kondaurov.me/2021/ad-dc-replication-test-powershell-script/ https://www.kondaurov.me/2021/ad-dc-replication-test-powershell-script/#respond Mon, 05 Apr 2021 13:15:37 +0000 https://www.kondaurov.me/?p=223 I believe that every server, and a Domain Controller especially, should be tested after a restart or another kind of maintenance job. The task to test AD DC replication test using PowerShell needs to be executed on each DC in AD. My team asked me if there is a way to automate Active …

The post AD DC replication test using PowerShell appeared first on One admin's notes.

]]>
https://www.kondaurov.me/2021/ad-dc-replication-test-powershell-script/feed/ 0
Adding a new column of data to an existing CSV by PowerShell https://www.kondaurov.me/2021/adding-a-new-column-of-data-to-an-existing-csv-by-powershell/ https://www.kondaurov.me/2021/adding-a-new-column-of-data-to-an-existing-csv-by-powershell/#comments Wed, 17 Mar 2021 11:49:08 +0000 https://www.kondaurov.me/?p=230 This could be helpful when you need to update existing CSV file and you don’t have Excel in hand. You can do it in Notepad for sure, but it is easier with PowerShell. If you are curious what else you can do with Excel spreadsheets in PowerShell – check out the ImportExcel …

The post Adding a new column of data to an existing CSV by PowerShell appeared first on One admin's notes.

]]>
https://www.kondaurov.me/2021/adding-a-new-column-of-data-to-an-existing-csv-by-powershell/feed/ 9
Find Azure Linux image ID or URN using PowerShell https://www.kondaurov.me/2020/find-azure-linux-image-id-or-urn/ https://www.kondaurov.me/2020/find-azure-linux-image-id-or-urn/#respond Fri, 24 Jul 2020 09:31:48 +0000 https://www.kondaurov.me/?p=93 One day, I was playing with Chef test kitchen in Azure. There was only one option – to use azurerm driver. There was heaps of examples for Ubuntu or Windows server, but I needed SUSE. It is not a big deal to provision from Azure portal, but how can I do that with …

The post Find Azure Linux image ID or URN using PowerShell appeared first on One admin's notes.

]]>
https://www.kondaurov.me/2020/find-azure-linux-image-id-or-urn/feed/ 0
Azure Linux VM performance tuning https://www.kondaurov.me/2020/azure-vm-optimisations/ https://www.kondaurov.me/2020/azure-vm-optimisations/#respond Mon, 23 Mar 2020 10:51:16 +0000 http://www.inode.ru/?p=59 I was looking for options, what I can do in Azure to speed up (optimize) a stack of servers for one business application. They were built approximately 2 years ago, and some features were not available at that time. Good that machines running on quite fresh version of Linux that has a …

The post Azure Linux VM performance tuning appeared first on One admin's notes.

]]>
https://www.kondaurov.me/2020/azure-vm-optimisations/feed/ 0