Home Blog

How to Install RSAT Tools with PowerShell

0

Remote Server Administration Tools (RSAT) are essential for IT administrators managing Windows servers and services from a remote workstation. RSAT tools allow you to manage roles and features installed on Windows Server without needing to log in to the server. This article will guide you through installing RSAT tools using PowerShell on Windows 10 and Windows Server.

Installing RSAT Tools

Check Available RSAT Features

Before installing RSAT tools, you can check which tools are available for installation. Run the following command:

Get-WindowsCapability -Name RSAT* -Online | Select-Object -Property Name, State

This command lists all RSAT features along with their current installation state (Installed or Not Installed).

PS C:\Users> Get-WindowsCapability -Name RSAT* -Online | Select-Object -Property Name, State

Name                                                          State
----                                                          -----
Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0              Installed
Rsat.AzureStack.HCI.Management.Tools~~~~0.0.1.0           Installed
Rsat.BitLocker.Recovery.Tools~~~~0.0.1.0                  Installed
Rsat.CertificateServices.Tools~~~~0.0.1.0                NotPresent
Rsat.DHCP.Tools~~~~0.0.1.0                                Installed
Rsat.Dns.Tools~~~~0.0.1.0                                 Installed
Rsat.FailoverCluster.Management.Tools~~~~0.0.1.0         NotPresent
Rsat.FileServices.Tools~~~~0.0.1.0                       NotPresent
Rsat.GroupPolicy.Management.Tools~~~~0.0.1.0              Installed
Rsat.IPAM.Client.Tools~~~~0.0.1.0                        NotPresent
Rsat.LLDP.Tools~~~~0.0.1.0                               NotPresent
Rsat.NetworkController.Tools~~~~0.0.1.0                  NotPresent
Rsat.NetworkLoadBalancing.Tools~~~~0.0.1.0               NotPresent
Rsat.RemoteAccess.Management.Tools~~~~0.0.1.0            NotPresent
Rsat.RemoteDesktop.Services.Tools~~~~0.0.1.0             NotPresent
Rsat.ServerManager.Tools~~~~0.0.1.0                       Installed
Rsat.StorageMigrationService.Management.Tools~~~~0.0.1.0 NotPresent
Rsat.StorageReplica.Tools~~~~0.0.1.0                     NotPresent
Rsat.SystemInsights.Management.Tools~~~~0.0.1.0          NotPresent
Rsat.VolumeActivation.Tools~~~~0.0.1.0                    Installed
Rsat.WSUS.Tools~~~~0.0.1.0                               NotPresent

Install a Specific RSAT Tool

You can install specific RSAT tools based on your needs. For example, to install the Active Directory Domain Services tools, use the following command:

Add-WindowsCapability -Online -Name Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0

If you want to install multiple RSAT features at once, you can do so by specifying each tool in a single command. For example:

Add-WindowsCapability -Online -Name Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0, Rsat.DHCP.Tools~~~~0.0.1.0, Rsat.DNS.Tools~~~~0.0.1.0

Install All RSAT Tools

If you prefer to install all available RSAT tools at once, you can use the following script:

$RSATTools = Get-WindowsCapability -Name RSAT* -Online | Select-Object -Property Name, State
foreach($RSATTool in $RSATTools){
    if ($RSATTool.State -eq "NotPresent"){
        write-host $RSATTool.Name
        #Add-WindowsCapability -Online -Name $RSATTool.Name
    }
}

The above script checks for all RSAT features that are not installed and installs them.

Accessing RSAT Tools

Once installed, you can access the RSAT tools through the Start menu. Search for the specific tool (like “Active Directory Users and Computers” or “DNS Manager”) to launch it.

Conclusion

Installing RSAT tools with PowerShell is a straightforward process that significantly enhances remote management capabilities for IT professionals. Whether you’re installing specific tools or all of them at once, PowerShell provides a powerful way to manage your Windows environment efficiently. With RSAT tools, managing remote servers becomes more seamless and effective, allowing you to focus on critical administrative tasks.

Top 5 PowerShell Modules for Managing M365, Azure, Entra ID, Exchange Online and Active Directory

0

PowerShell has become an essential tool for IT administrators managing Microsoft 365 (M365), Azure, Entra ID, and Active Directory. With its rich set of modules, PowerShell provides powerful capabilities for automating and streamlining administrative tasks. Here are the top five PowerShell modules that every IT pro should consider to effectively manage these environments

1. Azure PowerShell Module (Az)

Overview

The Az module is designed to manage Azure resources efficiently. It provides a set of cmdlets that allow for resource creation, modification, and deletion within Azure.

Key Features
  • Manage Azure resources (VMs, databases, storage).
  • Automate deployment tasks using scripts.
  • Role-Based Access Control (RBAC) for managing permissions.
Installation

To install the Az module, follow these steps:

# Open PowerShell as an administrator
Install-Module -Name Az 

To update the module, use:

