- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Chirag Nagrekar has Published 465 Articles
Chirag Nagrekar
7K+ Views
To get all the Azure resource groups connected to the particular subscription use the az group command.Before using this command make sure you are connected with the Azure account and if not connect the azure account with the “Az login”Once you are connected to the Azure account, set the subscription ... Read More
Chirag Nagrekar
8K+ Views
To connect to the specific azure subscription using Az CLI we need to use “Az account set” command but before using this command make sure you are connected with the Azure cloud using “az login” account.az account set --subscription 'subscription name or id'You can also use -s instead of --subscription.az ... Read More
Chirag Nagrekar
12K+ Views
To login to the Azure account using Azure CLI, we need to use the az login command. Once you type the az login command, it will prompt for the Azure portal login console.If you need to log in with the device authentication code in the browser, you need to use ... Read More
Chirag Nagrekar
431 Views
To get the Application security groups of the Azure VM using PowerShell, we need to first get the Network Interface of the Azure VM.The below command will retrieve the NIC name of the Azure VM.PS C:\> $vm = Get-AzVM -Name TestVM $nic = (($vm.NetworkProfile.NetworkInterfaces.id).Split('/'))[-1]Once we have the NIC name, we ... Read More
Chirag Nagrekar
2K+ Views
To get all the subnets attached to the virtual network using PowerShell, we need to use the GetAzVirtualNetwork command.PS C:\> $vn = Get-AzVirtualNetwork -Name VirtualNetworkNameTo get the Subnets and its address prefix details, you need to filter out the Subnets and AddressPrefixPS C:\> $vn.Subnets | Select Name, AddressPrefix
Chirag Nagrekar
14K+ Views
To get all the files that are modified after certain days, we need to use the LastWriteTime property.The below command shows us the files which are modified within the last 30 days in the C:\temp folder.Get-ChildItem C:\Temp | where{$_.LastWriteTime -ge (GetDate).AddDays(-30)}You can also use the AddMonths() or AddYears() instead of ... Read More
Chirag Nagrekar
9K+ Views
To change the local user account password using PowerShell, we can use the Set-LocalUser command with the Password parameter. This password parameter should be in the secure string. So we need to ask the user to input the password as a secure string or need to explicitly convert the plain ... Read More
Chirag Nagrekar
8K+ Views
We can retrieve the file extension using multiple ways. First, using the [System.IO.Path] class.PS C:\> [System.IO.Path]::GetExtension("C:\temp\25Aug2020.txt") .txt PS C:\> [System.IO.Path]::GetExtension("C:\temp\azcopy.zip") .zipThis is the easiest way to get the file extension. Otherways, Using programmatically, PS C:\> ((Split-Path "C:\Temp\azcopy.zip" -Leaf).Split('.'))[1] zip PS C:\> ((Split-Path "C:\Temp\25Aug2020.txt" -Leaf).Split('.'))[1] txtUsing Get-ChildItem, PS C:\> (Get-ChildItem C:\Temp\azcopy.zip).Extension ... Read More
Chirag Nagrekar
2K+ Views
To set the local user account settings related to the account or the password expiration, we can use the Set-LocalUser command.The below command will change the local user Testuser account and password set to never expire.Set-LocalUser -Name Testuser -AccountNeverExpires -PasswordNeverExpires $true -VerboseThe below command will set the account expiry, Set-LocalUser ... Read More
Chirag Nagrekar
1K+ Views
To get the locked user accounts on the local or the remote machines using PowerShell, we can use the wmi method.PS C:\> gwmi win32_useraccount | where{$_.Lockout -eq $true}You can also use the CIM instance method alternatively.PS C:\> Get-CimInstance Win32_Useraccount | where{$_.Lockout -eq $true}To get the locked local user accounts on ... Read More
To Continue Learning Please Login
Login with Google