MSDN Archive Home
Help and FAQs
All Resource Updates
Change History (all pages)
With Primary Computers feature in Windows 8, administrators can limit the Folder Redirection and Roaming User Profiles technologies to be applied only to a set of
computers for the users. This association of primary computers for a given user is established in a linked attribute in Active Directory called ms-DS-PrimaryComputer. Manipulating this list through the ADAC (Active Directory Administrative Console) can become error-prone, and cumbersome if administrators are doing it on a regular basis for more than a few users. The scripts below are intended to ease the process of establishing the primary computer relationship for users and even automate it for a large number of users.
This release includes four powershell cmdlets and these are:
Get-XADPrimaryComputer : Retrieves the list of primary computers for a user from Active Directory
Get-XADPrimaryUser : Retrieves the list of primary users for a computer from Active Directory
Add-XADPrimaryComputer : Adds a computer to the list of primary computers for a user in Active Directory
Remove-XADPrimaryComputer : Removes a computer from the list of primary computers for a user in Active Directory
These cmdlets have been developed using all the Powershell best practices and they provide detailed help and examples.
The Powershell cmdlets can be executed from computers running Windows® 7, Windows Server® 2008 R2, Windows® 8 and Windows Server® 2012.
The Active Directory Powershell Module needs to be installed.
Please follow the steps below to install the PrimaryComputer powershell module.
Install the Active Directory Powershell module following the instructions
Unblock the PrimaryComputer.zip file if necessary.
Extract the PrimaryComputer.zip file to a folder called PrimaryComputer. (
Please retain the folder name specified in the example
Copy the PrimaryComputer folder to one of the directories in
Launch Powershell and execute Import-Module PrimaryComputer
On Windows® 7, Windows Server® 2008 R2, you will have to import the Active Directory powershell module using Import-Module ActiveDirectory before this step.
You are ready to use the powershell cmdlets
To get a list of cmdlets, execute Get-Command -Module PrimaryComputer in your powershell window after you have successfully loaded the module.
Additional information on Primary Computer can be found here:
Configuring Primary Computers
Information on Powershell cmdlets for Active Directory can be found here:
Active Directory Administration with Windows Powershell
May 24 2012 at 6:59 PM
, version 11
Sign in to add a comment
Wed May 23 2012 at 7:00 AM
More Tags ...
Visual Studio 2005
Visual Studio 2008
Visual Studio 2010
Manage Your Profile
MSDN Flash Newsletter
© 2008 Microsoft Corporation. All rights reserved.