Update-Module -Name Az

2. Microsoft Graph PowerShell SDK

Overview

The Microsoft Graph PowerShell SDK allows administrators to interact with Microsoft 365 services through the Microsoft Graph API, facilitating user and resource management.

Key Features

  • Unified API access for users, groups, and devices.
  • Extensive functionality for user management and reporting.
  • Support for asynchronous operations.

Installation

To install the Microsoft Graph PowerShell SDK, run:

# Open PowerShell as an administrator
Install-Module -Name Microsoft.Graph

To update the SDK, use:

Update-Module -Name Microsoft.Graph

3. Azure Active Directory PowerShell Module (AzureAD)

Overview

The AzureAD module is focused on managing Azure Active Directory (AAD). While Microsoft encourages transitioning to the Microsoft Graph SDK, AzureAD is still widely used.

Key Features

  • Efficient user and group management.
  • Detailed reporting and auditing capabilities.
  • Conditional access policies management.

Installation

To install the AzureAD module, execute

# Open PowerShell as an administrator
Install-Module -Name AzureAD

To update the module, use:

Update-Module -Name AzureAD

4. Exchange Online PowerShell Module

Overview

The Exchange Online PowerShell module allows administrators to manage Exchange Online settings, mailboxes, and features.

Key Features

  • Manage mailbox creation, modification, and permissions.
  • Generate reports on mailbox usage and compliance.
  • Configure security settings, including spam filters.

Installation

To install the Exchange Online PowerShell module, use:

# Open PowerShell as an administrator
Install-Module -Name ExchangeOnlineManagement

To update the module, use:

Update-Module -Name ExchangeOnlineManagement

5. Active Directory Module for Windows PowerShell

Overview

The Active Directory module allows administrators to manage on-premises Active Directory (AD) environments, making it essential for hybrid setups.

Key Features

  • Comprehensive management of AD objects.
  • Group Policy management capabilities.
  • Monitoring and management of AD replication and sites.

Installation

To install the AD PowerShell module, use:

$RSATActiveDirectory = get-windowscapability -name RSAT* -Online | Select-Object -Property Displayname, Name, State  | where Name -Like "*ActiveDirectory*"
Add-WindowsCapability -Online -Name $RSATActiveDirectory.Name

Please note that the above script will install the Active Directory Domain Services RSAT feature which includes the AD PowerShell Module.

Conclusion

PowerShell modules are vital for efficiently managing modern IT environments, particularly with Microsoft’s cloud services. By leveraging the Az, Microsoft Graph, AzureAD, Active Directory, and Exchange Online modules, IT administrators can streamline operations and enhance productivity. The installation steps provided will help you get started quickly, allowing you to take full advantage of these powerful tools.

How to bulk adding computers to Active Directory group with PowerShell

0

Managing Active Directory (AD) groups can often require bulk updates, such as adding multiple computers to a specific group. PowerShell provides a powerful way to automate these tasks, making the process efficient and straightforward.

Active Directory Module is required, if you already have installed RSAT tools (Remote Server Administration Tools) on your device, then the Active Directory module should be installed and imported by default.

Create a list of devices

Create a text file with all the devices that you want to add to an AD Group, as shown below:

Add the devices to an AD Security Group

The first thing we need to do is to import the computers list, by using the Get-Content command.

#Import the computers list and assign to a variable
$devices = Get-Content "C:\temp\computers.txt"

Then we need to assign the Security Group name to a variable

#Define the AD Security Group name
$groupName = "ReplaceWithYourADGroupName"

finally, we’re going to loop through each device in the $devices list and add to the AD Security Group

#Loop through each computer and add it to the group
foreach ($device in $devices) {
    try {
        Add-ADGroupMember -Identity $groupName -Members $device
        Write-Host "Successfully added $device to $groupName"
    } catch {
        Write-Host "Failed to add $computer"
    }
}

here’s the full script:

#Import the computers list and assign to a variable
$devices = Get-Content "C:\temp\computers.txt"
#Define the AD Security Group name
$groupName = "ReplaceWithYourADGroupName"
# Loop through each computer and add it to the group
foreach ($device in $devices) {
    try {
        Add-ADGroupMember -Identity $groupName -Members $device
        Write-Host "Successfully added $device to $groupName"
    } catch {
        Write-Host "Failed to add $device"
    }
}

Verify the addition

After running the script, it’s always a good practice to check whether the devices got added to the group or not, you can check the members of the group using the following command:

Get-ADGroupMember -Identity $groupName

you can also export the current members of the group to a CSV file

Get-ADGroupMember -Identity $groupName | Export-Csv -Path "c:\temp\$groupName-members.csv

Conclusion

Using PowerShell to add computers to an Active Directory group simplifies management tasks and enhances efficiency. By automating the process, you can save time and reduce the likelihood of errors. Always ensure you have the necessary permissions and validate your changes to maintain the integrity of your Active Directory environment.