Adding computers to Active Directory (AD)
DoIT's recommended method for creating computer accounts "properly" in Campus Active Directory (CAD) is using Powershell scripting. The CALS AD Team has created a Powershell CmdLet within the CALS ADTools Powershell Module to aid in creating computer accounts.
Overview
- Requirements:
- RSAT: Active Directory Domain Serivces and Lightweight Directory Service Tools
- CALS ADTools Powershell Module
- Commands will executed under a CALS T2 accounts. This can be accomplished:
- Use a CALS IT Jump Server (recommended). No further setup is needed - skip to Adding a computer
- OR Start a Powershell session with your T2 account (Powershell 7.x is recommended, but not required)
- OR Login to your workstation with a T2 account.
Install RSAT Active Directory
If Remote Server Administration Tools (RSAT) Active Directory has not been installed, install that first.
- Run Powershell as administrator

- Run this command:
Add-WindowsCapability -Name Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0 -Online
FIrst Time using CALS ADTools on a workstation
**this step is not needed on CALS Jump Servers**
You need to register the CALS Repository and install the CALS ADTools module. Start Powershell and run the following commands.
Register-PSRepository -Name CALSNuGet -SourceLocation "https://nuget.cals.wisc.edu" -InstallationPolicy Trusted
Install-Module -Name CALS-ADTools -Repository CALSNuGet -Scope CurrentUser
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Starting Powershell with T2 account
***this step is unnecessary if using the CALS Jump server OR if logged into workstation with T2 account***
- Open a Command Prompt

- Type the following command.
Using Powershell 5 (default on Windows 11)runas /netonly /user:ewdieckman-t2@ad.wisc.edu powershell
OR Using Powershell 7.x (recommended)runas /netonly /user:ewdieckman-t2@ad.wisc.edu pwsh
Adding A Computer
- Run Powershell
- Import the CALS ADTools Powershell module
Import-Module CALS-ADTools - Type the
New-CALSComputercommand - Enter the computer name (i.e. CALSWK-123456)
Ignore if you receive an error about being unable to download UnitCode.csv. This is expected behavior on Jump Servers - Select the Tier. Tier 2 is the default.
- Select which Unit will house this new computer above using the number next to it.
- The computer account should be created in the Devices OU within the Unit that you selected.

If you wish, you can script the entire command in one command.New-CALSComputer -ComputerName CALSWK-123456 -UnitCode AAE -Description 'I am describing this computer' -Tier 2
