- Trending Categories
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
Found 2043 Articles for Microsoft Technologies
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
3K+ Views
We can get the list of opened applications in Windows using PowerShell using Get-Process command. Get-Process command shows the currently running processes in the foreground and the background as well.If we simply run the Get-Process command then it will give the process names and their associated process IDs and CPU, memory usage.PS C:\> Get-ProcessIf we check the members of the Get-Process, there is a MainWindowsTitle Property. This property indicates the Title of the opened application.In the below example, we will find the Application Name, associated process, and the ID of the application. For example, Get-Process | Select MainWindowTitle, ProcessName, Id ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
867 Views
To delete the OU from the Active Directory using PowerShell, we need to use the command Remove-ADOrganizationUnitRemove-ADOrganizationalUnit -Identity "OU=LabUsers, DC=Labdomain, DC=Local"If the OU is protected from the accidental delete, you will receive an Access is Denied error as shown below.Remove-ADOrganizationalUnit : Access is denied At line:1 char:1 + Remove-ADOrganizationalUnit -Identity "OU=LabUsers, DC=Labdomain, DC=Lo ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : PermissionDenied: (OU=LabUsers, DC=Labdomain, DC=Local:ADOrganizationalUnit) [Remove-ADOrgan izationalUnit], UnauthorizedAccessException + FullyQualifiedErrorId : ActiveDirectoryCmdlet:System.UnauthorizedAccessException, Microsoft.ActiveDirectory.Managem ent.Commands.RemoveADOrganizationalUnitSo for that, first you need to disable the protected mode using the Set-ADOrganizationalUnit command and then need to run the remove command as shown below.$ou = "OU=LabUsers, DC=Labdomain, ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
2K+ Views
To remove all users from the specific OU, we need to first retrieve the users from that OU. For example, we have 3 users in the OU called LABDOMAIN and we need to delete them all.Get-ADUser -SearchBase "OU=LabUsers, DC=labdomain, DC=local" -Filter *The above command will retrieve users from the specific OU and then we can use the Remove-ADUser command to delete them all.ExampleGet-ADUser -SearchBase "OU=LabUsers, DC=labdomain, DC=local" -Filter * | Remove-ADUser -Confirm:$false -Verbose-Confirm switch has been added to bypass the confirmation for all the users. The default confirmation is true.OutputVERBOSE: Performing the operation "Remove" on target "CN=JensonA, OU=LabUsers, DC=labdomain, DC=local". ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
280 Views
We can rename a drive letter of a disk using PowerShell with the Set-Partition command. An example is shown below.In the Windows OS, we have E: and we need to rename its partition to the F: You can run the below command.Set-Partition -DriveLetter 'E' -NewDriveLetter 'F'You can also run the Get-Partition command and Pipeline the Set-Partition command. For example, Get-Partition -DriveLetter 'E' | Set-Partition -NewDriveLetter 'F'If you want to rename the drive on the remote computer, then you need to take the CIMSession of the system and run the command. For example, $sess = New-CimSession -ComputerName 'Test1-Win2k12' Set-Partition -CimSession $sess ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
1K+ Views
Using Random Account NameTo create bulk users in the AD using PowerShell, there are multiple methods. For example, let say if you want to create 50 sample users for the lab environment without considering the other required properties, then you can use the below command, $pass = Read-Host "Enter Account Password " -AsSecureString 1..50 | foreach{ New-ADUser -Name "TempUser$_" -AccountPassword $pass -Path "OU=LabUsers, DC=labdomain, DC=local" -ChangePasswordAtLogon $true -Enabled $true -PasThru}The above command will create 50 Temp users in the OU named LABUSERS and one time we need to enter the password while running the script and when users log in ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
25K+ Views
PowerShell modules are stored in their module path. Module paths can be retrieved using an environmental variable $env:PSModulePath. To get a better view, we will split the variable path with a semicolon.$env:PSModulePath -split ';' C:\Users\Administrator\Documents\WindowsPowerShell\Modules C:\Program Files\WindowsPowerShell\Modules C:\Windows\system32\WindowsPowerShell\v1.0\ModulesYou can see the 3 paths above. Each path has Modules stored as per their scopes.Documents Path: Modules are stored in this path when you provide the scope – CurrentUser while installing the module.Program files path: Modules are stored in this path when AllUsers Scope is provided.System32 path: It is the default path for the module. Whenever Microsoft updates any PowerShell version or module, it ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
208 Views
To know which parameters are supported by cmdlets, Get-Command retrieves the properties of the command. For example, We need to find the Get-Process parameters so the Get-Command will retrieve the command information and Full List will provide you the properties.Get-Command Get-Process | flOnce you run the command, it shows the ParameterSets property and they are the parameters supported by cmdlets.PS C:\> (Get-Command Get-Process).ParameterSets |ft -AutoSize Name IsDefault Parameters ---- --------- ---------- Name True {Name, ComputerName, Module, FileVersionInfo..} ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
2K+ Views
Split-Path is to retrieve the part of the specified path, such as a parent folder, a subfolder, or a file name. It can also tell if the path is relative or absolute.This command supports a few parameters which help to retrieve the part of the specified path. Consider we have below executable file path and we will see how the Split-Path command will retrieve the parent folder and subfolder as well as the root directory.'C:\Temp\PsExec.exe'Default Split-Path command will retrieve the parent folder name of the file.PS C:\> Split-Path 'C:\Temp\PsExec.exe' C:\TempHere the default parameter is -Parent, which retrieves the parent folder path. Above command ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
17K+ Views
Ipconfig /all command also retrieves the DNS settings for all the network interfaces. This command can be run on both cmd and PowerShell. For example, ExamplePS C:\Users\Administrator> ipconfig /all Windows IP Configuration Host Name . . . . . . . . . . . . : Test1-Win2k16 Primary Dns Suffix . . . . . . . : labdomain.local Node Type . . . . . . . . . . . . : Hybrid IP Routing Enabled. . . . . . . . : No WINS Proxy Enabled. . . . . . . . ... Read More
![Chirag Nagrekar](https://www.tutorialspoint.com/assets/profiles/163503/profile/60_109370-1581658197.png)
3K+ Views
To get the IP address of the system we can use IPConfig command in cmd and the same command can be used in PowerShell. IPConfig command shows all the connected and disconnected adapters including IPv4 and IPv6. For example, ExamplePS C:\Users\Administrator> Ipconfig Windows IP Configuration Ethernet adapter Ethernet0: Connection-specific DNS Suffix . : IPv4 Address. . . . . . . . . . . : 192.168.0.104 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.0.1 Tunnel adapter isatap.{27E40122-664A-404D-A4C9-4E48C0363BC5}: ... Read More